Package org.junithelper.core.meta

Examples of org.junithelper.core.meta.ClassMeta


    }

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


    @Test
    public void extract_A$String() throws Exception {
        ClassMetaExtractor target = new ClassMetaExtractor(config);
        String sourceCodeString = "package hoge.foo; @SuppressWarnings(value = { \"issue 28\" })public class Sample { public Sample() {}\r\n public void doSomething(String str) { System.out.println(\"aaaa\") } }";
        ClassMeta actual = target.extract(sourceCodeString);
        assertEquals("hoge.foo", actual.packageName);
        assertEquals("Sample", actual.name);
    }
View Full Code Here

    @Test
    public void extract_A$String_classNameWithGenerics1() throws Exception {
        ClassMetaExtractor target = new ClassMetaExtractor(config);
        String sourceCodeString = "package hoge.foo; @SuppressWarnings(value = { \"issue 28\" })public class Sample<T> { public Sample() {}\r\n public void doSomething(String str) { System.out.println(\"aaaa\") } }";
        ClassMeta actual = target.extract(sourceCodeString);
        assertEquals("hoge.foo", actual.packageName);
        assertEquals("Sample", actual.name);
    }
View Full Code Here

    @Test
    public void extract_A$String_classNameWithGenerics2() throws Exception {
        ClassMetaExtractor target = new ClassMetaExtractor(config);
        String sourceCodeString = "package hoge.foo; @SuppressWarnings(value = { \"issue 28\" })public class Sample<M, A> { public Sample() {}\r\n public void doSomething(String str) { System.out.println(\"aaaa\") } }";
        ClassMeta actual = target.extract(sourceCodeString);
        assertEquals("hoge.foo", actual.packageName);
        assertEquals("Sample", actual.name);
    }
View Full Code Here

    @Test
    public void extract_A$String_classNameWithGenerics3() throws Exception {
        ClassMetaExtractor target = new ClassMetaExtractor(config);
        String sourceCodeString = "package hoge.foo; @SuppressWarnings(value = { \"issue 28\" })public class Sample<M extends Object> { public Sample() {}\r\n public void doSomething(String str) { System.out.println(\"aaaa\") } }";
        ClassMeta actual = target.extract(sourceCodeString);
        assertEquals("hoge.foo", actual.packageName);
        assertEquals("Sample", actual.name);
    }
View Full Code Here

    @Test
    public void extract_A$String_classNameWithGenerics4_nested() throws Exception {
        ClassMetaExtractor target = new ClassMetaExtractor(config);
        String sourceCodeString = "package hoge.foo; @SuppressWarnings(value = { \"issue 28\" })public class Sample<M<A, B> extends Something> { public Sample() {}\r\n public void doSomething(String str) { System.out.println(\"aaaa\") } }";
        ClassMeta actual = target.extract(sourceCodeString);
        assertEquals("hoge.foo", actual.packageName);
        assertEquals("Sample", actual.name);
    }
View Full Code Here

    @Test
    public void extract_A$String_Slim3_AbstractModelRef() throws Exception {
        ClassMetaExtractor target = new ClassMetaExtractor(config);
        String sourceCodeString = IOUtil.readAsString(IOUtil.getResourceAsStream("inputs/Slim3_AbstractModelRef.txt"),
                "UTF-8");
        ClassMeta actual = target.extract(sourceCodeString);
        assertEquals("org.slim3.datastore", actual.packageName);
        assertEquals(false, actual.isAbstract);
        assertEquals("AbstractModelRef", actual.name);
    }
View Full Code Here

    @Test
    public void extract_A$String_Slim3_HtmlUtil() throws Exception {
        ClassMetaExtractor target = new ClassMetaExtractor(config);
        String sourceCodeString = IOUtil.readAsString(IOUtil.getResourceAsStream("inputs/Slim3_HtmlUtil.txt"), "UTF-8");
        ClassMeta actual = target.extract(sourceCodeString);
        assertEquals("org.slim3.util", actual.packageName);
        assertEquals("HtmlUtil", actual.name);
        assertEquals(false, actual.isAbstract);
        assertEquals(1, actual.constructors.size());
        assertEquals(AccessModifier.Private, actual.constructors.get(0).accessModifier);
View Full Code Here

    public void extract_A$String_Slim3_GlobalTransaction() throws Exception {
        config.target.isExceptionPatternRequired = false;
        ClassMetaExtractor target = new ClassMetaExtractor(config);
        String sourceCodeString = IOUtil.readAsString(IOUtil.getResourceAsStream("inputs/Slim3_GlobalTransaction.txt"),
                "UTF-8");
        ClassMeta actual = target.extract(sourceCodeString);
        assertEquals("org.slim3.datastore", actual.packageName);
        assertEquals("GlobalTransaction", actual.name);
        assertEquals(false, actual.isAbstract);
        assertEquals(1, actual.constructors.size());
        assertEquals(4, actual.methods.size());
View Full Code Here

    @Test
    public void extract_A$String_Enum_ContentType() throws Exception {
        ClassMetaExtractor target = new ClassMetaExtractor(config);
        String sourceCodeString = IOUtil.readAsString(IOUtil.getResourceAsStream("inputs/Enum_ContentType.txt"),
                "UTF-8");
        ClassMeta actual = target.extract(sourceCodeString);
        assertEquals("a.b.c", actual.packageName);
        assertEquals(false, actual.isAbstract);
        assertEquals(true, actual.isEnum);
        assertEquals("ContentType", actual.name);
        assertEquals(2, actual.methods.size());
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.