Package org.cassandraunit

Examples of org.cassandraunit.DataLoader.load()


          datasetIterator = dataset.listIterator();
          DataLoader dataLoader = new DataLoader(clusterName, host + ":" + port);
          while (datasetIterator.hasNext()) {
            String next = datasetIterator.next();
            boolean dropAndCreateKeyspace = datasetIterator.previousIndex() == 0;
            dataLoader.load(new ClassPathDataSet(next), dropAndCreateKeyspace);
          }
      }
    }

  }
View Full Code Here


  @Before
  public void before() throws Exception {
    EmbeddedCassandraServerHelper.startEmbeddedCassandra();
    DataLoader dataLoader = new DataLoader("TestCluster", "localhost:9171");
    dataLoader.load(new ClassPathYamlDataSet("integration/emptyDataSetWithReversedComparatorOnSimpleType.yaml"));
  }

  @Test
  public void writeAndReadFromCfCreatedUsingCassandraUnit() {
    final Cluster cluster = HFactory.getOrCreateCluster("TestCluster", new CassandraHostConfigurator("localhost:9170"));
View Full Code Here

  @Before
  public void before() throws Exception {
    EmbeddedCassandraServerHelper.startEmbeddedCassandra();
    DataLoader dataLoader = new DataLoader("TestCluster", "localhost:9171");
    dataLoader.load(new ClassPathYamlDataSet("integration/emptyDataSetWithReversedComparatorOnCompositeTypes.yaml"));
  }

  @Test
  public void writeAndReadFromCfCreatedUsingCassandraUnit() {
    final Cluster cluster = HFactory.getOrCreateCluster("TestCluster", new CassandraHostConfigurator("localhost:9170"));
View Full Code Here

            loadingOption.setStrategy(StrategyModel.fromValue(commandLine.getOptionValue("s")));
        }

        DataLoader dataLoader = new DataLoader("clusterToLoad", host + ":" + port);
        dataLoader.load(new FileDataSet(file), loadingOption);
    }

    private static void cqlDataSetLoad(String host, String port, String file) {
        Cluster cluster = new Cluster.Builder().addContactPoints(host).withPort(Integer.parseInt(port)).build();
        Session session = cluster.connect();
View Full Code Here

                EmbeddedCassandraServerHelper.startEmbeddedCassandra();
                // create structure and load data
                String clusterName = "Tatami cluster";
                String host = "localhost:9171";
                DataLoader dataLoader = new DataLoader(clusterName, host);
                dataLoader.load(new ClassPathJsonDataSet("dataset/dataset.json"));

                final ImmutableSettings.Builder builder = ImmutableSettings.settingsBuilder();
                builder.put("cluster.name", clusterName);

                final Node node = NodeBuilder.nodeBuilder().settings(builder.build()).local(true).node();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.