Package org.cassandraunit.model

Examples of org.cassandraunit.model.ColumnModel


        assertThat(actualColumnFamily.getRows(), notNullValue());
        RowModel actualRow = actualColumnFamily.getRows().get(0);
        assertThat(actualRow, notNullValue());
        assertThat(actualRow.getColumns(), notNullValue());

        ColumnModel actualColumn = actualRow.getColumns().get(0);
        assertThat(actualColumn, notNullValue());
        assertThat(actualColumn.getValue().toString(), is("11"));
        assertThat(actualColumn.getValue().getType(), is(GenericTypeEnum.UTF_8_TYPE));
    }
View Full Code Here


        assertThat(actualColumnFamily.getRows(), notNullValue());

        RowModel actualRowOfColumnFamily = actualColumnFamily.getRows().get(0);
        assertThat(actualRowOfColumnFamily, notNullValue());
        assertThat(actualRowOfColumnFamily.getColumns(), notNullValue());
        ColumnModel actualColumn0OfColumnFamily = actualRowOfColumnFamily.getColumns().get(0);
        assertThat(actualColumn0OfColumnFamily, notNullValue());
        assertThat(actualColumn0OfColumnFamily.getValue().toString(), is("1"));
        assertThat(actualColumn0OfColumnFamily.getValue().getType(), is(GenericTypeEnum.LONG_TYPE));

        ColumnModel actualColumn1OfColumnFamily = actualRowOfColumnFamily.getColumns().get(1);
        assertThat(actualColumn1OfColumnFamily, notNullValue());
        assertThat(actualColumn1OfColumnFamily.getValue().toString(), is("value12"));
        assertThat(actualColumn1OfColumnFamily.getValue().getType(), is(GenericTypeEnum.UTF_8_TYPE));
    }
View Full Code Here

        RowModel actualRowOfColumnFamily2 = actualColumnFamilyModel2.getRows().get(0);
        assertThat(actualRowOfColumnFamily2, notNullValue());
        assertThat(actualRowOfColumnFamily2.getColumns(), notNullValue());
        assertThat(actualRowOfColumnFamily2.getColumns().size(), is(2));

        ColumnModel actualColumn0OfRowOfColumnFamily2 = actualRowOfColumnFamily2.getColumns().get(0);
        assertThat(actualColumn0OfRowOfColumnFamily2, notNullValue());
        assertThat(actualColumn0OfRowOfColumnFamily2.getName().getValue(), is("counter11"));
        assertThat(actualColumn0OfRowOfColumnFamily2.getValue().getValue(), is("11"));
        assertThat(actualColumn0OfRowOfColumnFamily2.getValue().getType(), is(GenericTypeEnum.COUNTER_TYPE));

        ColumnModel actualColumn1OfRowOfColumnFamily2 = actualRowOfColumnFamily2.getColumns().get(1);
        assertThat(actualColumn1OfRowOfColumnFamily2, notNullValue());
        assertThat(actualColumn1OfRowOfColumnFamily2.getName().getValue(), is("counter12"));
        assertThat(actualColumn1OfRowOfColumnFamily2.getValue().getValue(), is("12"));
        assertThat(actualColumn1OfRowOfColumnFamily2.getValue().getType(), is(GenericTypeEnum.COUNTER_TYPE));
    }
View Full Code Here

        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

    @Test
    public void shouldGetAColumnFamilyWithNullColumnValue() {
        DataSet dataSet = new ClassPathXmlDataSet("xml/dataSetWithNullColumnValue.xml");
        ColumnFamilyModel columnFamilyModel = dataSet.getColumnFamilies().get(0);
        assertThat(columnFamilyModel.getName(), is("columnFamilyWithNullColumnValue"));
        ColumnModel columnModel = columnFamilyModel.getRows().get(0).getColumns().get(0);
        assertThat(columnModel.getName().getValue(), is("columnWithNullColumnValue"));
        assertThat(columnModel.getValue(), nullValue());
    }
View Full Code Here

    keyspace.setColumnFamilies(columnFamilies);
    return keyspace;
  }

  private static ColumnModel constructDefaultColumnForMock(String name, String value) {
    ColumnModel columnModel = new ColumnModel();
    columnModel.setName(new GenericType(name, GenericTypeEnum.BYTES_TYPE));
    columnModel.setValue(new GenericType(value, GenericTypeEnum.BYTES_TYPE));
    return columnModel;
  }
View Full Code Here

    @Test
    public void shouldGetAColumnFamilyWithTimestampedColumn() {
        DataSet dataSet = new ClassPathXmlDataSet("xml/dataSetWithTimestamp.xml");
        ColumnFamilyModel columnFamilyModel = dataSet.getColumnFamilies().get(0);
        assertThat(columnFamilyModel.getName(), is("columnFamilyWithTimestampedColumn"));
        ColumnModel columnModel = columnFamilyModel.getRows().get(0).getColumns().get(0);
        assertThat(columnModel.getName().getValue(), is("columnWithTimestamp"));
        assertThat(columnModel.getTimestamp(), is(2020L));
    }
View Full Code Here

    public void shouldGetAColumnFamilyWithMetadataAndFunction() {
        DataSet dataSet = new ClassPathXmlDataSet("xml/dataSetWithMetadataAndFunctions.xml");
        ColumnFamilyModel columnFamilyModel = dataSet.getColumnFamilies().get(0);
        assertThat(columnFamilyModel.getName(), is("columnFamilyWithMetadata"));
        List<ColumnModel> columns = columnFamilyModel.getRows().get(0).getColumns();
        ColumnModel column1 = columns.get(0);
        assertThat(column1.getName().getValue(),is("column1"));
        assertThat(column1.getValue().getValue(),is("1"));
        assertThat(column1.getValue().getType(),is(GenericTypeEnum.LONG_TYPE));

        ColumnModel column2 = columns.get(1);
        assertThat(column2.getName().getValue(),is("column2"));
        assertThat(column2.getValue().getValue(),is("2"));
        assertThat(column2.getValue().getType(),is(GenericTypeEnum.LONG_TYPE));

        ColumnModel column3 = columns.get(2);
        assertThat(column3.getName().getValue(),is("column3"));
        assertThat(column3.getValue().getValue(),is("value3"));
        assertThat(column3.getValue().getType(),is(GenericTypeEnum.UTF_8_TYPE));
    }
View Full Code Here

    superColumnModel.setColumns(columns);
    return superColumnModel;
  }

  private static ColumnModel constructDefinedColumnForMock(String name, String value) {
    ColumnModel columnModel = new ColumnModel();
    columnModel.setName(new GenericType(name, GenericTypeEnum.LONG_TYPE));
    columnModel.setValue(new GenericType(value, GenericTypeEnum.UTF_8_TYPE));
    return columnModel;
  }
View Full Code Here

    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

TOP

Related Classes of org.cassandraunit.model.ColumnModel

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.