Package org.cassandraunit.dataset

Examples of org.cassandraunit.dataset.DataSet


        assertThat(columnModel.getName().getValue(), is("columnWithNullColumnValue"));
        assertThat(columnModel.getValue(), nullValue());
    }
   @Test
   public void shouldGetAColumnFamilyWithTimestampedColumn() {
       DataSet dataSet = new ClassPathYamlDataSet("yaml/dataSetWithTimestamp.yaml");
       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


       assertThat(columnModel.getTimestamp(), is(2020L));
   }

    @Test
    public void shouldGetAColumnFamilyWithMetadataAndFunction() {
        DataSet dataSet = new ClassPathYamlDataSet("yaml/dataSetWithMetadataAndFunctions.yaml");
        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"));
View Full Code Here

        assertThat(column3.getValue().getType(),is(GenericTypeEnum.UTF_8_TYPE));
    }

    @Test
    public void shouldGetAColumnFamilyWithColumnsInReverseOrder() {
        DataSet dataSet = new ClassPathYamlDataSet("yaml/dataSetWithReversedComparatorOnSimpleType.yaml");

        ColumnFamilyModel columnFamilyModel = dataSet.getColumnFamilies().get(0);
        assertThat(columnFamilyModel.getName(), is("columnFamilyWithReversedComparatorOnSimpleType"));
        assertThat(columnFamilyModel.getComparatorType().getTypeName(), is(ComparatorType.UTF8TYPE.getTypeName()));
        assertThat(columnFamilyModel.getComparatorTypeAlias(), is("(reversed=true)"));

        List<ColumnModel> columns = columnFamilyModel.getRows().get(0).getColumns();
View Full Code Here

        assertThat(column3.getValue().getValue(), is("a"));
    }

    @Test
    public void shouldGetAColumnFamilyWithCompositeColumnsInReverseOrder() {
        DataSet dataSet = new ClassPathYamlDataSet("yaml/dataSetWithReversedComparatorOnCompositeTypes.yaml");

        ColumnFamilyModel columnFamilyModel = dataSet.getColumnFamilies().get(0);
        assertThat(columnFamilyModel.getName(), is("columnFamilyWithReversedComparatorOnCompositeTypes"));
        assertThat(columnFamilyModel.getComparatorType().getTypeName(), is(ComparatorType.COMPOSITETYPE.getTypeName()));
        assertThat(columnFamilyModel.getComparatorTypeAlias(), is("(LongType(reversed=true),UTF8Type,IntegerType(reversed=true))"));

        GenericTypeEnum[] expecTedTypesBelongingCompositeType = new GenericTypeEnum[] { GenericTypeEnum.LONG_TYPE, GenericTypeEnum.UTF_8_TYPE,
View Full Code Here

    }


    @Test
    public void shouldGetBinaryData() {
        DataSet dataSet = new ClassPathYamlDataSet("yaml/dataSetWithBinaryData.yaml");
        ColumnFamilyModel columnFamilyModel = dataSet.getColumnFamilies().get(0);
        assertThat(columnFamilyModel.getName(), is("columnFamilyWithBinaryData"));
        List<ColumnModel> columns = columnFamilyModel.getRows().get(0).getColumns();
        ColumnModel column1 = columns.get(0);
        assertThat(column1.getName().getValue(), is("a"));
        assertThat(column1.getValue().getValue(), is("aGVsbG8gd29ybGQh"));
View Full Code Here

        dataSet.getKeyspace();
    }

    @Test(expected = ParseException.class)
    public void shouldNotGetAJsonDataSetStructureBecauseOfInvalidSubComparatorType() {
        DataSet dataSet = new ClassPathJsonDataSet("json/dataSetBadInvalidSubComparatorType.json");
        dataSet.getKeyspace();
    }
View Full Code Here

        assertThat(actualColumn1OfColumnFamily.getValue().getType(), is(GenericTypeEnum.UTF_8_TYPE));
    }

    @Test
    public void shouldGetCounterStandardColumnFamily() {
        DataSet dataSet = new ClassPathXmlDataSet("xml/dataSetDefinedValues.xml");

        ColumnFamilyModel actualColumnFamilyModel2 = dataSet.getColumnFamilies().get(2);
        assertThat(actualColumnFamilyModel2.getName(), is("counterStandardColumnFamilyName"));
        assertThat(actualColumnFamilyModel2.getType(), is(ColumnType.STANDARD));
        assertThat(actualColumnFamilyModel2.getKeyType().getClassName(), is(ComparatorType.LONGTYPE.getClassName()));
        assertThat(actualColumnFamilyModel2.getKeyType().getClassName(), is(ComparatorType.LONGTYPE.getClassName()));
        assertThat(actualColumnFamilyModel2.getComparatorType().getClassName(), is(ComparatorType.UTF8TYPE.getClassName()));
View Full Code Here

        dataSet.getKeyspace();
    }

    @Test(expected = ParseException.class)
    public void shouldNotGetAJsonDataSetStructureBecauseOfInvalidDefaultColumnValueType() {
        DataSet dataSet = new ClassPathJsonDataSet("json/dataSetBadInvalidDefaultColumnValueType.json");
        dataSet.getKeyspace();
    }
View Full Code Here

        assertThat(actualColumn1OfRowOfColumnFamily2.getValue().getType(), is(GenericTypeEnum.COUNTER_TYPE));
    }

    @Test
    public void shouldGetCounterSuperColumnFamily() {
        DataSet dataSet = new ClassPathXmlDataSet("xml/dataSetDefinedValues.xml");
        ColumnFamilyModel actualCounterSupercolumnFamilyModel = dataSet.getColumnFamilies().get(3);
        assertThat(actualCounterSupercolumnFamilyModel.getName(), is("counterSuperColumnFamilyName"));
        assertThat(actualCounterSupercolumnFamilyModel.getType(), is(ColumnType.SUPER));
        assertThat(actualCounterSupercolumnFamilyModel.getKeyType().getClassName(), is(ComparatorType.LONGTYPE.getClassName()));
        assertThat(actualCounterSupercolumnFamilyModel.getComparatorType().getClassName(), is(ComparatorType.UTF8TYPE.getClassName()));
        assertThat(actualCounterSupercolumnFamilyModel.getDefaultColumnValueType().getClassName(), is(ComparatorType.COUNTERTYPE.getClassName()));
View Full Code Here

        dataSet.getKeyspace();
    }

    @Test
    public void shouldGetAJsonDataSetWithData() {
        DataSet dataSet = new ClassPathJsonDataSet("json/dataSetDefaultValues.json");
        assertThat(dataSet, notNullValue());
        assertThat(dataSet.getKeyspace(), notNullValue());

        List<ColumnFamilyModel> actualColumnFamilies = dataSet.getColumnFamilies();
        assertThat(actualColumnFamilies, notNullValue());
        assertThat(actualColumnFamilies.size(), is(1));

        ColumnFamilyModel actualColumnFamily1 = actualColumnFamilies.get(0);
        assertThat(actualColumnFamily1, notNullValue());
View Full Code Here

TOP

Related Classes of org.cassandraunit.dataset.DataSet

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.