Ejemplo n.º 1
0
  /**
   * single record.
   *
   * @throws Exception if occur
   */
  @Test
  public void single() throws Exception {
    context.put("provider", "provider");

    Simple simple = new Simple();
    simple.number = 100;
    simple.text = "Hello, world!";
    insert(simple, SIMPLE, "SIMPLE");

    TableSourceProvider provider = new TableSourceProvider();
    DataModelSource source =
        provider.open(SIMPLE, new URI("bulkloader:provider:SIMPLE"), new TestContext.Empty());

    try {
      assertThat(next(source), is(simple));
      assertThat(next(source), is(nullValue()));
    } finally {
      source.close();
    }
  }
 private DataModelReflection datetime(Calendar dateTime) {
   Simple simple = new Simple();
   simple.datetimeValue = dateTime;
   return SIMPLE.toReflection(simple);
 }
 private DataModelReflection num(Integer number, double value) {
   Simple simple = new Simple();
   simple.number = number;
   simple.doubleValue = value;
   return SIMPLE.toReflection(simple);
 }
 private DataModelReflection obj(Integer number, String text) {
   Simple simple = new Simple();
   simple.number = number;
   simple.text = text;
   return SIMPLE.toReflection(simple);
 }