Package com.asakusafw.testdriver.core

Examples of com.asakusafw.testdriver.core.SpiDataModelSourceProvider.open()


    @Test
    public void open_importer() throws Exception {
        DataModelSourceProvider provider = new SpiDataModelSourceProvider(getClass().getClassLoader());
        URI uri = new URI("windgate:" + MockImporter.class.getName());
        ValueDefinition<String> definition = ValueDefinition.of(String.class);
        DataModelSource source = provider.open(definition, uri, EMPTY);
        try {
            DataModelReflection r1 = source.next();
            assertThat(r1, is(notNullValue()));
            assertThat(definition.toObject(r1), is("Hello1, world!"));
View Full Code Here


    @Test
    public void open_exporter() throws Exception {
        DataModelSourceProvider provider = new SpiDataModelSourceProvider(getClass().getClassLoader());
        URI uri = new URI("windgate:" + MockExporter.class.getName());
        ValueDefinition<String> definition = ValueDefinition.of(String.class);
        DataModelSource source = provider.open(definition, uri, EMPTY);
        try {
            DataModelReflection r1 = source.next();
            assertThat(r1, is(notNullValue()));
            assertThat(definition.toObject(r1), is("Hello1, world!"));
View Full Code Here

     * @throws Exception if failed
     */
    @Test
    public void spi() throws Exception {
        DataModelSourceProvider provider = new SpiDataModelSourceProvider(JsonSourceProvider.class.getClassLoader());
        DataModelSource source = provider.open(SIMPLE, uri("simple.json"), new TestContext.Empty());
        assertThat(source, not(nullValue()));
        try {
            Simple s1 = SIMPLE.toObject(source.next());
            assertThat(s1.number, is(100));
            assertThat(source.next(), is(nullValue()));
View Full Code Here

     */
    @Test
    public void spi() throws Exception {
        DataModelSourceProvider provider = new SpiDataModelSourceProvider(ExcelSheetSourceProvider.class.getClassLoader());
        URI uri = uri("data/workbook.xls", ":1");
        DataModelSource source = provider.open(SIMPLE, uri, new TestContext.Empty());
        assertThat(source, not(nullValue()));

        Simple s1 = next(source);
        assertThat(s1.number, is(200));
        assertThat(s1.text, is("bbb"));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.