Examples of findModelDeclaration()


Examples of com.asakusafw.dmdl.semantics.DmdlSemantics.findModelDeclaration()

        DmdlSourceResource repo = new DmdlSourceResource(Arrays.asList(resource), Charset.forName("UTF-8"));
        ClassLoader loader = ExcelTesterRoot.class.getClassLoader();
        AnalyzeTask task = new AnalyzeTask(testName.getMethodName(), loader);
        try {
            DmdlSemantics results = task.process(repo);
            ModelDeclaration decl = results.findModelDeclaration(model);
            assertThat(dmdl + ":" + model, decl, not(nullValue()));
            return decl;
        } catch (IOException e) {
            throw new AssertionError(e);
        }
View Full Code Here

Examples of com.asakusafw.dmdl.semantics.DmdlSemantics.findModelDeclaration()

     * simple record.
     */
    @Test
    public void simple() {
        DmdlSemantics resolved = resolve();
        ModelDeclaration simple = resolved.findModelDeclaration("simple");
        assertThat(simple, not(nullValue()));
        PropertyDeclaration property = simple.findPropertyDeclaration("a");
        assertThat(property, not(nullValue()));
        assertThat(property.getType(), is(type(BasicTypeKind.INT)));
    }
View Full Code Here

Examples of com.asakusafw.dmdl.semantics.DmdlSemantics.findModelDeclaration()

     * simple record with projections.
     */
    @Test
    public void projections() {
        DmdlSemantics resolved = resolve();
        ModelDeclaration simple = resolved.findModelDeclaration("simple");
        assertThat(simple, not(nullValue()));

        PropertyDeclaration a = simple.findPropertyDeclaration("a");
        assertThat(a, not(nullValue()));
        assertThat(a.getType(), is(type(BasicTypeKind.INT)));
View Full Code Here

Examples of com.asakusafw.dmdl.semantics.DmdlSemantics.findModelDeclaration()

     * joined model.
     */
    @Test
    public void join() {
        DmdlSemantics resolved = resolve();
        ModelDeclaration simple = resolved.findModelDeclaration("simple");
        assertThat(simple, not(nullValue()));

        PropertyDeclaration sid = simple.findPropertyDeclaration("sid");
        assertThat(sid, not(nullValue()));
        assertThat(sid.getType(), is(type(BasicTypeKind.LONG)));
View Full Code Here

Examples of com.asakusafw.dmdl.semantics.DmdlSemantics.findModelDeclaration()

     * summarized model.
     */
    @Test
    public void summarize() {
        DmdlSemantics resolved = resolve();
        ModelDeclaration simple = resolved.findModelDeclaration("simple");
        assertThat(simple, not(nullValue()));

        PropertyDeclaration key = simple.findPropertyDeclaration("key");
        assertThat(key, not(nullValue()));
        assertThat(key.getType(), is(type(BasicTypeKind.INT)));
View Full Code Here

Examples of com.asakusafw.dmdl.semantics.DmdlSemantics.findModelDeclaration()

     * summarized model.
     */
    @Test
    public void summarize_whole() {
        DmdlSemantics resolved = resolve();
        ModelDeclaration counter = resolved.findModelDeclaration("counter");
        assertThat(counter, not(nullValue()));

        PropertyDeclaration count = counter.findPropertyDeclaration("count");
        assertThat(count, not(nullValue()));
        assertThat(count.getType(), is(type(BasicTypeKind.LONG)));
View Full Code Here

Examples of com.asakusafw.dmdl.semantics.DmdlSemantics.findModelDeclaration()

     * simple namespace.
     */
    @Test
    public void namespace() {
        DmdlSemantics world = resolve();
        ModelDeclaration model = world.findModelDeclaration("simple");
        assertThat(model.getSymbol(), is(model("simple")));

        NamespaceTrait trait = model.getTrait(NamespaceTrait.class);
        assertThat(trait, not(nullValue()));
        assertThat(trait.getNamespace().toString(), is("com.example"));
View Full Code Here

Examples of com.asakusafw.dmdl.semantics.DmdlSemantics.findModelDeclaration()

     * namespace is not specified.
     */
    @Test
    public void empty() {
        DmdlSemantics world = resolve();
        ModelDeclaration model = world.findModelDeclaration("simple");
        assertThat(model.getSymbol(), is(model("simple")));

        NamespaceTrait trait = model.getTrait(NamespaceTrait.class);
        assertThat(trait, nullValue());
    }
View Full Code Here

Examples of com.asakusafw.dmdl.semantics.DmdlSemantics.findModelDeclaration()

     * auto projection.
     */
    @Test
    public void auto_projection() {
        DmdlSemantics world = resolve();
        ModelDeclaration model = world.findModelDeclaration("simple");
        assertThat(model.getSymbol(), is(model("simple")));

        List<ModelSymbol> projections = projections(model);
        assertThat(projections.size(), is(1));
        assertThat(projections, has(model("p1")));
View Full Code Here

Examples of com.asakusafw.dmdl.semantics.DmdlSemantics.findModelDeclaration()

     * includes subset.
     */
    @Test
    public void auto_projection_subset() {
        DmdlSemantics world = resolve();
        ModelDeclaration model = world.findModelDeclaration("simple");
        assertThat(model.getSymbol(), is(model("simple")));

        List<ModelSymbol> projections = projections(model);
        assertThat(projections.size(), is(1));
        assertThat(projections, has(model("p1")));
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.