Package org.junithelper.core.extractor

Examples of org.junithelper.core.extractor.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


    @Test
    public void getLackingTestMethodMetaList_A$String_StringIsEmpty() throws Exception {
        TestCaseGeneratorImpl target = new TestCaseGeneratorImpl(config, lineBreakProvider);
        String currentSourceCode = "public class Sample {}";
        target.initialize(new ClassMetaExtractor(config).extract(currentSourceCode));
        String currentTestCaseSourceCode = "";
        List<TestMethodMeta> actual = target.getLackingTestMethodMetaList(currentTestCaseSourceCode);
        assertThat(actual, notNullValue());
    }
View Full Code Here

                        .getInputStreamFrom(targetClassFile));
                InputStream targetInputStream = EclipseIFileUtil.getInputStreamFrom(targetClassFile);
                String sourceCodeString = IOUtil.readAsString(targetInputStream, encoding);
                LineBreakProvider lineBreakProvider = new LineBreakProvider(config, null);
                TestCaseGenerator generator = TestCaseGeneratorFactory.create(config, lineBreakProvider);
                generator.initialize(new ClassMetaExtractor(config).extract(sourceCodeString));

                // ---------------
                // write test case
                outputStream = new FileOutputStream(testCaseCreateDirPath + StringValue.DirectorySeparator.General
                        + testCaseFileName);
View Full Code Here

                    IFile targetFile = getIFile(project, resourcePathForTargetClassFile);
                    String targetFileEncoding = UniversalDetectorUtil.getDetectedEncoding(EclipseIFileUtil
                            .getInputStreamFrom(targetFile));
                    String targetSourceCodeString = IOUtil.readAsString(
                            EclipseIFileUtil.getInputStreamFrom(targetFile), targetFileEncoding);
                    ClassMeta targetClassMeta = new ClassMetaExtractor(config).extract(targetSourceCodeString);

                    // ----------------------------------------
                    // test class
                    IFile testCaseFile = getIFile(project, resourcePathForTestCaseFile);
                    String testCaseFileEncoding = UniversalDetectorUtil.getDetectedEncoding(EclipseIFileUtil
View Full Code Here

    @Test
    public void initialize_A$ClassMeta$String() throws Exception {
        Configuration config = new Configuration();
        ArgTypeMetaExtractor target = new ArgTypeMetaExtractor(config);
        String sourceCodeString = "package hoge.foo; public class Sample { public Sample() {}\r\n public void doSomething(String str) { System.out.println(\"aaaa\") } }";
        ClassMeta classMeta = new ClassMetaExtractor(config).extract(sourceCodeString);
        target.initialize(classMeta, sourceCodeString);
    }
View Full Code Here

    }

    @Test
    public void doExtract_A$String_StringIsNull() throws Exception {
        ArgTypeMetaExtractor target = new ArgTypeMetaExtractor(config);
        ClassMeta classMeta = new ClassMetaExtractor(config).extract("public class Sample {}");
        target.initialize(classMeta);
        String argsAreaString = null;
        try {
            target.doExtract(argsAreaString);
            fail();
View Full Code Here

    }

    @Test
    public void doExtract_A$String_StringIsEmpty() throws Exception {
        ArgTypeMetaExtractor target = new ArgTypeMetaExtractor(config);
        ClassMeta classMeta = new ClassMetaExtractor(config).extract("public class Sample {}");
        target.initialize(classMeta);
        String argsAreaString = "";
        target.doExtract(argsAreaString);
    }
View Full Code Here

    }

    @Test
    public void initialize_A$ClassMeta$String_StringIsNull() throws Exception {
        ArgTypeMetaExtractor target = new ArgTypeMetaExtractor(config);
        ClassMeta classMeta = new ClassMetaExtractor(config).extract("public class Sample {}");
        String sourceCodeString = null;
        ArgTypeMetaExtractor actual = target.initialize(classMeta, sourceCodeString);
        assertThat(actual, notNullValue());
    }
View Full Code Here

    }

    @Test
    public void initialize_A$ClassMeta$String_StringIsEmpty() throws Exception {
        ArgTypeMetaExtractor target = new ArgTypeMetaExtractor(config);
        ClassMeta classMeta = new ClassMetaExtractor(config).extract("public class Sample {}");
        String sourceCodeString = "";
        ArgTypeMetaExtractor actual = target.initialize(classMeta, sourceCodeString);
        assertThat(actual, notNullValue());
    }
View Full Code Here

    }

    @Test
    public void initialize_A$ClassMeta$String_StringIsNull() throws Exception {
        MethodMetaExtractor target = new MethodMetaExtractor(config);
        ClassMeta classMeta = new ClassMetaExtractor(config).extract("public class Sample {}");
        String sourceCodeString = null;
        MethodMetaExtractor actual = target.initialize(classMeta, sourceCodeString);
        assertThat(actual, notNullValue());
    }
View Full Code Here

TOP

Related Classes of org.junithelper.core.extractor.ClassMetaExtractor

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.