Package com.asakusafw.modelgen.model

Examples of com.asakusafw.modelgen.model.TableModelDescription


    /**
     * 名前空間に関するテスト。
     */
    @Test
    public void namespace() {
        TableModelDescription desc = new TableModelBuilder("Example")
            .namespace("testing", "table")
            .add(null, "value", PropertyTypeKind.INT)
            .toDescription();

        assertThat(desc.getReference().getNamespace(), is("testing.table"));
        assertThat(desc.getReference().getSimpleName(), is("Example"));
    }
View Full Code Here


    /**
     * 標準名前空間に関するテスト。
     */
    @Test
    public void defaultNamespace() {
        TableModelDescription desc = new TableModelBuilder("Example")
            .namespace()
            .add(null, "value", PropertyTypeKind.INT)
            .toDescription();

        assertThat(desc.getReference().isDefaultNameSpace(), is(true));
        assertThat(desc.getReference().getSimpleName(), is("Example"));
    }
View Full Code Here

    /**
     * 単純なテスト。
     */
    @Test
    public void simple() {
        TableModelDescription a = new TableModelBuilder("A")
            .add(null, "id", PropertyTypeKind.LONG)
            .add(null, "hoge", new StringType(255))
            .toDescription();
        TableModelDescription b = new TableModelBuilder("B")
            .add(null, "id", PropertyTypeKind.LONG)
            .add(null, "foo", new StringType(255))
            .toDescription();

        JoinedModelBuilder target = new JoinedModelBuilder(
View Full Code Here

    /**
     * 同名のプロパティを同一視する結合のテスト。
     */
    @Test
    public void fill() {
        TableModelDescription a = new TableModelBuilder("A")
            .add(null, "id", PropertyTypeKind.LONG)
            .add(null, "hoge", new StringType(255))
            .toDescription();
        TableModelDescription b = new TableModelBuilder("B")
            .add(null, "id", PropertyTypeKind.LONG)
            .add(null, "hoge", new StringType(255))
            .toDescription();

        JoinedModelBuilder target = new JoinedModelBuilder(
View Full Code Here

    /**
     * 単純なワードカウント。
     */
    @Test
    public void simple() {
        TableModelDescription desc = new TableModelBuilder("A")
            .add(null, "word", new StringType(255))
            .toDescription();

        SummarizedModelDescription model = new SummarizedModelBuilder("S", desc, "a")
            .add("word", Aggregator.IDENT, "a.word")
View Full Code Here

    /**
     * 全てを単一のグループにまとめる。
     */
    @Test
    public void singleGroup() {
        TableModelDescription desc = new TableModelBuilder("A")
            .add(null, "word", new StringType(255))
            .toDescription();

        SummarizedModelDescription model = new SummarizedModelBuilder("S", desc, "a")
            .add("count", Aggregator.COUNT, "a.word")
View Full Code Here

    /**
     * 複数のグループ化キーを指定。
     */
    @Test
    public void multiGroupKey() {
        TableModelDescription desc = new TableModelBuilder("A")
            .add(null, "sex", PropertyTypeKind.BYTE)
            .add(null, "age", PropertyTypeKind.SHORT)
            .add(null, "name", new StringType(255))
            .toDescription();

View Full Code Here

    /**
     * 空。
     */
    @Test(expected = RuntimeException.class)
    public void empty() {
        TableModelDescription desc = new TableModelBuilder("A")
            .add(null, "word", PropertyTypeKind.STRING)
            .toDescription();

        new SummarizedModelBuilder("S", desc, "a")
            .toDescription();
View Full Code Here

    /**
     * 集約するカラムが見つからない。
     */
    @Test(expected = RuntimeException.class)
    public void missingAggregatingColumn() {
        TableModelDescription desc = new TableModelBuilder("A")
            .add(null, "word", PropertyTypeKind.STRING)
            .toDescription();

        new SummarizedModelBuilder("S", desc, "a")
            .add("word", Aggregator.IDENT, "a.MISSING");
View Full Code Here

    /**
     * グループ化カラムが見つからない。
     */
    @Test(expected = RuntimeException.class)
    public void missingGroupingColumn() {
        TableModelDescription desc = new TableModelBuilder("A")
            .add(null, "word", PropertyTypeKind.STRING)
            .toDescription();

        new SummarizedModelBuilder("S", desc, "a")
            .groupBy("a.MISSING");
View Full Code Here

TOP

Related Classes of com.asakusafw.modelgen.model.TableModelDescription

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.