Package org.junithelper.core.meta

Examples of org.junithelper.core.meta.ClassMeta


    @Test
    public void initialize_A$ClassMeta() throws Exception {
        // given
        String sourceCodeString = "package hoge.foo; import java.util.List; public class Sample { public Sample() {}\r\n public int doSomething(String str, long longValue) throws Throwable { System.out.println(\"aaaa\") } }";
        ClassMeta targetClassMeta = classMetaExtractor.extract(sourceCodeString);
        // when
        generator.initialize(targetClassMeta);
        // then
    }
View Full Code Here


    @Test
    public void getTestMethodMeta_A$MethodMeta() throws Exception {
        // given
        String sourceCodeString = "package hoge.foo; import java.util.List; public class Sample { public Sample() {}\r\n public int doSomething(String str, long longValue) throws Throwable { System.out.println(\"aaaa\") } }";
        ClassMeta targetClassMeta = classMetaExtractor.extract(sourceCodeString);
        MethodMeta targetMethodMeta = targetClassMeta.methods.get(0);
        generator.initialize(targetClassMeta);
        // when
        TestMethodMeta actual = generator.getTestMethodMeta(targetMethodMeta);
        // then
View Full Code Here

    @Test
    public void getTestMethodMeta_A$MethodMeta$ExceptionMeta() throws Exception {
        // given
        String sourceCodeString = "package hoge.foo; import java.util.List; public class Sample { public Sample() {}\r\n public int doSomething(String str, long longValue) throws Throwable { System.out.println(\"aaaa\") } }";
        ClassMeta targetClassMeta = classMetaExtractor.extract(sourceCodeString);
        MethodMeta targetMethodMeta = targetClassMeta.methods.get(0);
        ExceptionMeta exception = new ExceptionMeta();
        exception.name = "Exception";
        exception.nameInMethodName = "Exception";
        generator.initialize(targetClassMeta);
View Full Code Here

    @Test
    public void getTestMethodNamePrefix_A$TestMethodMeta() throws Exception {
        // given
        String sourceCodeString = "package hoge.foo; import java.util.List; public class Sample { public Sample() {}\r\n public int doSomething(String str, long longValue) throws Throwable { System.out.println(\"aaaa\") } }";
        ClassMeta targetClassMeta = classMetaExtractor.extract(sourceCodeString);
        generator.initialize(targetClassMeta);
        MethodMeta targetMethodMeta = targetClassMeta.methods.get(0);
        TestMethodMeta testMethodMeta = generator.getTestMethodMeta(targetMethodMeta);
        // when
        String actual = generator.getTestMethodNamePrefix(testMethodMeta);
View Full Code Here

    @Test
    public void getTestMethodNamePrefix_A$TestMethodMeta$ExceptionMeta() throws Exception {
        // given
        String sourceCodeString = "package hoge.foo; import java.util.List; public class Sample { public Sample() {}\r\n public int doSomething(String str, long longValue) throws Throwable { System.out.println(\"aaaa\") } }";
        ClassMeta targetClassMeta = classMetaExtractor.extract(sourceCodeString);
        generator.initialize(targetClassMeta);
        MethodMeta targetMethodMeta = targetClassMeta.methods.get(0);
        TestMethodMeta testMethodMeta = generator.getTestMethodMeta(targetMethodMeta);
        ExceptionMeta exception = new ExceptionMeta();
        exception.name = "Exception";
View Full Code Here

    @Test
    public void getTestMethodSourceCode_A$TestMethodMeta_JUnit4() throws Exception {
        // given
        String sourceCodeString = "package hoge.foo; import java.util.List; public class Sample { public Sample() {}\r\n public int doSomething(String str, long longValue) throws Throwable { System.out.println(\"aaaa\") } }";
        ClassMeta targetClassMeta = classMetaExtractor.extract(sourceCodeString);
        generator.initialize(targetClassMeta);
        MethodMeta targetMethodMeta = targetClassMeta.methods.get(0);
        TestMethodMeta testMethodMeta = generator.getTestMethodMeta(targetMethodMeta);
        // when
        String actual = generator.getTestMethodSourceCode(testMethodMeta);
View Full Code Here

        Configuration config = new Configuration();
        config.junitVersion = JUnitVersion.version3;
        config.testingPatternExplicitComment = TestingPatternExplicitComment.ArrangeActAssert;
        TestMethodGeneratorImpl localGenerator = new TestMethodGeneratorImpl(config, lineBreakProvider);
        String sourceCodeString = "package hoge.foo; import java.util.List; public class Sample { public Sample() {}\r\n public int doSomething(String str, long longValue) throws Throwable { System.out.println(\"aaaa\") } }";
        ClassMeta targetClassMeta = classMetaExtractor.extract(sourceCodeString);
        localGenerator.initialize(targetClassMeta);
        MethodMeta targetMethodMeta = targetClassMeta.methods.get(0);
        TestMethodMeta testMethodMeta = localGenerator.getTestMethodMeta(targetMethodMeta);
        // when
        String actual = localGenerator.getTestMethodSourceCode(testMethodMeta);
View Full Code Here

        Configuration config = new Configuration();
        config.junitVersion = JUnitVersion.version3;
        config.testingPatternExplicitComment = TestingPatternExplicitComment.GivenWhenThen;
        TestMethodGeneratorImpl localGenerator = new TestMethodGeneratorImpl(config, lineBreakProvider);
        String sourceCodeString = "package hoge.foo; import java.util.List; public class Sample { public Sample() {}\r\n public int doSomething(String str, long longValue) throws Throwable { System.out.println(\"aaaa\") } }";
        ClassMeta targetClassMeta = classMetaExtractor.extract(sourceCodeString);
        localGenerator.initialize(targetClassMeta);
        MethodMeta targetMethodMeta = targetClassMeta.methods.get(0);
        TestMethodMeta testMethodMeta = localGenerator.getTestMethodMeta(targetMethodMeta);
        // when
        String actual = localGenerator.getTestMethodSourceCode(testMethodMeta);
View Full Code Here

        Configuration config = new Configuration();
        config.junitVersion = JUnitVersion.version3;
        config.testingPatternExplicitComment = TestingPatternExplicitComment.GivenWhenThen;
        TestMethodGeneratorImpl localGenerator = new TestMethodGeneratorImpl(config, lineBreakProvider);
        String sourceCodeString = "package hoge.foo; import java.util.List; public class Sample { public Sample() {}\r\n public int doSomething(String str, long longValue) throws Throwable { System.out.println(\"aaaa\") } }";
        ClassMeta targetClassMeta = classMetaExtractor.extract(sourceCodeString);
        localGenerator.initialize(targetClassMeta);
        MethodMeta targetMethodMeta = targetClassMeta.methods.get(0);
        TestMethodMeta testMethodMeta = localGenerator.getTestMethodMeta(targetMethodMeta);
        // when
        String actual = localGenerator.getTestMethodSourceCode(testMethodMeta);
View Full Code Here

    }

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

TOP

Related Classes of org.junithelper.core.meta.ClassMeta

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.