Package de.mhus.lib.config

Examples of de.mhus.lib.config.NodeConfig


    {
        return new TestSuite( DbPoolTest.class );
    }

    public DbPoolBundle createPool() throws Exception {
      NodeConfig cdb = new NodeConfig();
      NodeConfig cconfig = new NodeConfig();
      NodeConfig ccon = new NodeConfig();
     
      boolean mysql = false;
     
      if (mysql) {
        ccon.setProperty("driver", "com.mysql.jdbc.Driver");
        ccon.setProperty("url", "jdbc:mysql://localhost:3306/test");
        ccon.setProperty("user", "test");
        ccon.setProperty("pass", "test");
      } else {
        ccon.setProperty("driver", "org.hsqldb.jdbcDriver");
        ccon.setProperty("url", "jdbc:hsqldb:mem:aname");
        ccon.setProperty("user", "sa");
        ccon.setProperty("pass", "");
      }
     
      cdb.setConfig("connection", ccon);
     
      cconfig.setConfig("test", cdb);
      DbPoolBundle pool = new DbPoolBundle(cconfig,null);
      Dialect dialect = pool.getPool("test").getDialect();
     
      NodeConfig cqueries = new NodeConfig();
      cqueries.setProperty("create", "create table test (a_text varchar(100))");
      cqueries.setProperty("select", "select * from test");
      cqueries.setProperty("cleanup", "delete from test");
      cqueries.setProperty("insert", "insert into test (a_text) values ($text,text$)");
      cqueries.setProperty("dropblub", "drop table if exists blub_");

      cqueries.setProperty("create2", "create table test2 ("+
          " a_text "   +dialect.getDbType(Dialect.TYPE.STRING.name(), "100") +
          ",a_date "   +dialect.getDbType(Dialect.TYPE.DATETIME.name(), null) +
          ",a_int "    +dialect.getDbType(Dialect.TYPE.INT.name(), null) +
          ",a_bool "   +dialect.getDbType(Dialect.TYPE.BOOL.name(), null) +
          ",a_blob "   +dialect.getDbType(Dialect.TYPE.BLOB.name(), null) +
          ",a_float "  +dialect.getDbType(Dialect.TYPE.FLOAT.name(), null) +
          ",a_double " +dialect.getDbType(Dialect.TYPE.DOUBLE.name(), null) +
          ",a_long "   +dialect.getDbType(Dialect.TYPE.LONG.name(), null) +
          ")");
      cqueries.setProperty("insert2", "insert into test2 (a_text,a_date,a_int,a_bool,a_blob,a_float,a_double,a_long) values ($text$,$date$,$int$,$bool$,$blob$,$float$,$double$,$long$)");
      cqueries.setProperty("cleanup2", "delete from test2");

      cdb.setConfig("queries", cqueries);
     
     
     
View Full Code Here


    {
        return new TestSuite( AdbTest.class );
    }

    public DbPoolBundle createPool() {
      NodeConfig cdb = new NodeConfig();
      NodeConfig cconfig = new NodeConfig();
      NodeConfig ccon = new NodeConfig();
     
//      ccon.setProperty("driver", "com.mysql.jdbc.Driver");
//      ccon.setProperty("url", "jdbc:mysql://localhost:3306/test");
//      ccon.setProperty("user", "test");
//      ccon.setProperty("pass", "test");

      ccon.setProperty("driver", "org.hsqldb.jdbcDriver");
      ccon.setProperty("url", "jdbc:hsqldb:mem:aname");
      ccon.setProperty("user", "sa");
      ccon.setProperty("pass", "");
     
     
      cdb.setConfig("connection", ccon);
     
//      NodeConfig cqueries = new NodeConfig();
View Full Code Here

  public void testDb() throws Exception {

    MSingleton.instance().getConfig().setBoolean("TRACE", true);

      NodeConfig config = new NodeConfig();
      NodeConfig cdb = new NodeConfig();
      NodeConfig ccon = new NodeConfig();
      ccon.setProperty("driver", "org.hsqldb.jdbcDriver");
      ccon.setProperty("url", "jdbc:hsqldb:mem:aname");
      ccon.setProperty("user", "sa");
      ccon.setProperty("pass", "");
      cdb.setConfig("connection", ccon);
      config.setConfig("database", cdb);
           
      XmlConfig cdef = new XmlConfig(MXml.loadXml(
      "<applications><application name='content'>"
View Full Code Here

  public void testAdb() throws Exception {

    MSingleton.instance().getConfig().setBoolean("TRACE", true);

      NodeConfig config = new NodeConfig();
      NodeConfig cdb = new NodeConfig();
      NodeConfig ccon = new NodeConfig();
      ccon.setProperty("driver", "org.hsqldb.jdbcDriver");
      ccon.setProperty("url", "jdbc:hsqldb:mem:aname");
      ccon.setProperty("user", "sa");
      ccon.setProperty("pass", "");
      cdb.setConfig("connection", ccon);
      config.setConfig("database", cdb);
           
      XmlConfig cdef = new XmlConfig(MXml.loadXml(
      "<applications><application name='content' type='adb' schema='de.mhus.lib.test.caodb.BlubSchema'>"
View Full Code Here

TOP

Related Classes of de.mhus.lib.config.NodeConfig

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.