コード例 #1
0
  @Test
  public void testGetColumnMapping() {
    String[] columnMapping = strat.getColumnMapping();
    assertNotNull(columnMapping);
    assertEquals(0, columnMapping.length);

    String[] columns = new String[] {"name", "orderNumber", "id"};
    strat.setColumnMapping(columns);

    columnMapping = strat.getColumnMapping();
    assertNotNull(columnMapping);
    assertEquals(3, columnMapping.length);
    assertArrayEquals(columns, columnMapping);
  }
コード例 #2
0
  @Test
  public void getColumnNamesWhenEmptyMapping() {
    strat.setColumnMapping();

    assertEquals(null, strat.getColumnName(0));
    assertArrayEquals(new String[0], strat.getColumnMapping());
  }
コード例 #3
0
  @Test
  public void getColumnNamesWhenNullArray() {
    strat.setColumnMapping((String[]) null);

    assertEquals(null, strat.getColumnName(0));
    assertEquals(null, strat.getColumnName(1));
    assertArrayEquals(new String[0], strat.getColumnMapping());
  }
コード例 #4
0
  @Test
  public void getColumnNamesWhenNullColumnName() {
    String[] columns = {null};
    strat.setColumnMapping(columns);

    assertEquals(null, strat.getColumnName(0));
    assertEquals(null, strat.getColumnName(1));
    assertArrayEquals(columns, strat.getColumnMapping());
  }
コード例 #5
0
  @Test
  public void testGetColumnNamesArray() {

    strat.setColumnMapping("name", null, "id");
    String[] mapping = strat.getColumnMapping();

    assertEquals(3, mapping.length);
    assertEquals("name", mapping[0]);
    assertEquals(null, mapping[1]);
    assertEquals("id", mapping[2]);
  }