Package com.datastax.driver.core

Examples of com.datastax.driver.core.ColumnMetadata$IndexMetadata


    public void should_exception_when_no_counter_pk_column() {
        // Given
        KeyspaceMetadata keyspaceMeta = mock(KeyspaceMetadata.class);
        when(keyspaceMeta.getTable(ACHILLES_COUNTER_TABLE)).thenReturn(tableMetaData);

        ColumnMetadata fqcnColumn = ColumnMetadataBuilder.create(tableMetaData, ACHILLES_COUNTER_FQCN, text());

        when(tableMetaData.getColumn(ACHILLES_COUNTER_FQCN)).thenReturn(fqcnColumn);
        when(tableMetaData.getColumn(ACHILLES_COUNTER_PRIMARY_KEY)).thenReturn(null);
        when(tableMetaData.getPartitionKey()).thenReturn(asList(fqcnColumn));
View Full Code Here


    public void should_exception_when_counter_pk_column_bad_type() {
        // Given
        KeyspaceMetadata keyspaceMeta = mock(KeyspaceMetadata.class);
        when(keyspaceMeta.getTable(ACHILLES_COUNTER_TABLE)).thenReturn(tableMetaData);

        ColumnMetadata fqcnColumn = ColumnMetadataBuilder.create(tableMetaData, ACHILLES_COUNTER_FQCN, text());
        ColumnMetadata pkColumn = ColumnMetadataBuilder.create(tableMetaData, ACHILLES_COUNTER_PRIMARY_KEY, inet());
        when(tableMetaData.getColumn(ACHILLES_COUNTER_FQCN)).thenReturn(fqcnColumn);
        when(tableMetaData.getColumn(ACHILLES_COUNTER_PRIMARY_KEY)).thenReturn(pkColumn);
        when(tableMetaData.getPartitionKey()).thenReturn(asList(fqcnColumn, pkColumn));

        // Then
View Full Code Here

        // Given
        // Given
        KeyspaceMetadata keyspaceMeta = mock(KeyspaceMetadata.class);
        when(keyspaceMeta.getTable(ACHILLES_COUNTER_TABLE)).thenReturn(tableMetaData);

        ColumnMetadata fqcnColumn = ColumnMetadataBuilder.create(tableMetaData, ACHILLES_COUNTER_FQCN, text());
        ColumnMetadata pkColumn = ColumnMetadataBuilder.create(tableMetaData, ACHILLES_COUNTER_PRIMARY_KEY, text());
        when(tableMetaData.getColumn(ACHILLES_COUNTER_FQCN)).thenReturn(fqcnColumn);
        when(tableMetaData.getColumn(ACHILLES_COUNTER_PRIMARY_KEY)).thenReturn(pkColumn);
        when(tableMetaData.getPartitionKey()).thenReturn(asList(fqcnColumn));

        // Then
View Full Code Here

    public void should_exception_when_no_counter_property_column() {
        // Given
        KeyspaceMetadata keyspaceMeta = mock(KeyspaceMetadata.class);
        when(keyspaceMeta.getTable(ACHILLES_COUNTER_TABLE)).thenReturn(tableMetaData);

        ColumnMetadata fqcnColumn = ColumnMetadataBuilder.create(tableMetaData, ACHILLES_COUNTER_FQCN, text());
        ColumnMetadata pkColumn = ColumnMetadataBuilder.create(tableMetaData, ACHILLES_COUNTER_PRIMARY_KEY, text());

        when(tableMetaData.getColumn(ACHILLES_COUNTER_FQCN)).thenReturn(fqcnColumn);
        when(tableMetaData.getColumn(ACHILLES_COUNTER_PRIMARY_KEY)).thenReturn(pkColumn);
        when(tableMetaData.getColumn(ACHILLES_COUNTER_PROPERTY_NAME)).thenReturn(null);
View Full Code Here

    public void should_exception_when_counter_property_column_bad_type() {
        // Given
        KeyspaceMetadata keyspaceMeta = mock(KeyspaceMetadata.class);
        when(keyspaceMeta.getTable(ACHILLES_COUNTER_TABLE)).thenReturn(tableMetaData);

        ColumnMetadata fqcnColumn = ColumnMetadataBuilder.create(tableMetaData, ACHILLES_COUNTER_FQCN, text());
        ColumnMetadata pkColumn = ColumnMetadataBuilder.create(tableMetaData, ACHILLES_COUNTER_PRIMARY_KEY, text());
        ColumnMetadata propertyColumn = ColumnMetadataBuilder.create(tableMetaData, ACHILLES_COUNTER_PROPERTY_NAME, inet());

        when(tableMetaData.getColumn(ACHILLES_COUNTER_FQCN)).thenReturn(fqcnColumn);
        when(tableMetaData.getColumn(ACHILLES_COUNTER_PRIMARY_KEY)).thenReturn(pkColumn);
        when(tableMetaData.getColumn(ACHILLES_COUNTER_PROPERTY_NAME)).thenReturn(propertyColumn);
View Full Code Here

    public void should_exception_when_counter_property_column_not_matching() {
        // Given
        KeyspaceMetadata keyspaceMeta = mock(KeyspaceMetadata.class);
        when(keyspaceMeta.getTable(ACHILLES_COUNTER_TABLE)).thenReturn(tableMetaData);

        ColumnMetadata fqcnColumn = ColumnMetadataBuilder.create(tableMetaData, ACHILLES_COUNTER_FQCN, text());
        ColumnMetadata pkColumn = ColumnMetadataBuilder.create(tableMetaData, ACHILLES_COUNTER_PRIMARY_KEY, text());
        ColumnMetadata propertyColumn = ColumnMetadataBuilder.create(tableMetaData, ACHILLES_COUNTER_PROPERTY_NAME, text());

        when(tableMetaData.getColumn(ACHILLES_COUNTER_FQCN)).thenReturn(fqcnColumn);
        when(tableMetaData.getColumn(ACHILLES_COUNTER_PRIMARY_KEY)).thenReturn(pkColumn);
        when(tableMetaData.getColumn(ACHILLES_COUNTER_PROPERTY_NAME)).thenReturn(propertyColumn);
View Full Code Here

    public void should_exception_when_no_counter_value_column() {
        // Given
        KeyspaceMetadata keyspaceMeta = mock(KeyspaceMetadata.class);
        when(keyspaceMeta.getTable(ACHILLES_COUNTER_TABLE)).thenReturn(tableMetaData);

        ColumnMetadata fqcnColumn = ColumnMetadataBuilder.create(tableMetaData, ACHILLES_COUNTER_FQCN, text());
        ColumnMetadata pkColumn = ColumnMetadataBuilder.create(tableMetaData, ACHILLES_COUNTER_PRIMARY_KEY, text());
        ColumnMetadata propertyColumn = ColumnMetadataBuilder.create(tableMetaData, ACHILLES_COUNTER_PROPERTY_NAME, text());

        when(tableMetaData.getColumn(ACHILLES_COUNTER_FQCN)).thenReturn(fqcnColumn);
        when(tableMetaData.getColumn(ACHILLES_COUNTER_PRIMARY_KEY)).thenReturn(pkColumn);
        when(tableMetaData.getColumn(ACHILLES_COUNTER_PROPERTY_NAME)).thenReturn(propertyColumn);
        when(tableMetaData.getColumn(ACHILLES_COUNTER_VALUE)).thenReturn(null);
View Full Code Here

    public void should_exception_when_counter_value_column_bad_type() {
        // Given
        KeyspaceMetadata keyspaceMeta = mock(KeyspaceMetadata.class);
        when(keyspaceMeta.getTable(ACHILLES_COUNTER_TABLE)).thenReturn(tableMetaData);

        ColumnMetadata fqcnColumn = ColumnMetadataBuilder.create(tableMetaData, ACHILLES_COUNTER_FQCN, text());
        ColumnMetadata pkColumn = ColumnMetadataBuilder.create(tableMetaData, ACHILLES_COUNTER_PRIMARY_KEY, text());
        ColumnMetadata propertyColumn = ColumnMetadataBuilder.create(tableMetaData, ACHILLES_COUNTER_PROPERTY_NAME, text());
        ColumnMetadata counterColumnMeta = ColumnMetadataBuilder.create(tableMetaData, ACHILLES_COUNTER_VALUE, inet());

        when(tableMetaData.getColumn(ACHILLES_COUNTER_FQCN)).thenReturn(fqcnColumn);
        when(tableMetaData.getColumn(ACHILLES_COUNTER_PRIMARY_KEY)).thenReturn(pkColumn);
        when(tableMetaData.getColumn(ACHILLES_COUNTER_PROPERTY_NAME)).thenReturn(propertyColumn);
        when(tableMetaData.getColumn(ACHILLES_COUNTER_VALUE)).thenReturn(counterColumnMeta);
View Full Code Here

    }

    @Test
    public void should_validate_partition_components() throws Exception {
        //Given
        final ColumnMetadata idColumnMeta = create(tableMetadata, "id", bigint());
        final ColumnMetadata nameColumnMeta = create(tableMetadata, "name", text());

        PropertyMeta partitionMeta1 = mock(PropertyMeta.class, RETURNS_DEEP_STUBS);
        PropertyMeta partitionMeta2 = mock(PropertyMeta.class, RETURNS_DEEP_STUBS);
        when(embeddedIdProperties.getPartitionComponents()).thenReturn(new PartitionComponents(asList(partitionMeta1, partitionMeta2)));
View Full Code Here

    }

    @Test
    public void should_validate_clustering_components() throws Exception {
        //Given
        final ColumnMetadata idColumnMeta = create(tableMetadata, "id", bigint());
        final ColumnMetadata nameColumnMeta = create(tableMetadata, "name", text());

        PropertyMeta clusteringMeta1 = mock(PropertyMeta.class, RETURNS_DEEP_STUBS);
        PropertyMeta clusteringMeta2 = mock(PropertyMeta.class, RETURNS_DEEP_STUBS);
        when(embeddedIdProperties.getClusteringComponents()).thenReturn(new ClusteringComponents(asList(clusteringMeta1, clusteringMeta2), Arrays.<ClusteringOrder>asList()));
View Full Code Here

TOP

Related Classes of com.datastax.driver.core.ColumnMetadata$IndexMetadata

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.