Package co.nubetech.crux.model

Examples of co.nubetech.crux.model.ConnectionProperty


  @Test
  public void testMakeObject() {

    Connection connection = new Connection();

    ConnectionProperty property = new ConnectionProperty();
    property.setProperty(CruxConstants.HBASE_ZOOKEEPER_PROPERTY);
    property.setValue("h1:2181");
    connection.addProperty(property);

    HBaseConnectionPoolFactory hbaseConnectionPoolFactory = new HBaseConnectionPoolFactory();
    HTablePool htablePool = (HTablePool) hbaseConnectionPoolFactory
        .makeObject(connection);
View Full Code Here


  @Test
  public void testSave() throws Exception {
    Connection connection = new Connection();
    connection.setName("HbaseConn1");
    ConnectionProperty connectionProperty = new ConnectionProperty();
    connectionProperty.setProperty(CruxConstants.HBASE_ZOOKEEPER_PROPERTY);
    connectionProperty.setValue("h1:2181,h2:8080");
    connection.addProperty(connectionProperty);

    HBaseConnectionPool pool = new HBaseConnectionPool(
        new HBaseConnectionPoolFactory());
View Full Code Here

  @Test
  public void testGetCluster() {
    Connection connection = new Connection();

    ConnectionProperty restProperty = new ConnectionProperty();
    restProperty.setProperty(CruxConstants.HBASE_ZOOKEEPER_PROPERTY);
    restProperty.setValue("h1:8080,h2:8080");
    connection.addProperty(restProperty);

    HBaseConnectionPoolFactory hbaseConnectionPoolFactory = new HBaseConnectionPoolFactory();
    Cluster cluster = hbaseConnectionPoolFactory.getCluster(connection);
    assertEquals(cluster.isEmpty(), false); // Cluster is not empty.
View Full Code Here

  @Test
  public void testMakeObject() {

    Connection connection = new Connection();

    ConnectionProperty restProperty = new ConnectionProperty();
    restProperty.setProperty(CruxConstants.HBASE_ZOOKEEPER_PROPERTY);
    restProperty.setValue("h1:8080,h2:8080");
    connection.addProperty(restProperty);

    HBaseConnectionPoolFactory hbaseConnectionPoolFactory = new HBaseConnectionPoolFactory();
    Client client = (Client) hbaseConnectionPoolFactory
        .makeObject(connection);
View Full Code Here

  public Session session;
  @TransactionTarget
  public Transaction transaction;

  public ConnectionProperty findById(Long id) {
    ConnectionProperty connectionProperty = (ConnectionProperty) session
        .get(ConnectionProperty.class, id);
    return connectionProperty;
  }
View Full Code Here

    datastore.setId(121212);
    datastore.setName("Hbase");
   
    //connection 1
    Connection connection1 = new Connection();
    ConnectionProperty connectionProperty1 = new ConnectionProperty(connection1, CruxConstants.HBASE_ZOOKEEPER_PROPERTY,"value1");
    ConnectionProperty connectionProperty2 = new ConnectionProperty(connection1, CruxConstants.HBASE_ZOOKEEPER_PROPERTY,"value2");
   
    connection1.addProperty(connectionProperty1);
    connection1.addProperty(connectionProperty2);
    connection1.setDatastore(datastore);
    connection1.setUser(user);
    connection1.setId(1);
    connection1.setName("ConnectionName1");       
   
    //connection 2
    Connection connection2 = new Connection();
    ConnectionProperty connectionProperty3 = new ConnectionProperty(connection2, CruxConstants.HBASE_ZOOKEEPER_PROPERTY, "value1");
    ConnectionProperty connectionProperty4 = new ConnectionProperty(connection2, CruxConstants.HBASE_ZOOKEEPER_PROPERTY, "value2");
   
    connection2.addProperty(connectionProperty3);
    connection2.addProperty(connectionProperty4);
    connection2.setDatastore(datastore);
    connection2.setUser(user);
    connection2.setId(2);
    connection2.setName("ConnectionName2");
   
    //connection 3
    Connection connection3 = new Connection();
    ConnectionProperty connectionProperty5 = new ConnectionProperty(connection3, CruxConstants.HBASE_ZOOKEEPER_PROPERTY, "value1");
    ConnectionProperty connectionProperty6 = new ConnectionProperty(connection3, CruxConstants.HBASE_ZOOKEEPER_PROPERTY, "value2");
   
    connection3.addProperty(connectionProperty5);
    connection3.addProperty(connectionProperty6);
    connection3.setDatastore(datastore);
    connection3.setUser(user);
View Full Code Here

    datastore.setId(121212);
    datastore.setName("Hbase");
   
    //connection
    Connection connection = new Connection();
    ConnectionProperty connectionProperty = new ConnectionProperty(connection, CruxConstants.HBASE_ZOOKEEPER_PROPERTY,"value1");
   
    connection.addProperty(connectionProperty);
    connection.setDatastore(datastore);
    connection.setUser(user);
    connection.setId(1);
View Full Code Here

        .getServletContext();
    HBaseConnectionPool pool = (HBaseConnectionPool) servletContext
        .getAttribute(CruxConstants.HBASE_POOL);

    Connection connectionToTest = new Connection();
    ConnectionProperty property = new ConnectionProperty();
    property.setProperty(CruxConstants.HBASE_ZOOKEEPER_PROPERTY);
    property.setValue(hbaseRestServerPropertyValue);
    connectionToTest.addProperty(property);

    try {
      HBaseFacade hbaseFacade = getHBaseFacade();
      boolean isValidConnection = hbaseFacade
View Full Code Here

    datastore.setId(121212);
    datastore.setName("Hbase");

    //connection
    Connection connection = new Connection();
    ConnectionProperty connectionProperty1 = new ConnectionProperty(connection, CruxConstants.HBASE_ZOOKEEPER_PROPERTY,"value1");
    ConnectionProperty connectionProperty2 = new ConnectionProperty(connection, CruxConstants.HBASE_ZOOKEEPER_PROPERTY,"value2");
    connection.addProperty(connectionProperty1);
    connection.addProperty(connectionProperty2);
    connection.setDatastore(datastore);
    connection.setUser(user);
    connection.setId(1);
View Full Code Here

    }
  }

  @Test
  public void testAddProperty() {
    ConnectionProperty property = new ConnectionProperty();
    Connection connection = new Connection();

    property.setProperty(CruxConstants.HBASE_ZOOKEEPER_PROPERTY);
    property.setValue("testHostValue");
    connection.addProperty(property);
    connection.setName("testConnection");

    assertEquals(property.getConnection().getName(), "testConnection");
    assertEquals(
        connection.getProperties()
            .get(CruxConstants.HBASE_ZOOKEEPER_PROPERTY).getValue(),
        "testHostValue");
View Full Code Here

TOP

Related Classes of co.nubetech.crux.model.ConnectionProperty

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.