Examples of DmdlSemantics


Examples of com.asakusafw.dmdl.semantics.DmdlSemantics

    /**
     * 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

    /**
     * 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

    /**
     * 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

Examples of com.asakusafw.dmdl.semantics.DmdlSemantics

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

        List<ModelSymbol> projections = projections(model);
        assertThat(projections.size(), is(0));
    }
View Full Code Here

Examples of com.asakusafw.dmdl.semantics.DmdlSemantics

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

        List<ModelSymbol> projections = projections(model);
        assertThat(projections.size(), is(0));
    }
View Full Code Here

Examples of com.asakusafw.dmdl.semantics.DmdlSemantics

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

        List<ModelSymbol> projections = projections(model);
        assertThat(projections.size(), is(0));
    }
View Full Code Here

Examples of com.asakusafw.dmdl.semantics.DmdlSemantics

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

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

Examples of com.asakusafw.dmdl.semantics.DmdlSemantics

    /**
     * auto projection for summarization.
     */
    @Test
    public void auto_projection_summarize() {
        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("total")));
View Full Code Here

Examples of com.asakusafw.dmdl.semantics.DmdlSemantics

            throw new IllegalArgumentException("typeDrivers must not be null"); //$NON-NLS-1$
        }
        if (attributeDrivers == null) {
            throw new IllegalArgumentException("attributeDrivers must not be null"); //$NON-NLS-1$
        }
        this.context = new Context(new DmdlSemantics(), typeDrivers, attributeDrivers);
        this.modelDependencies = Graphs.newInstance();
    }
View Full Code Here

Examples of com.asakusafw.dmdl.semantics.DmdlSemantics

     */
    public void addModel(AstModelDefinition<?> definition) {
        if (definition == null) {
            throw new IllegalArgumentException("definition must not be null"); //$NON-NLS-1$
        }
        DmdlSemantics world = context.getWorld();
        if (world.findModelDeclaration(definition.name.identifier) != null) {
            report(new Diagnostic(
                    Diagnostic.Level.ERROR,
                    definition.name,
                    Messages.getString("DmdlAnalyzer.diagnosticModelDuplicated"), //$NON-NLS-1$
                    definition.name.identifier));
        } else {
            world.declareModel(
                    definition,
                    definition.name,
                    definition.description,
                    definition.attributes);
            computeDependencies(definition);
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.