Package com.asakusafw.testdriver.core

Examples of com.asakusafw.testdriver.core.DifferenceSink


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

        DifferenceSinkFactory factory = repo.getDifferenceSinkFactory(file.toURI());
        DifferenceSink sink = factory.createSink(SIMPLE, new TestContext.Empty());
        try {
            Simple expected = new Simple();
            expected.text = "expected";
            Simple actual = new Simple();
            actual.text = "actual";
            sink.put(new Difference(
                    SIMPLE.toReflection(expected),
                    SIMPLE.toReflection(actual),
                    "testing"));
        } finally {
            sink.close();
        }

        assertThat(file.exists(), is(true));
    }
View Full Code Here


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

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

        }
    }

    private void checkInstance(DifferenceSinkFactory factory, DifferenceSink instance) {
        try {
            DifferenceSink sink = factory.createSink(DEFINITION, CONTEXT);
            try {
                assertThat(sink, is(sameInstance(instance)));
            } finally {
                sink.close();
            }
        } catch (IOException e) {
            throw new AssertionError(e);
        }
    }
View Full Code Here

TOP

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

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.