Examples of ClassMeta


Examples of org.junithelper.core.meta.ClassMeta

    @Test
    public void isCanonicalClassNameUsed_A$String$String$ClassMeta_Imported() throws Exception {
        String expectedCanonicalClassName = "com.example.bean.SampleBean";
        String usedClassName = "SampleBean";
        ClassMeta targetClassMeta = new ClassMeta();
        targetClassMeta.importedList.add("com.example.bean.SampleBean");
        // when
        boolean actual = GeneratorImplFunction.isCanonicalClassNameUsed(expectedCanonicalClassName, usedClassName,
                targetClassMeta);
        // then
View Full Code Here

Examples of org.junithelper.core.meta.ClassMeta

    @Test
    public void isCanonicalClassNameUsed_A$String$String$ClassMeta_CanonicalClassName() throws Exception {
        String expectedCanonicalClassName = "com.example.bean.SampleBean";
        String usedClassName = "com.example.bean.SampleBean";
        ClassMeta targetClassMeta = new ClassMeta();
        // when
        boolean actual = GeneratorImplFunction.isCanonicalClassNameUsed(expectedCanonicalClassName, usedClassName,
                targetClassMeta);
        // then
        boolean expected = true;
View Full Code Here

Examples of org.junithelper.core.meta.ClassMeta

    @Test
    public void isCanonicalClassNameUsed_A$String$String$ClassMeta_NotUsed() throws Exception {
        String expectedCanonicalClassName = "com.example.bean.SampleBean";
        String usedClassName = "SampleBean";
        ClassMeta targetClassMeta = new ClassMeta();
        // when
        boolean actual = GeneratorImplFunction.isCanonicalClassNameUsed(expectedCanonicalClassName, usedClassName,
                targetClassMeta);
        // then
        boolean expected = false;
View Full Code Here

Examples of org.junithelper.core.meta.ClassMeta

        cons.argNames.add("bean");
        ArgTypeMeta argType = new ArgTypeMeta();
        argType.name = "com.example.Bean";
        argType.nameInMethodName = "Bean";
        cons.argTypes.add(argType);
        testMethodMeta.classMeta = new ClassMeta();
        testMethodMeta.classMeta.name = "Target";
        testMethodMeta.classMeta.importedList.add("com.example.Bean");
        testMethodMeta.classMeta.packageName = "com.example";
        testMethodMeta.classMeta.constructors.add(cons);
        String actual = GeneratorImplFunction.getInstantiationSourceCode(config, appender, testMethodMeta);
View Full Code Here

Examples of org.junithelper.core.meta.ClassMeta

        cons.argNames.add("bean");
        ArgTypeMeta argType = new ArgTypeMeta();
        argType.name = "com.example.Bean";
        argType.nameInMethodName = "Bean";
        cons.argTypes.add(argType);
        testMethodMeta.classMeta = new ClassMeta();
        testMethodMeta.classMeta.name = "Target";
        testMethodMeta.classMeta.importedList.add("com.example.Bean");
        testMethodMeta.classMeta.packageName = "com.example";
        testMethodMeta.classMeta.constructors.add(cons);
        String actual = GeneratorImplFunction.getInstantiationSourceCode(config, appender, testMethodMeta);
View Full Code Here

Examples of org.junithelper.core.meta.ClassMeta

        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);
        String expected = "\t\tBean target = BeanFactory.getInstance();\r\n";
View Full Code Here

Examples of org.junithelper.core.meta.ClassMeta

        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);
        String expected = "\t\tBean target = BeanFactory.getInstance();\r\n";
View Full Code Here

Examples of org.junithelper.core.meta.ClassMeta

    @Test(expected = JUnitHelperCoreException.class)
    public void isCanonicalClassNameUsed_A$String$String$ClassMeta_StringIsNull() throws Exception {
        String expectedCanonicalClassName = null;
        String usedClassName = null;
        ClassMeta targetClassMeta = null;
        GeneratorImplFunction.isCanonicalClassNameUsed(expectedCanonicalClassName, usedClassName, targetClassMeta);
    }
View Full Code Here

Examples of org.junithelper.core.meta.ClassMeta

    @Test
    public void isCanonicalClassNameUsed_A$String$String$ClassMeta_StringIsEmpty() throws Exception {
        String expectedCanonicalClassName = "";
        String usedClassName = "";
        ClassMeta targetClassMeta = new ClassMeta();
        GeneratorImplFunction.isCanonicalClassNameUsed(expectedCanonicalClassName, usedClassName, targetClassMeta);
    }
View Full Code Here

Examples of org.junithelper.core.meta.ClassMeta

    @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);
        // when
        ConstructorMetaExtractor actual = target.initialize(classMeta, sourceCodeString);
        // then
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.