Esempio n. 1
0
 @Test
 public void testConstructor() {
   Assert.assertEquals(schema, schemaName.getSchema());
   Assert.assertNull(schemaName.getTable());
   Assert.assertNull(schemaName.getColumn());
   Assert.assertEquals(DBName, schemaName.getDBName());
   Assert.assertEquals(SPARQLName, schemaName.getSPARQLName());
   Assert.assertEquals(schema, schemaName.getShortName());
 }
Esempio n. 2
0
 @Test
 public void testSchemaFromSchema() {
   schemaName = new SchemaName(schemaName);
   Assert.assertEquals(schema, schemaName.getSchema());
   Assert.assertNull(schemaName.getTable());
   Assert.assertNull(schemaName.getColumn());
   Assert.assertEquals(DBName, schemaName.getDBName());
   Assert.assertEquals(SPARQLName, schemaName.getSPARQLName());
   Assert.assertEquals(schema, schemaName.getShortName());
 }
Esempio n. 3
0
  @Test
  public void testSchemaWithSegments() {
    final boolean tf[] = {true, false};

    NameSegments segments = null;
    for (final boolean schemaFlg : tf) {

      for (final boolean tableFlg : tf) {

        for (final boolean columnFlg : tf) {
          segments = NameSegments.getInstance(false, schemaFlg, tableFlg, columnFlg);

          final SchemaName result = new SchemaName(schemaName, segments);
          assertEquals(
              "Bad schema: " + segments.toString(),
              schema,
              result.getSchema()); // always returns the schema
          assertNull("Bad table: " + segments.toString(), result.getTable());
          assertNull("Bad column: " + segments.toString(), result.getColumn());
        }
      }
    }
  }