Package org.junithelper.core.config

Examples of org.junithelper.core.config.Configuration


    TestCaseGeneratorImpl target;
    ClassMetaExtractor classMetaExtractor;

    @Before
    public void setUp() {
        config = new Configuration();
        lineBreakProvider = new LineBreakProvider(config, CurrentLineBreak.CRLF);
        target = new TestCaseGeneratorImpl(config, lineBreakProvider);
        classMetaExtractor = new ClassMetaExtractor(config);
    }
View Full Code Here


        assertNotNull(TestCaseGeneratorImpl.class);
    }

    @Test
    public void instantiation() throws Exception {
        Configuration config = new Configuration();
        lineBreakProvider = new LineBreakProvider(config, CurrentLineBreak.CRLF);
        TestCaseGeneratorImpl target = new TestCaseGeneratorImpl(config, lineBreakProvider);
        assertNotNull(target);
    }
View Full Code Here

        assertEquals("doSomething", actual.get(2).methodMeta.name);
    }

    @Test
    public void getNewTestCaseSourceCode_A$_JUnit3() throws Exception {
        Configuration config = new Configuration();
        config.junitVersion = JUnitVersion.version3;
        TestCaseGeneratorImpl target = new TestCaseGeneratorImpl(config, lineBreakProvider);
        String sourceCodeString = "package hoge.foo; import java.util.List;\r\nimport java.util.Map; public class Sample { public Sample() {}\r\n public int doSomething(String str, long longValue) throws Throwable { System.out.println(\"aaaa\"); } public void doSomething(List<Map<String, String>> nested, Map<String,Map<String,String>> nested2) { } }";
        ClassMeta targetClassMeta = classMetaExtractor.extract(sourceCodeString);
        target.initialize(targetClassMeta);
View Full Code Here

   * @parameter
   */
  protected String extensionConfigXML = "junithelper-extension.xml";

  protected Configuration loadConfig() {
    Configuration config = new Configuration();
    config.language = language;
    config.outputFileEncoding = outputFileEncoding;
    config.directoryPathOfProductSourceCode = directoryPathOfProductSourceCode;
    config.directoryPathOfTestSourceCode = directoryPathOfTestSourceCode;
    try {
View Full Code Here

        assertNotNull(ConstructorMetaExtractor.class);
    }

    @Test
    public void instantiation() throws Exception {
        Configuration config = null;
        ConstructorMetaExtractor target = new ConstructorMetaExtractor(config);
        assertNotNull(target);
    }
View Full Code Here

        assertNotNull(target);
    }

    @Test
    public void initialize_A$String() throws Exception {
        Configuration config = new Configuration();
        ConstructorMetaExtractor target = new ConstructorMetaExtractor(config);
        // given
        String sourceCodeString = "package hoge; public class Sample { public void doSomething(String str) {} }";
        // e.g. : given(mocked.called()).willReturn(1);
        // when
View Full Code Here

        assertEquals(expected, actual);
    }

    @Test
    public void initialize_A$ClassMeta$String() throws Exception {
        Configuration config = new Configuration();
        ConstructorMetaExtractor target = new ConstructorMetaExtractor(config);
        // given
        ClassMeta classMeta = mock(ClassMeta.class);
        String sourceCodeString = "package hoge; public class Sample { public void doSomething(String str) {} }";
        // e.g. : given(mocked.called()).willReturn(1);
View Full Code Here

        assertEquals(expected, actual);
    }

    @Test
    public void extract_A$String() throws Exception {
        Configuration config = new Configuration();
        ConstructorMetaExtractor target = new ConstructorMetaExtractor(config);
        // given
        String sourceCodeString = "package hoge; public class Sample { public void doSomething(String str) {} }";
        target.initialize(sourceCodeString);
        // e.g. : given(mocked.called()).willReturn(1);
View Full Code Here

        assertEquals(1, actual.size());
    }

    @Test
    public void extract_A$String_issue47() throws Exception {
        Configuration config = new Configuration();
        ConstructorMetaExtractor target = new ConstructorMetaExtractor(config);
        // given
        String sourceCodeString = "import java.util.Map; public class HttpResponse {\r\n    private byte content[];\r\n    private int statusCode; \r\n    private Map headers;\r\n    public HttpResponse(byte content[], int statusCode, Map headers) {\r\n        this.content = content;\r\n        this.statusCode = statusCode;\r\n        this.headers = headers;\r\n    }\r\n\r\n";
        target.initialize(sourceCodeString);
        // e.g. : given(mocked.called()).willReturn(1);
View Full Code Here

        assertEquals("headers", actual.get(0).argNames.get(2));
    }

    @Test
    public void extract_A$String_Slim3_HtmlUtil() throws Exception {
        Configuration config = new Configuration();
        ConstructorMetaExtractor target = new ConstructorMetaExtractor(config);
        // given
        String sourceCodeString = IOUtil.readAsString(IOUtil.getResourceAsStream("inputs/Slim3_HtmlUtil.txt"), "UTF-8");
        target.initialize(sourceCodeString);
        // e.g. : given(mocked.called()).willReturn(1);
View Full Code Here

TOP

Related Classes of org.junithelper.core.config.Configuration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.