Examples of TestMethodMeta


Examples of org.junithelper.core.meta.TestMethodMeta

    }

    @Test
    public void addTestMethodMetaToListIfNotExists_A$List$TestMethodMeta() throws Exception {
        List<TestMethodMeta> dest = new ArrayList<TestMethodMeta>();
        TestMethodMeta meta = new TestMethodMeta();
        TestCaseGeneratorImpl.addTestMethodMetaToListIfNotExists(dest, meta);
    }
View Full Code Here

Examples of org.junithelper.core.meta.TestMethodMeta

        TestCaseGeneratorImpl.addTestMethodMetaToListIfNotExists(dest, meta);
    }

    @Test
    public void appendIfExtensionAssertionsExist_A$TestMethodMeta$Configuration() throws Exception {
        TestMethodMeta testMethodMeta = new TestMethodMeta();
        TestMethodMeta actual = TestCaseGeneratorImpl.appendIfExtensionAssertionsExist(testMethodMeta, config);
        assertThat(actual, notNullValue());
    }
View Full Code Here

Examples of org.junithelper.core.meta.TestMethodMeta

    }

    @Test(expected = JUnitHelperCoreException.class)
    public void getInstantiationSourceCode_A$Configuration$SourceCodeAppender$TestMethodMeta_Null() throws Exception {
        Configuration config = null;
        TestMethodMeta testMethodMeta = null;
        GeneratorImplFunction.getInstantiationSourceCode(config, appender, testMethodMeta);
    }
View Full Code Here

Examples of org.junithelper.core.meta.TestMethodMeta

        config.extConfiguration = new ExtConfiguration(config);
        ExtInstantiation ins = new ExtInstantiation("com.example.Bean");
        ins.importList.add("com.example.BeanFactory");
        ins.assignCode = "BeanFactory.getInstance()";
        config.extConfiguration.extInstantiations.add(ins);
        TestMethodMeta testMethodMeta = new TestMethodMeta();
        ConstructorMeta cons = new ConstructorMeta();
        cons.argNames.add("bean");
        ArgTypeMeta argType = new ArgTypeMeta();
        argType.name = "com.example.Bean";
        argType.nameInMethodName = "Bean";
View Full Code Here

Examples of org.junithelper.core.meta.TestMethodMeta

        config.extConfiguration = new ExtConfiguration(config);
        ExtInstantiation ins = new ExtInstantiation("com.example.Bean");
        ins.importList.add("com.example.BeanFactory");
        ins.assignCode = "BeanFactory.getInstance();";
        config.extConfiguration.extInstantiations.add(ins);
        TestMethodMeta testMethodMeta = new TestMethodMeta();
        ConstructorMeta cons = new ConstructorMeta();
        cons.argNames.add("bean");
        ArgTypeMeta argType = new ArgTypeMeta();
        argType.name = "com.example.Bean";
        argType.nameInMethodName = "Bean";
View Full Code Here

Examples of org.junithelper.core.meta.TestMethodMeta

        config.extConfiguration = new ExtConfiguration(config);
        ExtInstantiation ins = new ExtInstantiation("com.example.Bean");
        ins.importList.add("com.example.BeanFactory");
        ins.assignCode = "BeanFactory.getInstance()";
        config.extConfiguration.extInstantiations.add(ins);
        TestMethodMeta testMethodMeta = new TestMethodMeta();
        testMethodMeta.classMeta = new ClassMeta();
        testMethodMeta.classMeta.name = "Bean";
        testMethodMeta.classMeta.importedList.add("com.example.Bean");
        testMethodMeta.classMeta.packageName = "com.example";
        String actual = GeneratorImplFunction.getInstantiationSourceCode(config, appender, testMethodMeta);
View Full Code Here

Examples of org.junithelper.core.meta.TestMethodMeta

        config.extConfiguration = new ExtConfiguration(config);
        ExtInstantiation ins = new ExtInstantiation("com.example.Bean");
        ins.importList.add("com.example.BeanFactory");
        ins.assignCode = "BeanFactory.getInstance();";
        config.extConfiguration.extInstantiations.add(ins);
        TestMethodMeta testMethodMeta = new TestMethodMeta();
        testMethodMeta.classMeta = new ClassMeta();
        testMethodMeta.classMeta.name = "Bean";
        testMethodMeta.classMeta.importedList.add("com.example.Bean");
        testMethodMeta.classMeta.packageName = "com.example";
        String actual = GeneratorImplFunction.getInstantiationSourceCode(config, appender, testMethodMeta);
View Full Code Here

Examples of org.junithelper.core.meta.TestMethodMeta

        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
        assertEquals(false, actual.isTypeTest);
        assertEquals(false, actual.isInstantiationTest);
        assertEquals(targetClassMeta, actual.classMeta);
        assertEquals(targetMethodMeta, actual.methodMeta);
View Full Code Here

Examples of org.junithelper.core.meta.TestMethodMeta

        ExceptionMeta exception = new ExceptionMeta();
        exception.name = "Exception";
        exception.nameInMethodName = "Exception";
        generator.initialize(targetClassMeta);
        // when
        TestMethodMeta actual = generator.getTestMethodMeta(targetMethodMeta, exception);
        // then
        assertEquals(false, actual.isTypeTest);
        assertEquals(false, actual.isInstantiationTest);
        assertEquals(targetClassMeta, actual.classMeta);
        assertEquals(targetMethodMeta, actual.methodMeta);
View Full Code Here

Examples of org.junithelper.core.meta.TestMethodMeta

        // 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);
        // then
        String expected = "doSomething_A$String$long";
        assertEquals(expected, actual);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.