コード例 #1
0
  @Test
  public void testWithMultipleClientLists() {
    GlusterVolumeAdvancedDetails volDetailsEntity = new GlusterVolumeAdvancedDetails();
    volDetailsEntity.setBrickDetails(getBrickDetails(2, 2, 2));

    GlusterBrickAdvancedDetails model = GlusterBrickDetailMapper.map(volDetailsEntity, null);
    assertEquals(model.getGlusterClients().getGlusterClients().size(), 2);
    assertEquals(
        model.getMntOptions(),
        volDetailsEntity.getBrickDetails().get(0).getBrickProperties().getMntOptions());
    assertEquals(
        model.getMemoryPools().getGlusterMemoryPools().size(),
        volDetailsEntity.getBrickDetails().get(0).getMemoryStatus().getMemPools().size());
  }
コード例 #2
0
  @Test
  public void testWithNullChildObjects() {
    GlusterVolumeAdvancedDetails volDetailsEntity = new GlusterVolumeAdvancedDetails();
    volDetailsEntity.setBrickDetails(getBrickDetails(1, 0, 0));
    volDetailsEntity.getBrickDetails().get(0).setClients(null);
    volDetailsEntity.getBrickDetails().get(0).setMemoryStatus(null);

    GlusterBrickAdvancedDetails model = GlusterBrickDetailMapper.map(volDetailsEntity, null);
    assertNotNull(model);
    assertNull(model.getGlusterClients());
    assertEquals(
        model.getMntOptions(),
        volDetailsEntity.getBrickDetails().get(0).getBrickProperties().getMntOptions());
    assertNull(model.getMemoryPools());
  }