Package fi.luomus.commons.db.connectivity

Examples of fi.luomus.commons.db.connectivity.ConnectionDescription


  public ConnectionDescription connectionDescription() throws UnsupportedOperationException {
    String driver = tryToGet(DB_DRIVER);
    String url = tryToGet(DB_URL);
    String user = tryToGet(DB_USERNAME);
    String passwd = tryToGet(DB_PASSWORD);
    return new ConnectionDescription(driver, url, user, passwd);
  }
View Full Code Here


  public ConnectionDescription connectionDescription(String systemName) throws UnsupportedOperationException {
    String driver = tryToGet(systemName + "_" + DB_DRIVER);
    String url = tryToGet(systemName + "_" + DB_URL);
    String user = tryToGet(systemName + "_" + DB_USERNAME);
    String passwd = tryToGet(systemName + "_" + DB_PASSWORD);
    return new ConnectionDescription(driver, url, user, passwd);
  }
View Full Code Here

        props.load(stream);
        String driver = props.getProperty("driver");
        String username = props.getProperty("username");
        String password = props.getProperty("password");
        String url = props.getProperty("url");
        description = new ConnectionDescription(driver, url, username, password);
        documentQueueServiceDAO = new DocumentQueueServiceDAO(description);
        resetDbs();
    }
View Full Code Here

        fail("throws some other exceptions than IllegalArgumentException");
      }
    }
   
    public void test_reading_connection_description() throws Exception {
      ConnectionDescription d = r.connectionDescription();
      assertEquals("url", d.url());
    }
View Full Code Here

   
    @Override
    protected void setUp() throws Exception {}
   
    public void test_good_parameters() {
      descr = new ConnectionDescription("driver", "url", "username", "password");
      assertEquals("driver", descr.driver());
      assertEquals("url", descr.url());
      assertEquals("username", descr.username());
      assertEquals("password", descr.password());
    }
View Full Code Here

      assertEquals("password", descr.password());
    }
   
    public void test_illegal_url() {
      try {
        descr = new ConnectionDescription("d", null, "u", "p");
        fail("Should fail to null url");
      } catch (IllegalArgumentException e) {
      }
      try {
        descr = new ConnectionDescription("d", "", "u", "p");
        fail("Should fail to empty url");
      } catch (IllegalArgumentException e) {
      }
    }
View Full Code Here

      }
    }
   
    public void test_illegal_username() {
      try {
        descr = new ConnectionDescription("d", "u", null, "p");
        fail("Should fail to null username");
      } catch (IllegalArgumentException e) {
      }
      try {
        descr = new ConnectionDescription("d", "u", "", "p");
        fail("Should fail to empty username");
      } catch (IllegalArgumentException e) {
      }
    }
View Full Code Here

      }
    }
   
    public void test_illegal_password() {
      try {
        descr = new ConnectionDescription("d", "u", "u", null);
        fail("Should fail to null password");
      } catch (IllegalArgumentException e) {
      }
      try {
        descr = new ConnectionDescription("d", "u", "u", "");
        fail("Should fail to empty password");
      } catch (IllegalArgumentException e) {
      }
    }
View Full Code Here

TOP

Related Classes of fi.luomus.commons.db.connectivity.ConnectionDescription

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.