Package com.linkedin.data.schema

Examples of com.linkedin.data.schema.SchemaParser.lookupName()


    final SchemaParser parser = new SchemaParser(resolver);

    final Class<? extends RecordTemplate> testClass = ClassNameFooRecord.class;
    final String nonExistSchemaName = "Non-Existing Schema";

    final DataSchema existSchema = parser.lookupName(testClass.getName());
    assertNotNull(existSchema);
    assertTrue(existSchema instanceof RecordDataSchema);
    assertEquals(((RecordDataSchema) existSchema).getFullName(), testClass.getCanonicalName());
    assertFalse(resolver.isBadLocation(new ClassNameDataSchemaLocation(testClass.getName())));
View Full Code Here


    assertNotNull(existSchema);
    assertTrue(existSchema instanceof RecordDataSchema);
    assertEquals(((RecordDataSchema) existSchema).getFullName(), testClass.getCanonicalName());
    assertFalse(resolver.isBadLocation(new ClassNameDataSchemaLocation(testClass.getName())));

    final DataSchema nonExistSchema = parser.lookupName(nonExistSchemaName);
    assertNull(nonExistSchema);
    assertTrue(parser.errorMessage().contains(nonExistSchemaName));
    assertTrue(resolver.isBadLocation(new ClassNameDataSchemaLocation(nonExistSchemaName)));
  }
View Full Code Here

    for (String[] entry : lookups)
    {
      String name = entry[0];
      String expectFound = entry[1];
      String expected = entry[2];
      DataSchema schema = parser.lookupName(name);
      if (debug) { out.println("----" + name + "-----"); }
      String errorMessage = parser.errorMessage();
      if (debug && errorMessage.isEmpty() == false) { out.println(errorMessage); }
      if (expectFound == ERROR)
      {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.