Package org.cassandraunit.type

Examples of org.cassandraunit.type.GenericType


    columnFamily.setDefaultColumnValueType(ComparatorType.COUNTERTYPE);
    List<RowModel> rows = new ArrayList<RowModel>();

    /* 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);
    ColumnModel columnModel112 = new ColumnModel();
    columnModel112.setName(new GenericType("counter112", GenericTypeEnum.UTF_8_TYPE));
    columnModel112.setValue(new GenericType("112", GenericTypeEnum.COUNTER_TYPE));
    columns.add(columnModel112);

    rows.add(row1);

    columnFamily.setRows(rows);
View Full Code Here


    columnFamily.setDefaultColumnValueType(ComparatorType.COUNTERTYPE);
    List<RowModel> rows = new ArrayList<RowModel>();

    /* row 1 */
    RowModel row1 = new RowModel();
    row1.setKey(new GenericType("10", GenericTypeEnum.LONG_TYPE));
    List<ColumnModel> columns1 = new ArrayList<ColumnModel>();
    ColumnModel columnModel11 = new ColumnModel();
    columnModel11.setName(new GenericType("counter11", GenericTypeEnum.UTF_8_TYPE));
    columnModel11.setValue(new GenericType("11", GenericTypeEnum.COUNTER_TYPE));
    columns1.add(columnModel11);
    ColumnModel columnModel12 = new ColumnModel();
    columnModel12.setName(new GenericType("counter12", GenericTypeEnum.UTF_8_TYPE));
    columnModel12.setValue(new GenericType("12", GenericTypeEnum.COUNTER_TYPE));
    columns1.add(columnModel12);
    row1.setColumns(columns1);
    rows.add(row1);

    columnFamily.setRows(rows);
View Full Code Here

    columnFamily.setDefaultColumnValueType(ComparatorType.UTF8TYPE);
    List<RowModel> rows = new ArrayList<RowModel>();

    /* row 1 */
    RowModel row1 = new RowModel();
    row1.setKey(new GenericType("01", GenericTypeEnum.BYTES_TYPE));
    List<ColumnModel> columns1 = new ArrayList<ColumnModel>();
    ColumnModel columnModel11 = new ColumnModel();
    columnModel11.setName(new GenericType("01", GenericTypeEnum.BYTES_TYPE));
    columnModel11.setValue(new GenericType("1", GenericTypeEnum.LONG_TYPE));
    columns1.add(columnModel11);
    ColumnModel columnModel12 = new ColumnModel();
    columnModel12.setName(new GenericType("02", GenericTypeEnum.BYTES_TYPE));
    columnModel12.setValue(new GenericType("19652258", GenericTypeEnum.LONG_TYPE));
    columns1.add(columnModel12);
    row1.setColumns(columns1);
    rows.add(row1);

    columnFamily.setRows(rows);
View Full Code Here

    columnFamily.setDefaultColumnValueType(ComparatorType.LONGTYPE);
    List<RowModel> rows = new ArrayList<RowModel>();

    /* row 1 */
    RowModel row1 = new RowModel();
    row1.setKey(new GenericType("01", GenericTypeEnum.BYTES_TYPE));
    List<ColumnModel> columns1 = new ArrayList<ColumnModel>();
    ColumnModel columnModel11 = new ColumnModel();
    columnModel11.setName(new GenericType("01", GenericTypeEnum.BYTES_TYPE));
    columnModel11.setValue(new GenericType("1", GenericTypeEnum.LONG_TYPE));
    columns1.add(columnModel11);
    ColumnModel columnModel12 = new ColumnModel();
    columnModel12.setName(new GenericType("02", GenericTypeEnum.BYTES_TYPE));
    columnModel12.setValue(new GenericType("19652258", GenericTypeEnum.LONG_TYPE));
    columns1.add(columnModel12);
    row1.setColumns(columns1);
    rows.add(row1);

    columnFamily.setRows(rows);
View Full Code Here

    List<RowModel> rows = new ArrayList<RowModel>();

    /* row 1 */
    RowModel row1 = new RowModel();
    row1.setKey(new GenericType("13816710-1dd2-11b2-879a-782bcb80ff6a", GenericTypeEnum.UUID_TYPE));
    List<ColumnModel> columns1 = new ArrayList<ColumnModel>();
    ColumnModel columnModel11 = new ColumnModel();
    columnModel11
        .setName(new GenericType("13816710-1dd2-11b2-879a-782bcb80ff6a", GenericTypeEnum.LEXICAL_UUID_TYPE));
    columnModel11.setValue(new GenericType("11", GenericTypeEnum.BYTES_TYPE));
    columns1.add(columnModel11);
    ColumnModel columnModel12 = new ColumnModel();
    columnModel12
        .setName(new GenericType("13818e20-1dd2-11b2-879a-782bcb80ff6a", GenericTypeEnum.LEXICAL_UUID_TYPE));
    columnModel12.setValue(new GenericType("12", GenericTypeEnum.BYTES_TYPE));
    columns1.add(columnModel12);
    row1.setColumns(columns1);
    rows.add(row1);

    columnFamily.setRows(rows);
View Full Code Here

    List<RowModel> rows = new ArrayList<RowModel>();

    /* row 1 */
    RowModel row1 = new RowModel();
    row1.setKey(new GenericType("10", GenericTypeEnum.LONG_TYPE));
    List<ColumnModel> columns1 = new ArrayList<ColumnModel>();
    ColumnModel columnModel11 = new ColumnModel();
    columnModel11.setName(new GenericType("11", GenericTypeEnum.INTEGER_TYPE));
    columnModel11.setValue(new GenericType("11", GenericTypeEnum.BYTES_TYPE));
    columns1.add(columnModel11);
    ColumnModel columnModel12 = new ColumnModel();
    columnModel12.setName(new GenericType("12", GenericTypeEnum.INTEGER_TYPE));
    columnModel12.setValue(new GenericType("12", GenericTypeEnum.BYTES_TYPE));
    columns1.add(columnModel12);
    row1.setColumns(columns1);
    rows.add(row1);

    columnFamily.setRows(rows);
View Full Code Here

    List<RowModel> rows = new ArrayList<RowModel>();

    /* row 1 */
    RowModel row1 = new RowModel();
    row1.setKey(new GenericType("13816710-1dd2-11b2-879a-782bcb80ff6a", GenericTypeEnum.TIME_UUID_TYPE));
    List<ColumnModel> columns1 = new ArrayList<ColumnModel>();
    ColumnModel columnModel11 = new ColumnModel();
    columnModel11.setName(new GenericType("name11", GenericTypeEnum.UTF_8_TYPE));
    columnModel11.setValue(new GenericType("11", GenericTypeEnum.BYTES_TYPE));
    columns1.add(columnModel11);
    ColumnModel columnModel12 = new ColumnModel();
    columnModel12.setName(new GenericType("name12", GenericTypeEnum.UTF_8_TYPE));
    columnModel12.setValue(new GenericType("12", GenericTypeEnum.BYTES_TYPE));
    columns1.add(columnModel12);
    row1.setColumns(columns1);
    rows.add(row1);

    /* row 2 */
    RowModel row2 = new RowModel();
    row2.setKey(new GenericType("13818e20-1dd2-11b2-879a-782bcb80ff6a", GenericTypeEnum.TIME_UUID_TYPE));
    List<ColumnModel> columns2 = new ArrayList<ColumnModel>();
    ColumnModel columnModel21 = new ColumnModel();
    columnModel21.setName(new GenericType("name21", GenericTypeEnum.UTF_8_TYPE));
    columnModel21.setValue(new GenericType("21", GenericTypeEnum.BYTES_TYPE));
    columns2.add(columnModel21);
    ColumnModel columnModel22 = new ColumnModel();
    columnModel22.setName(new GenericType("name22", GenericTypeEnum.UTF_8_TYPE));
    columnModel22.setValue(new GenericType("22", GenericTypeEnum.BYTES_TYPE));
    columns2.add(columnModel22);
    row2.setColumns(columns2);
    rows.add(row2);

    columnFamily.setRows(rows);
View Full Code Here

    columnFamily.setType(ColumnType.SUPER);

    List<RowModel> rows = new ArrayList<RowModel>();

    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);
View Full Code Here

    columnFamily.setComparatorTypeAlias("(LongType,UTF8Type,IntegerType)");
    columnFamily.setDefaultColumnValueType(ComparatorType.UTF8TYPE);

    /* row1 */
    RowModel row = new RowModel();
    row.setKey(new GenericType("row1", GenericTypeEnum.UTF_8_TYPE));

    /* column1 */
    ColumnModel column1 = new ColumnModel();
    column1.setName(new GenericType(new String[] { "11", "aa", "11" }, new GenericTypeEnum[] {
        GenericTypeEnum.LONG_TYPE, GenericTypeEnum.UTF_8_TYPE, GenericTypeEnum.INTEGER_TYPE }));
    column1.setValue(new GenericType("v1", GenericTypeEnum.UTF_8_TYPE));
    row.getColumns().add(column1);

    /* column2 */
    ColumnModel column2 = new ColumnModel();
    column2.setName(new GenericType(new String[] { "11", "ab", "11" }, new GenericTypeEnum[] {
        GenericTypeEnum.LONG_TYPE, GenericTypeEnum.UTF_8_TYPE, GenericTypeEnum.INTEGER_TYPE }));
    column2.setValue(new GenericType("v2", GenericTypeEnum.UTF_8_TYPE));
    row.getColumns().add(column2);

    /* column3 */
    ColumnModel column3 = new ColumnModel();
    column3.setName(new GenericType(new String[] { "11", "ab", "12" }, new GenericTypeEnum[] {
        GenericTypeEnum.LONG_TYPE, GenericTypeEnum.UTF_8_TYPE, GenericTypeEnum.INTEGER_TYPE }));
    column3.setValue(new GenericType("v3", GenericTypeEnum.UTF_8_TYPE));
    row.getColumns().add(column3);

    /* column4 */
    ColumnModel column4 = new ColumnModel();
    column4.setName(new GenericType(new String[] { "12", "aa", "11" }, new GenericTypeEnum[] {
        GenericTypeEnum.LONG_TYPE, GenericTypeEnum.UTF_8_TYPE, GenericTypeEnum.INTEGER_TYPE }));
    column4.setValue(new GenericType("v4", GenericTypeEnum.UTF_8_TYPE));
    row.getColumns().add(column4);

    /* column5 */
    ColumnModel column5 = new ColumnModel();
    column5.setName(new GenericType(new String[] { "12", "ab", "11" }, new GenericTypeEnum[] {
        GenericTypeEnum.LONG_TYPE, GenericTypeEnum.UTF_8_TYPE, GenericTypeEnum.INTEGER_TYPE }));
    column5.setValue(new GenericType("v5", GenericTypeEnum.UTF_8_TYPE));
    row.getColumns().add(column5);

    /* column6 */
    ColumnModel column6 = new ColumnModel();
    column6.setName(new GenericType(new String[] { "12", "zz", "12" }, new GenericTypeEnum[] {
        GenericTypeEnum.LONG_TYPE, GenericTypeEnum.UTF_8_TYPE, GenericTypeEnum.INTEGER_TYPE }));
    column6.setValue(new GenericType("v6", GenericTypeEnum.UTF_8_TYPE));
    row.getColumns().add(column6);

    columnFamily.getRows().add(row);
    keyspace.getColumnFamilies().add(columnFamily);

    /* column family 2 with composite Type row key */
    ColumnFamilyModel columnFamily2 = new ColumnFamilyModel();
    columnFamily2.setName("columnFamilyWithRowKeyCompositeType");
    columnFamily2.setKeyType(ComparatorType.COMPOSITETYPE);
    columnFamily2.setKeyTypeAlias("(LongType,UTF8Type)");
    columnFamily2.setComparatorType(ComparatorType.UTF8TYPE);
    columnFamily2.setDefaultColumnValueType(ComparatorType.UTF8TYPE);

    /* row1 */
    RowModel row21 = new RowModel();
    row21.setKey(new GenericType(new String[] { "12", "az" }, new GenericTypeEnum[] { GenericTypeEnum.LONG_TYPE,
        GenericTypeEnum.UTF_8_TYPE }));

    /* column1 */
    ColumnModel column21 = new ColumnModel();
    column21.setName(new GenericType("a", GenericTypeEnum.UTF_8_TYPE));
    column21.setValue(new GenericType("a", GenericTypeEnum.UTF_8_TYPE));
    row21.getColumns().add(column21);
    columnFamily2.getRows().add(row21);

    keyspace.getColumnFamilies().add(columnFamily2);
    when(mockDataSet.getKeyspace()).thenReturn(keyspace);
View Full Code Here

        columnFamily.setKeyType(ComparatorType.UTF8TYPE);
        columnFamily.setDefaultColumnValueType(ComparatorType.UTF8TYPE);

        /* row1 */
        RowModel row = new RowModel();
        row.setKey(new GenericType("rowWithNullColumnValue", GenericTypeEnum.UTF_8_TYPE));

        /* column1 */
        ColumnModel column1 = new ColumnModel();
        column1.setName(new GenericType("columnWithNullValue",GenericTypeEnum.UTF_8_TYPE));
        row.getColumns().add(column1);

        columnFamily.getRows().add(row);
        keyspace.getColumnFamilies().add(columnFamily);

View Full Code Here

TOP

Related Classes of org.cassandraunit.type.GenericType

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.