// Path: sft-core/src/test/java/sft/integration/fixtures/JavaResource.java
// public class JavaResource extends SftResource {
// 
//     private final HtmlResources htmlResources = new HtmlResources();
//     private final SftDocumentationConfiguration configuration;
// 
//     public JavaResource(Class javaClass) {
//         super(javaClass, ".java.html");
//         configuration = new SftDocumentationConfiguration();
//         createJavaHtml();
//     }
// 
//     private static void copy(Reader input, Writer output) throws IOException {
//         String read = getStringBuffer(input);
//         while (read != null) {
//             output.write(read.replace("<", "&lt;").replace(">", "&gt;"));
//             read = getStringBuffer(input);
//         }
//     }
// 
//     private static String getStringBuffer(Reader input) throws IOException {
//         char[] buffer = new char[1024];
//         int bufferSize = input.read(buffer);
//         if (-1 == bufferSize) {
//             return null;
//         } else {
//             return new String(buffer, 0, bufferSize);
//         }
//     }
// 
//     private void createJavaHtml() {
//         try {
//             File htmlJavaFile = configuration.getReport(HtmlReport.class).getReportFolder().createFileFromClass(targetClass, extension);
// 
//             Writer html = new OutputStreamWriter(new FileOutputStream(htmlJavaFile));
//             html.write("<html><head><title>\n");
//             html.write(targetClass.getCanonicalName() + "\n");
//             html.write("</title>\n");
//             html.write(htmlResources.getIncludeCssDirectives(targetClass));
//             html.write("</head>\n");
//             html.write("<body><div class='panel panel-default'><div class='panel-heading'><h3 class='panel-title'>Source file</h3></div><div class='panel-body'><pre>\n");
// 
//             File javaFile = configuration.getSourceFolder().getFileFromClass(targetClass, ".java");
// 
//             InputStream javaIn = new FileInputStream(javaFile);
//             Reader reader = new InputStreamReader(javaIn, "UTF-8");
//             copy(reader, html);
// 
//             html.write("</pre></div></div></body></html>");
//             html.close();
//         } catch (IOException e) {
//             throw new RuntimeException(e);
//         }
//     }
// }
// 
// Path: sft-core/src/test/java/sft/integration/set/sut/CommonUseCase.java
// @RunWith(SimpleFunctionalTest.class)
// public class CommonUseCase {
// 
//     public SubUseCase1 subUseCase1 = new SubUseCase1();
//     public SubUseCase2 subUseCase2 = new SubUseCase2();
// 
//     @Test
//     public void scenario(){
//         fixtureCall();
//     }
// 
//     private void fixtureCall() {
//         Assert.assertTrue(true);
//     }
// }


import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import sft.Decorate;
import sft.DefaultConfiguration;
import sft.Displayable;
import sft.SimpleFunctionalTest;
import sft.Text;
import sft.UseCase;
import sft.decorators.Breadcrumb;
import sft.decorators.Group;
import sft.integration.fixtures.JavaResource;
import sft.integration.set.sut.CommonUseCase;
import sft.integration.set.sut.CustomConfiguration;
import sft.integration.set.sut.UseCaseWithSpecificConfiguration;
import sft.report.HtmlResources;
package sft.integration.set;



@RunWith(SimpleFunctionalTest.class)
@Decorate(decorator = Breadcrumb.class)
public class Settings {

    private static final String AVAILABLE_SETTINGS = "Available settings";
    @Displayable
    private String files;
    private UseCase useCase;

    @Decorate(decorator = Group.class,parameters = AVAILABLE_SETTINGS)
    public HtmlReportSettings htmlReportSettings = new HtmlReportSettings();
    @Decorate(decorator = Group.class,parameters = AVAILABLE_SETTINGS)
    public SourceAndClassSettings sourceAndClassSettings = new SourceAndClassSettings();



    @Test
    public void configurationMechanism() throws Exception {
        allSettingsOfAnUseCaseAreHoldByTheClassDefaultConfiguration();
        toModifySettingsYouHaveToCreateAnInheritedClassFromDefaultConfigurationAndChangeSettingInTheConstructor();
        thenYouCanInjectConfigurationByAnnotatedUseCaseJavaClassWithUsingCustomConfiguration();
        allRelatedUseCasesWillUseThisConfiguration();
    }

    private void allSettingsOfAnUseCaseAreHoldByTheClassDefaultConfiguration() throws Exception {
        useCase = new UseCase(CommonUseCase.class);
// Path: sft-core/src/test/java/sft/integration/fixtures/JavaResource.java
// public class JavaResource extends SftResource {
// 
//     private final HtmlResources htmlResources = new HtmlResources();
//     private final SftDocumentationConfiguration configuration;
// 
//     public JavaResource(Class javaClass) {
//         super(javaClass, ".java.html");
//         configuration = new SftDocumentationConfiguration();
//         createJavaHtml();
//     }
// 
//     private static void copy(Reader input, Writer output) throws IOException {
//         String read = getStringBuffer(input);
//         while (read != null) {
//             output.write(read.replace("<", "&lt;").replace(">", "&gt;"));
//             read = getStringBuffer(input);
//         }
//     }
// 
//     private static String getStringBuffer(Reader input) throws IOException {
//         char[] buffer = new char[1024];
//         int bufferSize = input.read(buffer);
//         if (-1 == bufferSize) {
//             return null;
//         } else {
//             return new String(buffer, 0, bufferSize);
//         }
//     }
// 
//     private void createJavaHtml() {
//         try {
//             File htmlJavaFile = configuration.getReport(HtmlReport.class).getReportFolder().createFileFromClass(targetClass, extension);
// 
//             Writer html = new OutputStreamWriter(new FileOutputStream(htmlJavaFile));
//             html.write("<html><head><title>\n");
//             html.write(targetClass.getCanonicalName() + "\n");
//             html.write("</title>\n");
//             html.write(htmlResources.getIncludeCssDirectives(targetClass));
//             html.write("</head>\n");
//             html.write("<body><div class='panel panel-default'><div class='panel-heading'><h3 class='panel-title'>Source file</h3></div><div class='panel-body'><pre>\n");
// 
//             File javaFile = configuration.getSourceFolder().getFileFromClass(targetClass, ".java");
// 
//             InputStream javaIn = new FileInputStream(javaFile);
//             Reader reader = new InputStreamReader(javaIn, "UTF-8");
//             copy(reader, html);
// 
//             html.write("</pre></div></div></body></html>");
//             html.close();
//         } catch (IOException e) {
//             throw new RuntimeException(e);
//         }
//     }
// }
// 
// Path: sft-core/src/test/java/sft/integration/set/sut/CommonUseCase.java
// @RunWith(SimpleFunctionalTest.class)
// public class CommonUseCase {
// 
//     public SubUseCase1 subUseCase1 = new SubUseCase1();
//     public SubUseCase2 subUseCase2 = new SubUseCase2();
// 
//     @Test
//     public void scenario(){
//         fixtureCall();
//     }
// 
//     private void fixtureCall() {
//         Assert.assertTrue(true);
//     }
// }


// Path: sft-core/src/test/java/sft/integration/set/Settings.java
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import sft.Decorate;
import sft.DefaultConfiguration;
import sft.Displayable;
import sft.SimpleFunctionalTest;
import sft.Text;
import sft.UseCase;
import sft.decorators.Breadcrumb;
import sft.decorators.Group;
import sft.integration.fixtures.JavaResource;
import sft.integration.set.sut.CommonUseCase;
import sft.integration.set.sut.CustomConfiguration;
import sft.integration.set.sut.UseCaseWithSpecificConfiguration;
import sft.report.HtmlResources;

package sft.integration.set;



@RunWith(SimpleFunctionalTest.class)
@Decorate(decorator = Breadcrumb.class)
public class Settings {

    private static final String AVAILABLE_SETTINGS = "Available settings";
    @Displayable
    private String files;
    private UseCase useCase;

    @Decorate(decorator = Group.class,parameters = AVAILABLE_SETTINGS)
    public HtmlReportSettings htmlReportSettings = new HtmlReportSettings();
    @Decorate(decorator = Group.class,parameters = AVAILABLE_SETTINGS)
    public SourceAndClassSettings sourceAndClassSettings = new SourceAndClassSettings();



    @Test
    public void configurationMechanism() throws Exception {
        allSettingsOfAnUseCaseAreHoldByTheClassDefaultConfiguration();
        toModifySettingsYouHaveToCreateAnInheritedClassFromDefaultConfigurationAndChangeSettingInTheConstructor();
        thenYouCanInjectConfigurationByAnnotatedUseCaseJavaClassWithUsingCustomConfiguration();
        allRelatedUseCasesWillUseThisConfiguration();
    }

    private void allSettingsOfAnUseCaseAreHoldByTheClassDefaultConfiguration() throws Exception {
        useCase = new UseCase(CommonUseCase.class);
        Assert.assertEquals(DefaultConfiguration.class, useCase.configuration.getClass());