Package org.cassandraunit.dataset

Examples of org.cassandraunit.dataset.DataSet


*/
public class ClasspathYamlDataSetTest {

  @Test
  public void shouldGetAYamlDataSetStructure() {
    DataSet dataSet = new ClassPathYamlDataSet("yaml/dataSetDefaultValues.yaml");
    assertThat(dataSet, notNullValue());
    assertThat(dataSet.getKeyspace(), notNullValue());
    assertThat(dataSet.getKeyspace().getName(), is("beautifulKeyspaceName"));
    assertThat(dataSet.getKeyspace().getReplicationFactor(), is(1));
    assertThat(dataSet.getKeyspace().getStrategy(), is(StrategyModel.SIMPLE_STRATEGY));

    assertThat(dataSet.getColumnFamilies(), notNullValue());
    assertThat(dataSet.getColumnFamilies().size(), is(1));
    assertThat(dataSet.getColumnFamilies().get(0), notNullValue());
    assertThat(dataSet.getColumnFamilies().get(0).getName(), is("columnFamily1"));
    assertThat(dataSet.getColumnFamilies().get(0).getType(), is(ColumnType.STANDARD));
    assertThat(dataSet.getColumnFamilies().get(0).getKeyType().getTypeName(),
        is(ComparatorType.BYTESTYPE.getTypeName()));
    assertThat(dataSet.getColumnFamilies().get(0).getComparatorType().getTypeName(),
        is(ComparatorType.BYTESTYPE.getTypeName()));
    assertThat(dataSet.getColumnFamilies().get(0).getSubComparatorType(), nullValue());
  }
View Full Code Here


    return "/yaml/dataSetDefaultValues.yaml";
  }

  @Test
  public void shouldGetAYamlDataSetStructure() {
    DataSet dataSet = new FileYamlDataSet(super.targetDataSetPathFileName);
    assertThat(dataSet, notNullValue());
    assertThat(dataSet.getKeyspace(), notNullValue());
    assertThat(dataSet.getKeyspace().getName(), is("beautifulKeyspaceName"));
    assertThat(dataSet.getKeyspace().getReplicationFactor(), is(1));
    assertThat(dataSet.getKeyspace().getStrategy(), is(StrategyModel.SIMPLE_STRATEGY));

    assertThat(dataSet.getColumnFamilies(), notNullValue());
    assertThat(dataSet.getColumnFamilies().size(), is(1));
    assertThat(dataSet.getColumnFamilies().get(0), notNullValue());
    assertThat(dataSet.getColumnFamilies().get(0).getName(), is("columnFamily1"));
    assertThat(dataSet.getColumnFamilies().get(0).getType(), is(ColumnType.STANDARD));
    assertThat(dataSet.getColumnFamilies().get(0).getKeyType().getTypeName(),
        is(ComparatorType.BYTESTYPE.getTypeName()));
    assertThat(dataSet.getColumnFamilies().get(0).getComparatorType().getTypeName(),
        is(ComparatorType.BYTESTYPE.getTypeName()));
    assertThat(dataSet.getColumnFamilies().get(0).getSubComparatorType(), nullValue());
  }
View Full Code Here

    assertThat(dataSet.getColumnFamilies().get(0).getSubComparatorType(), nullValue());
  }

  @Test(expected = ParseException.class)
  public void shouldNotGetAYamlDataSetStructureBecauseOfNull() {
    DataSet dataSet = new FileYamlDataSet(null);
    dataSet.getKeyspace();
  }
View Full Code Here

    dataSet.getKeyspace();
  }

  @Test(expected = ParseException.class)
  public void shouldNotGetAYamlDataSetStructureBecauseOfDataSetNotExist() {
    DataSet dataSet = new FileYamlDataSet("/unknown.yaml");
    dataSet.getKeyspace();
  }
View Full Code Here

  }

  @Test
  public void shouldGetAXmlDataSet() {

    DataSet dataSet = new FileXmlDataSet(super.targetDataSetPathFileName);
    assertThat(dataSet, notNullValue());
  }
View Full Code Here

  }

  @Test
  public void shouldNotGetAXmlDataSetBecauseNull() {
    try {
      DataSet dataSet = new FileXmlDataSet(null);
      fail();
    } catch (ParseException e) {
      /* nothing to do, it what we want */
    }
  }
 
View Full Code Here

  }

  @Test
  public void shouldNotGetAXmlDataSetBecauseOfFileNotFound() {
    try {
      DataSet dataSet = new FileXmlDataSet("/notfound.json");
      fail();
    } catch (ParseException e) {
      /* nothing to do, it what we want */
    }
  }
 
View Full Code Here

public class ClasspathXmlDataSetTest {

    @Test
    public void shouldGetAXmlDataSet() {

        DataSet dataSet = new ClassPathXmlDataSet("xml/dataSetDefaultValues.xml");
        assertThat(dataSet, notNullValue());
    }
View Full Code Here

    }

    @Test
    public void shouldNotGetAXmlDataSetBecauseNull() {
        try {
            DataSet dataSet = new ClassPathXmlDataSet(null);
            fail();
        } catch (ParseException e) {
            /* nothing to do, it what we want */
        }
    }
View Full Code Here

    }

    @Test
    public void shouldNotGetAXmlDataSetBecauseItNotExist() {
        try {
            DataSet dataSet = new ClassPathXmlDataSet("xml/unknownDataSet.xml");
            fail();
        } catch (ParseException e) {
            /* nothing to do, it what we want */
        }
    }
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.