Examples of Desc


Examples of com.asakusafw.testdriver.core.MockExporterRetriever.Desc

     * createSource(DataModelDefinition, ExporterDescription, TestContext)}.
     * @throws Exception if failed
     */
    @Test
    public void open() throws Exception {
        Desc desc = MockExporterRetriever.create("Hello, world!");
        ClassLoader cl = register(ExporterRetriever.class, MockExporterRetriever.class);

        SpiExporterRetriever target = new SpiExporterRetriever(cl);
        DataModelSource source = target.createSource(ValueDefinition.of(String.class), desc, EMPTY);
        assertThat(ValueDefinition.of(String.class).toObject(source.next()), is("Hello, world!"));
View Full Code Here

Examples of com.asakusafw.testdriver.core.MockExporterRetriever.Desc

     * not registered.
     * @throws Exception if failed
     */
    @Test(expected = IOException.class)
    public void open_notfound() throws Exception {
        Desc desc = MockExporterRetriever.create("Hello, world!");

        SpiExporterRetriever target = new SpiExporterRetriever(getClass().getClassLoader());
        target.createSource(ValueDefinition.of(String.class), desc, EMPTY);
    }
View Full Code Here

Examples of com.asakusafw.testdriver.core.MockExporterRetriever.Desc

                    .add(uri("testing:src"), "1:Hello, world!"),
                new MockVerifyRuleProvider()
                    .add(uri("testing:rule"), rule()),
                new MockExporterRetriever().wrap());

        Desc desc = MockExporterRetriever.create("1:Hello, world!");
        List<Difference> results = inspector.inspect(
                desc.getModelType(),
                desc,
                context,
                uri("testing:src"),
                uri("testing:rule"));
        assertThat(results.size(), is(0));
View Full Code Here

Examples of com.asakusafw.testdriver.core.MockExporterRetriever.Desc

        register(DataModelSourceProvider.class, MockSourceProvider.class);
        register(VerifyRuleProvider.class, MockVerifyRuleProvider.class);
        ClassLoader loader = register(ExporterRetriever.class, MockExporterRetriever.class);
        TestResultInspector inspector = new TestResultInspector(loader);

        Desc desc = MockExporterRetriever.create("MOCK");
        List<Difference> results = inspector.inspect(
                desc.getModelType(),
                desc,
                context,
                uri("default:source"),
                uri("default:rule"));
        assertThat(results.toString(), results.size(), is(0));
View Full Code Here

Examples of com.asakusafw.testdriver.core.MockExporterRetriever.Desc

                    .add(uri("testing:src"), "1:Hello, world!"),
                new MockVerifyRuleProvider()
                    .add(uri("testing:rule"), rule()),
                new MockExporterRetriever().wrap());

        Desc desc = MockExporterRetriever.create("1:BAD");
        List<Difference> results = inspector.inspect(
                desc.getModelType(),
                desc,
                context,
                uri("testing:src"),
                uri("testing:rule"));
        assertThat(results.size(), is(1));
View Full Code Here

Examples of com.asakusafw.testdriver.core.MockExporterRetriever.Desc

                    .add(uri("testing:src"), "1:Hello, world!"),
                new MockVerifyRuleProvider()
                    .add(uri("testing:rule"), rule()),
                new MockExporterRetriever().wrap());

        Desc desc = MockExporterRetriever.create();
        List<Difference> results = inspector.inspect(
                desc.getModelType(),
                desc,
                context,
                uri("testing:src"),
                uri("testing:rule"));
        assertThat(results.size(), is(1));
View Full Code Here

Examples of com.asakusafw.testdriver.core.MockExporterRetriever.Desc

                    .add(uri("testing:src"), "1:Hello, world!"),
                new MockVerifyRuleProvider()
                    .add(uri("testing:rule"), rule()),
                new MockExporterRetriever().wrap());

        Desc desc = MockExporterRetriever.create("1:Hello, world!", "2:BAD");
        List<Difference> results = inspector.inspect(
                desc.getModelType(),
                desc,
                context,
                uri("testing:src"),
                uri("testing:rule"));
        assertThat(results.size(), is(1));
View Full Code Here

Examples of com.asakusafw.testdriver.core.MockExporterRetriever.Desc

                    .add(uri("testing:src"), "1:Hello, world!"),
                new MockVerifyRuleProvider()
                    .add(uri("testing:rule"), rule()),
                new MockExporterRetriever().wrap());

        Desc desc = MockExporterRetriever.create("2:Hello, world!");
        List<Difference> results = inspector.inspect(
                desc.getModelType(),
                desc,
                context,
                uri("testing:src"),
                uri("testing:rule"));
        assertThat(results.toString(), results.size(), is(2));
View Full Code Here

Examples of com.asakusafw.testdriver.core.MockExporterRetriever.Desc

                    .add(uri("testing:src"), "1:Hello, world!"),
                new MockVerifyRuleProvider()
                    .add(uri("testing:rule"), rule()),
                new MockExporterRetriever().wrap());

        Desc desc = MockExporterRetriever.create("1:Hello, world!");
        inspector.inspect(
                desc.getModelType(),
                desc,
                context,
                uri("testing:src"),
                uri("testing:rule"));
    }
View Full Code Here

Examples of com.asakusafw.testdriver.core.MockExporterRetriever.Desc

                    .add(uri("testing:src"), "1:Hello, world!"),
                new MockVerifyRuleProvider()
                    .add(uri("testing:rule"), rule()),
                new MockExporterRetriever().wrap());

        Desc desc = MockExporterRetriever.create("1:Hello, world!");
        inspector.inspect(
                desc.getModelType(),
                desc,
                context,
                uri("unknown:src"),
                uri("testing:rule"));
    }
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.