Package co.nubetech.crux.model

Examples of co.nubetech.crux.model.ConnectionProperty


    userDAO.session = com.googlecode.s2hibernate.struts2.plugin.util.HibernateSessionFactory
        .getNewSession();
    datastoreDAO.session = com.googlecode.s2hibernate.struts2.plugin.util.HibernateSessionFactory
        .getNewSession();

    ConnectionProperty property = new ConnectionProperty();
    Datastore datastore = new Datastore();
    User user = new User();
    Connection connection = new Connection();

    property.setProperty(CruxConstants.HBASE_ZOOKEEPER_PROPERTY);
    property.setValue("testHostValue");

    connection.addProperty(property);
    user = userDAO.findById(CruxConstants.DEFAULT_USER_ID);
    connection.setUser(user);
    datastore = datastoreDAO.findById(1l);
View Full Code Here


    DatastoreDAO datastoreDAO = new DatastoreDAO();
    datastoreDAO.session = session;
    datastoreDAO.transaction = datastoreDAO.session.getTransaction();
    connection.setDatastore(datastoreDAO.findById(1l));
    connection.setName(null);
    ConnectionProperty connectionProperty = new ConnectionProperty();
    connectionProperty.setProperty("hbase.rest");
    connectionProperty.setValue("localhost");
    connection.addProperty(connectionProperty);

    connectionDAO.session = session;
    connectionDAO.transaction = connectionDAO.session.getTransaction();
    try {
View Full Code Here

    ConnectionDAO connectionDAO = new ConnectionDAO();
    try {
    connectionDAO.session = com.googlecode.s2hibernate.struts2.plugin.util.HibernateSessionFactory
        .getNewSession();
    Connection connection = connectionDAO.findById(99999l);
    ConnectionProperty connectionProperty = connection.getProperties().get(
        "propertyTest");
    assertEquals(connectionProperty.getValue(), "valueTest");

    connectionProperty.setValue("updateValueTest");

    connectionDAO.transaction = connectionDAO.session.getTransaction();
    // connectionDAO.transaction.begin();
    connectionDAO.save(connection);
    // connectionDAO.transaction.commit();
View Full Code Here

    ConnectionDAO connectionDAO = new ConnectionDAO();
    try {
    connectionDAO.session = com.googlecode.s2hibernate.struts2.plugin.util.HibernateSessionFactory
        .getNewSession();
    Connection connection = connectionDAO.findById(99999l);
    ConnectionProperty connectionProperty = connection.getProperties().get(
        "propertyTest");
    assertEquals(connectionProperty.getValue(), "valueTest");

    connectionProperty.setValue("updateValueTest");

    connectionDAO.transaction = connectionDAO.session.getTransaction();
    // connectionDAO.transaction.begin();
    connectionDAO.save(connection);
    // connectionDAO.transaction.commit();
View Full Code Here

        .getNewSession();

    Connection connection = connectionDAO.findById(99999l);
    connection.setName("updateConnection");

    ConnectionProperty connectionProperty = connection.getProperties().get(
        "propertyTest");
    assertEquals(connectionProperty.getValue(), "valueTest");

    connectionProperty.setValue("updateValueTest");

    connectionDAO.transaction = connectionDAO.session.getTransaction();
    // connectionDAO.transaction.begin();
    connectionDAO.save(connection);
    // connectionDAO.transaction.commit();
View Full Code Here

    assertEquals(resultConn.getName(), "connectionTest");
    assertEquals(resultConn.getDatastore().getId(), 1l);
    assertEquals(resultConn.getUser().getId(), 1l);

    Map<String, ConnectionProperty> properties = resultConn.getProperties();
    ConnectionProperty connPorperty = properties.get("propertyTest");

    assertEquals(connPorperty.getId(), 99999l);
    assertEquals(connPorperty.getConnection().getId(), 99999l);
    assertEquals(connPorperty.getProperty(), "propertyTest");
    assertEquals(connPorperty.getValue(), "valueTest");
    } finally{
    stmt.executeUpdate("delete from connectionProperty where id=" + 99999);
    stmt.executeUpdate("delete from connection where id=" + 99999);
    connectionDAO.session.close();
    stmt.close();
View Full Code Here

    }
   
    KeyedPoolableObjectFactory factory = PoolUtils
        .synchronizedPoolableFactory(new HBaseConnectionPoolFactory());
    connection = new Connection();
    ConnectionProperty connectionProperty = new ConnectionProperty();
    connectionProperty.setProperty(CruxConstants.HBASE_ZOOKEEPER_PROPERTY);
    logger.debug("Port is: " + TEST_UTIL.getConfiguration().get("hbase.zookeeper.property.clientPort"));
    connectionProperty.setValue("localhost:"
        + TEST_UTIL.getConfiguration().get("hbase.zookeeper.property.clientPort"));
    connection.addProperty(connectionProperty);
    pool = new HBaseConnectionPool(factory);
  }
View Full Code Here

 
  public void testIsValidConnectionForWrongValue() throws IOException {
    HBaseFacade hbaseFacade = new HBaseFacade(pool);
    Connection connection = new Connection();
    ConnectionProperty property = new ConnectionProperty();
    property.setProperty(CruxConstants.HBASE_ZOOKEEPER_PROPERTY);
    property.setValue("localhost:0000");
    connection.addProperty(property);
    boolean connectionAvailable = hbaseFacade.isValidConnection(connection);
    assertFalse(connectionAvailable);
  }
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.