Package com.asakusafw.vocabulary.model.Summarized

Examples of com.asakusafw.vocabulary.model.Summarized.Term


        Summarized annotation = object.unwrap().getClass().getAnnotation(Summarized.class);
        assertThat(annotation, not(nullValue()));

        loader.setNamespace(Constants.SOURCE_TABLE);

        Term term = annotation.term();
        assertThat(term.source(), eq(loader.modelType("Target")));
        assertThat(term.foldings().length, is(5));
        assertThat(term.foldings(), hasItemInArray(mapping(ANY, "valueA", "key")));
        assertThat(term.foldings(), hasItemInArray(mapping(SUM, "valueB", "sum")));
        assertThat(term.foldings(), hasItemInArray(mapping(COUNT, "sid", "count")));
        assertThat(term.foldings(), hasItemInArray(mapping(MAX, "valueC", "max")));
        assertThat(term.foldings(), hasItemInArray(mapping(MIN, "valueC", "min")));
        assertThat(term.shuffle(), is(grouping("valueA")));
    }
View Full Code Here


        Summarized annotation = object.unwrap().getClass().getAnnotation(Summarized.class);
        assertThat(annotation, not(nullValue()));

        loader.setNamespace(Constants.SOURCE_TABLE);

        Term term = annotation.term();
        assertThat(term.source(), eq(loader.modelType("Target")));
        assertThat(term.foldings().length, is(2));
        assertThat(term.foldings(), hasItemInArray(mapping(ANY, "grouping", "key")));
        assertThat(term.foldings(), hasItemInArray(mapping(COUNT, "grouping", "count")));
        assertThat(term.shuffle(), is(grouping("grouping")));
    }
View Full Code Here

    public void simple_summarize() {
        ModelLoader loader = generate();
        Summarized annotation = loader.modelType("Simple").getAnnotation(Summarized.class);
        assertThat(annotation, not(nullValue()));

        Term term = annotation.term();
        assertThat(term.source(), eq(loader.modelType("A")));
        assertThat(term.foldings().length, is(5));
        assertThat(term.foldings(), hasItemInArray(mapping(ANY, "valueA", "key")));
        assertThat(term.foldings(), hasItemInArray(mapping(SUM, "valueB", "sum")));
        assertThat(term.foldings(), hasItemInArray(mapping(COUNT, "valueA", "count")));
        assertThat(term.foldings(), hasItemInArray(mapping(MAX, "valueC", "max")));
        assertThat(term.foldings(), hasItemInArray(mapping(MIN, "valueC", "min")));
        assertThat(term.shuffle(), is(grouping("valueA")));
    }
View Full Code Here

TOP

Related Classes of com.asakusafw.vocabulary.model.Summarized.Term

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.