Esempio n. 1
0
 @Test
 public void testChangeNameOnExistingDataSources() throws Exception {
   sm.register("file", super.getAnyNonSpatialResource());
   DataSource ds = dsf.getDataSourceFromSQL("select * from file;");
   sm.rename(ds.getName(), "sql");
   DataSource ds2 = dsf.getDataSource("sql");
   assertEquals(ds.getName(), ds2.getName());
 }
Esempio n. 2
0
  @Test
  public void testNameAndID() {
    Map<String, Object> raw = new HashMap<String, Object>();
    raw.put("id", "abcdef");
    raw.put("name", "MyDS");

    DataSource dataSource = new DataSource(raw, mock(ApiClient.class));

    assertEquals(dataSource.getId(), raw.get("id"));
    assertEquals(dataSource.getName(), raw.get("name"));
  }
Esempio n. 3
0
  @Test
  public void testRemoveDataSources() throws Exception {
    sm.register("temp", super.getAnyNonSpatialResource());

    DataSource d = dsf.getDataSource("temp");
    sm.remove(d.getName());

    try {
      dsf.getDataSource("temp");
      fail();
    } catch (NoSuchTableException e) {
    }
  }
Esempio n. 4
0
 @Test
 public void testOperationDataSourceName() throws Throwable {
   sm.register("temp", super.getAnyNonSpatialResource());
   DataSource d = dsf.getDataSourceFromSQL("select * from temp;");
   assertNotNull(dsf.getDataSource(d.getName()));
 }