コード例 #1
0
  /* simple test of getDataSource() which assumes addDataSource() works. */
  public void testGetDataSource() {
    SPDataSource dbcs = new JDBCDataSource(target);
    dbcs.setName("cows");
    target.addDataSource(dbcs);

    SPDataSource gotDbcs = target.getDataSource("cows");
    assertNotNull(gotDbcs);
    assertSame(dbcs, gotDbcs);
  }
コード例 #2
0
 public void testHookUpDataSourceToParentType() throws Exception {
   testRead();
   JDBCDataSource ds = target.getDataSource(FUN_DATASOURCE_NAME, JDBCDataSource.class);
   assertNotNull(ds);
   assertNotNull(ds.getParentType());
 }
コード例 #3
0
 /*
  * Test method for 'ca.sqlpower.architect.PlDotIni.getConnections()'
  */
 public void testGetConnections() throws IOException {
   testRead();
   List l = target.getConnections();
   assertEquals(1, l.size());
   assertEquals(target.getDataSource(FUN_DATASOURCE_NAME), l.get(0));
 }
コード例 #4
0
 /*
  * Ensures the read() method reads data sources properly,
  * assuming getDataSource() works properly
  */
 public void testReadDataSource() throws IOException {
   testRead();
   SPDataSource ds = target.getDataSource(FUN_DATASOURCE_NAME);
   assertNotNull(ds);
 }