Package org.cassandraunit.model

Examples of org.cassandraunit.model.SuperColumnModel


        assertThat(actualrow0.getColumns(), notNullValue());
        assertThat(actualrow0.getColumns().isEmpty(), is(true));
        assertThat(actualrow0.getSuperColumns(), notNullValue());
        assertThat(actualrow0.getSuperColumns().size(), is(2));

        SuperColumnModel actualSuperColumn = actualrow0.getSuperColumns().get(0);
        assertThat(actualSuperColumn, notNullValue());
        assertThat(actualSuperColumn.getName().toString(), is("name11"));
        assertThat(actualSuperColumn.getColumns(), notNullValue());
        assertThat(actualSuperColumn.getColumns().size(), is(2));

        ColumnModel actualColumn0OfRow0 = actualSuperColumn.getColumns().get(0);
        assertThat(actualColumn0OfRow0, notNullValue());
        assertThat(actualColumn0OfRow0.getName().toString(), is("111"));
        assertThat(actualColumn0OfRow0.getValue().toString(), is("value111"));

        ColumnModel actualColumn1OfRow0 = actualSuperColumn.getColumns().get(1);
        assertThat(actualColumn1OfRow0, notNullValue());
        assertThat(actualColumn1OfRow0.getName().toString(), is("112"));
        assertThat(actualColumn1OfRow0.getValue().toString(), is("value112"));

        SuperColumnModel actualSuperColumn1OfRow0 = actualrow0.getSuperColumns().get(1);
        assertThat(actualSuperColumn1OfRow0.getName().toString(), is("name12"));
        assertThat(actualSuperColumn1OfRow0.getColumns(), notNullValue());
        assertThat(actualSuperColumn1OfRow0.getColumns().size(), is(2));

        ColumnModel actualColumn0OfSuperColumn1OofRow0 = actualSuperColumn1OfRow0.getColumns().get(0);
        assertThat(actualColumn0OfSuperColumn1OofRow0, notNullValue());
        assertThat(actualColumn0OfSuperColumn1OofRow0.getName().toString(), is("121"));
        assertThat(actualColumn0OfSuperColumn1OofRow0.getValue().toString(), is("value121"));

        ColumnModel actualColumn1OfSuperColumn1ofRow0 = actualSuperColumn1OfRow0.getColumns().get(1);
        assertThat(actualColumn1OfSuperColumn1ofRow0, notNullValue());
        assertThat(actualColumn1OfSuperColumn1ofRow0.getName().toString(), is("122"));
        assertThat(actualColumn1OfSuperColumn1ofRow0.getValue().toString(), is("value122"));

        RowModel row1 = dataSet.getColumnFamilies().get(0).getRows().get(1);
        assertThat(row1, notNullValue());
        assertThat(row1.getKey().toString(), is("13818e20-1dd2-11b2-879a-782bcb80ff6a"));
        assertThat(row1.getColumns(), notNullValue());
        assertThat(row1.getColumns().isEmpty(), is(true));
        assertThat(row1.getSuperColumns(), notNullValue());
        assertThat(row1.getSuperColumns().size(), is(3));

        SuperColumnModel actualSuperColumn0OfRow1 = row1.getSuperColumns().get(0);
        assertThat(actualSuperColumn0OfRow1, notNullValue());
        assertThat(actualSuperColumn0OfRow1.getName().toString(), is("name21"));
        assertThat(actualSuperColumn0OfRow1.getColumns(), notNullValue());
        assertThat(actualSuperColumn0OfRow1.getColumns().size(), is(2));

        ColumnModel actualColumn0OfSuperColum0OfRow1 = actualSuperColumn0OfRow1.getColumns().get(0);
        assertThat(actualColumn0OfSuperColum0OfRow1, notNullValue());
        assertThat(actualColumn0OfSuperColum0OfRow1.getName().toString(), is("211"));
        assertThat(actualColumn0OfSuperColum0OfRow1.getValue().toString(), is("value211"));

        ColumnModel actualColumn1OfSuperColum0OfRow1 = actualSuperColumn0OfRow1.getColumns().get(1);
        assertThat(actualColumn1OfSuperColum0OfRow1, notNullValue());
        assertThat(actualColumn1OfSuperColum0OfRow1.getName().toString(), is("212"));
        assertThat(actualColumn1OfSuperColum0OfRow1.getValue().toString(), is("value212"));

        SuperColumnModel actualSuperColumn1OfRow1 = row1.getSuperColumns().get(1);
        assertThat(actualSuperColumn1OfRow1.getName().toString(), is("name22"));
        assertThat(actualSuperColumn1OfRow1.getColumns(), notNullValue());
        assertThat(actualSuperColumn1OfRow1.getColumns().size(), is(2));

        ColumnModel actualColumn0OfSuperCOlumn10OfRow1 = actualSuperColumn1OfRow1.getColumns().get(0);
        assertThat(actualColumn0OfSuperCOlumn10OfRow1, notNullValue());
        assertThat(actualColumn0OfSuperCOlumn10OfRow1.getName().toString(), is("221"));
        assertThat(actualColumn0OfSuperCOlumn10OfRow1.getValue().toString(), is("value221"));

        ColumnModel actualColumn1OfSuperCOlumn10OfRow1 = actualSuperColumn1OfRow1.getColumns().get(1);
        assertThat(actualColumn1OfSuperCOlumn10OfRow1, notNullValue());
        assertThat(actualColumn1OfSuperCOlumn10OfRow1.getName().toString(), is("222"));
        assertThat(actualColumn1OfSuperCOlumn10OfRow1.getValue().toString(), is("value222"));

        SuperColumnModel actualSuperColumnModel2OfRow1 = row1.getSuperColumns().get(2);
        assertThat(actualSuperColumnModel2OfRow1.getName().toString(), is("name23"));
        assertThat(actualSuperColumnModel2OfRow1.getColumns(), notNullValue());
        assertThat(actualSuperColumnModel2OfRow1.getColumns().size(), is(1));

        ColumnModel actualColumn0OfSuperColumn2OfRow1 = actualSuperColumnModel2OfRow1.getColumns().get(0);
        assertThat(actualColumn0OfSuperColumn2OfRow1, notNullValue());
        assertThat(actualColumn0OfSuperColumn2OfRow1.getName().toString(), is("231"));
        assertThat(actualColumn0OfSuperColumn2OfRow1.getValue().toString(), is("value231"));
    }
View Full Code Here


        assertThat(actualCounterSupercolumnFamilyModel.getRows().size(), is(1));
        assertThat(actualCounterSupercolumnFamilyModel.getRows().get(0), notNullValue());
        assertThat(actualCounterSupercolumnFamilyModel.getRows().get(0).getSuperColumns(), notNullValue());
        assertThat(actualCounterSupercolumnFamilyModel.getRows().get(0).getSuperColumns().size(), is(1));

        SuperColumnModel actualSuperColumnModel = actualCounterSupercolumnFamilyModel.getRows().get(0).getSuperColumns().get(0);
        assertThat(actualSuperColumnModel, notNullValue());
        assertThat(actualSuperColumnModel.getName().getValue(), is("counter11"));
        assertThat(actualSuperColumnModel.getColumns(), notNullValue());
        assertThat(actualSuperColumnModel.getColumns().size(), is(2));

        ColumnModel actualColumn0 = actualSuperColumnModel.getColumns().get(0);
        assertThat(actualColumn0, notNullValue());
        assertThat(actualColumn0.getName().getValue(), is("counter111"));
        assertThat(actualColumn0.getValue().getValue(), is("111"));
        assertThat(actualColumn0.getValue().getType(), is(GenericTypeEnum.COUNTER_TYPE));

        ColumnModel actualColumn1 = actualSuperColumnModel.getColumns().get(1);
        assertThat(actualColumn1, notNullValue());
        assertThat(actualColumn1.getName().getValue(), is("counter112"));
        assertThat(actualColumn1.getValue().getValue(), is("112"));
        assertThat(actualColumn1.getValue().getType(), is(GenericTypeEnum.COUNTER_TYPE));
View Full Code Here

    private static GenericType newUtf8GenericType(String value) {
        return new GenericType(value, GenericTypeEnum.UTF_8_TYPE);
    }

    private static SuperColumnModel constructDefinedSuperColumnForMock(int columnNumber) {
    SuperColumnModel superColumnModel = new SuperColumnModel();
    superColumnModel.setName(new GenericType("name" + columnNumber, GenericTypeEnum.UTF_8_TYPE));
    List<ColumnModel> columns = new ArrayList<ColumnModel>();
    columns.add(constructDefinedColumnForMock(columnNumber + "1", "value" + columnNumber + "1"));
    columns.add(constructDefinedColumnForMock(columnNumber + "2", "value" + columnNumber + "2"));
    superColumnModel.setColumns(columns);
    return superColumnModel;
  }
View Full Code Here

    /* row 1 */
    RowModel row1 = new RowModel();
    row1.setKey(new GenericType("10", GenericTypeEnum.LONG_TYPE));
    List<SuperColumnModel> superColumns = new ArrayList<SuperColumnModel>();
    row1.setSuperColumns(superColumns);
    SuperColumnModel superColumn = new SuperColumnModel();
    superColumn.setName(new GenericType("superColumnName11", GenericTypeEnum.UTF_8_TYPE));
    superColumns.add(superColumn);

    List<ColumnModel> columns = new ArrayList<ColumnModel>();
    superColumn.setColumns(columns);

    ColumnModel columnModel111 = new ColumnModel();
    columnModel111.setName(new GenericType("counter111", GenericTypeEnum.UTF_8_TYPE));
    columnModel111.setValue(new GenericType("111", GenericTypeEnum.COUNTER_TYPE));
    columns.add(columnModel111);
View Full Code Here

    RowModel row1 = new RowModel();
    row1.setKey(new GenericType("01", GenericTypeEnum.BYTES_TYPE));
    List<SuperColumnModel> superColumns1 = new ArrayList<SuperColumnModel>();

    SuperColumnModel superColumn11 = new SuperColumnModel();
    superColumn11.setName(new GenericType("11", GenericTypeEnum.BYTES_TYPE));
    List<ColumnModel> columns11 = new ArrayList<ColumnModel>();
    columns11.add(constructDefaultColumnForMock("1110", "1110"));
    columns11.add(constructDefaultColumnForMock("1120", "1120"));
    superColumn11.setColumns(columns11);
    superColumns1.add(superColumn11);

    SuperColumnModel superColumn12 = new SuperColumnModel();
    superColumn12.setName(new GenericType("12", GenericTypeEnum.BYTES_TYPE));
    List<ColumnModel> columns12 = new ArrayList<ColumnModel>();
    columns12.add(constructDefaultColumnForMock("1210", "1210"));
    columns12.add(constructDefaultColumnForMock("1220", "1220"));
    superColumn12.setColumns(columns12);
    superColumns1.add(superColumn12);

    row1.setSuperColumns(superColumns1);
    rows.add(row1);

    RowModel row2 = new RowModel();
    row2.setKey(new GenericType("02", GenericTypeEnum.BYTES_TYPE));
    List<SuperColumnModel> superColumns2 = new ArrayList<SuperColumnModel>();
    SuperColumnModel superColumn21 = new SuperColumnModel();
    superColumn21.setName(new GenericType("21", GenericTypeEnum.BYTES_TYPE));
    List<ColumnModel> columns21 = new ArrayList<ColumnModel>();
    columns21.add(constructDefaultColumnForMock("2110", "2110"));
    columns21.add(constructDefaultColumnForMock("2120", "2120"));
    superColumn21.setColumns(columns21);
    superColumns2.add(superColumn21);
    row2.setSuperColumns(superColumns2);

    rows.add(row2);
View Full Code Here

TOP

Related Classes of org.cassandraunit.model.SuperColumnModel

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.