Package com.asakusafw.runtime.io.testing.model

Examples of com.asakusafw.runtime.io.testing.model.MockModel


     * @throws Exception 例外が発生した場合
     */
    @Test
    public void input() throws Exception {
        TsvIoFactory<MockModel> factory = new TsvIoFactory<MockModel>(MockModel.class);
        MockModel object = factory.createModelObject();
        InputStream in = new ByteArrayInputStream(
                "Hello\nWorld\nTSV\nINPUT\n".getBytes("UTF-8"));

        LinkedList<String> expected = new LinkedList<String>();
        Collections.addAll(expected, "Hello", "World", "TSV", "INPUT");

        ModelInput<MockModel> modelIn = factory.createModelInput(in);
        try {
            while (modelIn.readTo(object)) {
                assertThat(expected.isEmpty(), is(false));
                object.assertValueIs(expected.removeFirst());
            }
            assertThat(expected.isEmpty(), is(true));
        } finally {
            modelIn.close();
        }
View Full Code Here


     */
    @SuppressWarnings("deprecation")
    @Test
    public void output() throws Exception {
        TsvIoFactory<MockModel> factory = new TsvIoFactory<MockModel>(MockModel.class);
        MockModel object = factory.createModelObject();
        ByteArrayOutputStream out = new ByteArrayOutputStream();

        ModelOutput<MockModel> modelOut = factory.createModelOutput(out);
        try {
            object.value.modify("Hello");
View Full Code Here

TOP

Related Classes of com.asakusafw.runtime.io.testing.model.MockModel

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.