Package com.asakusafw.runtime.io

Examples of com.asakusafw.runtime.io.TsvParser


        DataInputBuffer input = new DataInputBuffer();
        input.reset(output.getData(), output.getLength());
        ModelInput<Object> modelIn = (ModelInput<Object>) type.getAnnotation(ModelInputLocation.class)
            .value()
            .getDeclaredConstructor(RecordParser.class)
            .newInstance(new TsvParser(new InputStreamReader(input, "UTF-8")));
        ModelWrapper copy = loader.newModel("Simple");

        modelIn.readTo(copy.unwrap());
        assertThat(copy.get("sid"), is((Object) 1L));
        assertThat(copy.get("value"), is((Object) new Text("hello")));
View Full Code Here


        DataInputBuffer input = new DataInputBuffer();
        input.reset(output.getData(), output.getLength());
        ModelInput<Object> modelIn = (ModelInput<Object>) type.getAnnotation(ModelInputLocation.class)
            .value()
            .getDeclaredConstructor(RecordParser.class)
            .newInstance(new TsvParser(new InputStreamReader(input, "UTF-8")));
        ModelWrapper copy = loader.newModel("Primitives");
        modelIn.readTo(copy.unwrap());
        assertThat(object.unwrap(), equalTo(copy.unwrap()));
        assertThat(input.read(), is(-1));
        modelIn.close();
View Full Code Here

    private void init(String fileName) throws IOException {
        InputStream in = ModelInputEmitterTest.class
            .getResourceAsStream("tsv/" + fileName);
        assertThat(fileName, in, is(not(nullValue())));
        parser = new TsvParser(new InputStreamReader(in, "UTF-8"));
    }
View Full Code Here

    private StringWriter buffer;

    private RecordEmitter emitter;

    private RecordParser parser() throws IOException {
        return new TsvParser(new StringReader(buffer.toString()));
    }
View Full Code Here

TOP

Related Classes of com.asakusafw.runtime.io.TsvParser

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.