Package com.pogofish.jadt.sink

Examples of com.pogofish.jadt.sink.StringSinkFactory


                new DataType(NO_COMMENTS, NO_ANNOTATIONS, "Whatever", Util.<String>list(), NO_EXTENDS, NO_IMPLEMENTS, list(
                        new Constructor(NO_COMMENTS, "Whatever", Util.<Arg>list())
                ))
               
        ));
        final StringSinkFactory factory = new StringSinkFactory("whatever");
        final DocEmitter emitter = new StandardDocEmitter(new DummyDataTypeEmitter());
        emitter.emit(factory, doc);
        final Map<String, String> results = factory.getResults();
        assertEquals("Got the wrong number of results", 2, results.size());
        final String foobar = results.get("some.package.FooBar");
        assertEquals(FULL_HEADER+FOOBAR, foobar);
        assertEquals(FULL_HEADER+WHATEVER, results.get("some.package.Whatever"));
    }
View Full Code Here


                new DataType(NO_COMMENTS, NO_ANNOTATIONS, "Whatever", Util.<String>list(), NO_EXTENDS, NO_IMPLEMENTS, list(
                        new Constructor(NO_COMMENTS, "Whatever", Util.<Arg>list())
                ))
               
        ));
        final StringSinkFactory factory = new StringSinkFactory("whatever");
        final DocEmitter emitter = new StandardDocEmitter(new DummyDataTypeEmitter());
        emitter.emit(factory, doc);
        final Map<String, String> results = factory.getResults();
        assertEquals("Got the wrong number of results", 2, results.size());
        final String foobar = results.get("some.package.FooBar");
        assertEquals(NO_IMPORTS_HEADER+FOOBAR, foobar);
        assertEquals(NO_IMPORTS_HEADER+WHATEVER, results.get("some.package.Whatever"));
    }
View Full Code Here

                new DataType(NO_COMMENTS, NO_ANNOTATIONS, "Whatever", Util.<String>list(), NO_EXTENDS, NO_IMPLEMENTS, list(
                        new Constructor(NO_COMMENTS, "Whatever", Util.<Arg>list())
                ))
               
        ));
        final StringSinkFactory factory = new StringSinkFactory("whatever");
        final DocEmitter emitter = new StandardDocEmitter(new DummyDataTypeEmitter());
        emitter.emit(factory, doc);
        final Map<String, String> results = factory.getResults();
        assertEquals("Got the wrong number of results", 2, results.size());
        final String foobar = results.get("FooBar");
        assertEquals(NO_PACKAGE_HEADER+FOOBAR, foobar);
        assertEquals(NO_PACKAGE_HEADER+WHATEVER, results.get("Whatever"));
    }
View Full Code Here

     */
    @Test
    public void testHappy() {
        final Doc testDoc = new Doc("some source", EMPTY_PKG, NO_IMPORTS,Collections.<DataType>emptyList());
        final DocEmitter dummyDocEmitter = new DummyDocEmitter(testDoc, "SomeClass");
        final StringSinkFactory factory = new StringSinkFactory("baseDir");
        dummyDocEmitter.emit(factory, testDoc);
        assertEquals("some source", factory.getResults().get("SomeClass"));
    }
View Full Code Here

    @Test
    public void testWrongDoc() {
        final Doc testDoc = new Doc("some source", EMPTY_PKG, NO_IMPORTS,Collections.<DataType>emptyList());
        final Doc doc = new Doc("some source", EMPTY_PKG, NO_IMPORTS,Collections.<DataType>emptyList());
        final DocEmitter dummyDocEmitter = new DummyDocEmitter(testDoc, "SomeClass");
        final StringSinkFactory factory = new StringSinkFactory("baseDir");
        try {
            dummyDocEmitter.emit(factory, doc);
            fail("Did not get an exception with the wrong doc, got " + factory.getResults().get("SomeClass"));
        } catch (RuntimeException e) {
            // yay
        }
    }
View Full Code Here

TOP

Related Classes of com.pogofish.jadt.sink.StringSinkFactory

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.