Package com.asakusafw.testdriver.core

Examples of com.asakusafw.testdriver.core.DataModelSinkFactory


        TestToolRepository repo = new TestToolRepository(getClass().getClassLoader());

        File file = temp.newFile("example.xls");
        file.delete();

        DataModelSinkFactory factory = repo.getDataModelSinkFactory(file.toURI());
        DataModelSink sink = factory.createSink(SIMPLE, new TestContext.Empty());
        try {
            Simple model = new Simple();
            model.text = "expected";
            sink.put(SIMPLE.toReflection(model));
        } finally {
View Full Code Here


        TestToolRepository repo = new TestToolRepository(getClass().getClassLoader());

        File file = temp.newFile("example.INVALID");
        file.delete();

        DataModelSinkFactory factory = repo.getDataModelSinkFactory(file.toURI());
        try {
            DataModelSink sink = factory.createSink(SIMPLE, new TestContext.Empty());
            sink.close();
            fail();
        } catch (IOException e) {
            // ok.
        }
View Full Code Here

     */
    @Test
    public void dumpActual_factory() {
        final MockDataModelSink sink = new MockDataModelSink();
        MockFlowDriverOutput mock = new MockFlowDriverOutput(getClass(), new MockTestDataToolProvider());
        mock.dumpActual(new DataModelSinkFactory() {
            @Override
            public <T> DataModelSink createSink(DataModelDefinition<T> definition, TestContext context) throws IOException {
                return sink;
            }
        });
View Full Code Here

        final MockDataModelSink sink = new MockDataModelSink();
        MockFlowDriverOutput mock = new MockFlowDriverOutput(getClass(), new MockTestDataToolProvider() {
            @Override
            public DataModelSinkFactory getDataModelSinkFactory(URI uri) {
                assertThat(uri.getPath(), endsWith("testing"));
                return new DataModelSinkFactory() {
                    @Override
                    public <T> DataModelSink createSink(DataModelDefinition<T> definition, TestContext context) {
                        return sink;
                    }
                };
View Full Code Here

        final MockDataModelSink sink = new MockDataModelSink();
        MockFlowDriverOutput mock = new MockFlowDriverOutput(getClass(), new MockTestDataToolProvider() {
            @Override
            public DataModelSinkFactory getDataModelSinkFactory(URI uri) {
                assertThat(new File(uri).getName(), is(file.getName()));
                return new DataModelSinkFactory() {
                    @Override
                    public <T> DataModelSink createSink(DataModelDefinition<T> definition, TestContext context) {
                        return sink;
                    }
                };
View Full Code Here

TOP

Related Classes of com.asakusafw.testdriver.core.DataModelSinkFactory

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.