Ejemplo n.º 1
0
 private void assertValue2Constants(IvlRealDataType data) {
   assertNotNull(data.getValue2().getLow());
   assertEquals(NullFlavor.NI, data.getValue2().getLow().getNullFlavor());
   assertNotNull(data.getValue2().getAny());
   assertEquals(NullFlavor.NI, data.getValue2().getAny().getNullFlavor());
   assertNull(data.getValue2().getNullFlavor());
   assertNull(data.getValue2().getHighClosed());
   assertNotNull(data.getValue2().getWidth());
   assertEquals(NullFlavor.NI, data.getValue2().getWidth().getNullFlavor());
 }
Ejemplo n.º 2
0
  private void assertValue3(Collection<IvlRealDataType> result, List<Integer> index) {
    assertNotNull(result);

    int counter = 1;
    for (IvlRealDataType data : result) {
      // Validate 2nd record
      if ((index == null && counter == 13) || (index != null && index.contains("13"))) {
        if (index != null) index.remove("13");

        assertNotNull(data);
        assertNotNull(data.getValue3());
        assertNull(data.getValue3().getNullFlavor());

        assertNotNull(data.getValue3().getAny());
        assertEquals(NullFlavor.NI, data.getValue3().getAny().getNullFlavor());
        assertEquals(new Double(510), data.getValue3().getHigh().getValue());
        assertEquals(Boolean.TRUE, data.getValue3().getHighClosed());
        assertEquals(new Double(2), data.getValue3().getLow().getValue());
        assertEquals(Boolean.TRUE, data.getValue3().getLowClosed());
        assertEquals(
            new Double(44), ((gov.nih.nci.iso21090.Real) data.getValue3().getWidth()).getValue());
        assertNull(data.getValue3().getWidth().getNullFlavor());

        assertNull(data.getValue3().getHigh().getNullFlavor());
        assertNull(data.getValue3().getLow().getNullFlavor());

        counter++;
        continue;
      }
      // Validate 3rd record
      else if ((index == null && counter == 14) || (index != null && index.contains("14"))) {
        if (index != null) index.remove("14");

        assertNotNull(data);
        assertNotNull(data.getValue3());
        assertNull(data.getValue3().getNullFlavor());

        assertNotNull(data.getValue3().getAny());
        assertEquals(NullFlavor.NI, data.getValue3().getAny().getNullFlavor());
        assertEquals(new Double(520), data.getValue3().getHigh().getValue());
        assertEquals(Boolean.TRUE, data.getValue3().getHighClosed());
        assertEquals(new Double(2), data.getValue3().getLow().getValue());
        assertEquals(Boolean.TRUE, data.getValue3().getLowClosed());
        assertEquals(
            new Double(44), ((gov.nih.nci.iso21090.Real) data.getValue3().getWidth()).getValue());
        assertNull(data.getValue3().getWidth().getNullFlavor());

        assertNull(data.getValue3().getHigh().getNullFlavor());
        assertNull(data.getValue3().getLow().getNullFlavor());

        counter++;
        continue;
      }
      // Validate 4th record
      else if ((index == null && counter == 15) || (index != null && index.contains("15"))) {
        if (index != null) index.remove("15");

        assertNotNull(data);
        assertNotNull(data.getValue3());
        assertNull(data.getValue3().getNullFlavor());

        assertNotNull(data.getValue3().getAny());
        assertEquals(NullFlavor.NI, data.getValue3().getAny().getNullFlavor());
        assertEquals(new Double(530), data.getValue3().getHigh().getValue());
        assertEquals(Boolean.TRUE, data.getValue3().getHighClosed());
        assertEquals(new Double(2), data.getValue3().getLow().getValue());
        assertEquals(Boolean.TRUE, data.getValue3().getLowClosed());
        assertNotNull(data.getValue3().getWidth());
        assertNull(((gov.nih.nci.iso21090.Real) data.getValue3().getWidth()).getValue());
        assertEquals(NullFlavor.NI, data.getValue3().getWidth().getNullFlavor());

        assertNull(data.getValue3().getHigh().getNullFlavor());
        assertNull(data.getValue3().getLow().getNullFlavor());

        counter++;
        continue;
      }
      // Validate 5th record
      else if ((index == null && counter == 16) || (index != null && index.contains("16"))) {
        if (index != null) index.remove("16");

        assertNotNull(data);
        assertNotNull(data.getValue3());
        assertNull(data.getValue3().getNullFlavor());

        assertNotNull(data.getValue3().getAny());
        assertEquals(NullFlavor.NI, data.getValue3().getAny().getNullFlavor());
        assertEquals(new Double(540), data.getValue3().getHigh().getValue());
        assertEquals(Boolean.TRUE, data.getValue3().getHighClosed());
        assertEquals(new Double(2), data.getValue3().getLow().getValue());
        assertEquals(Boolean.TRUE, data.getValue3().getLowClosed());
        assertEquals(
            new Double(44), ((gov.nih.nci.iso21090.Real) data.getValue3().getWidth()).getValue());
        assertNull(data.getValue3().getWidth().getNullFlavor());

        assertNull(data.getValue3().getHigh().getNullFlavor());
        assertNull(data.getValue3().getLow().getNullFlavor());

        counter++;
        continue;
      }
      // Validate 6th record
      else if ((index == null && counter == 17) || (index != null && index.contains("17"))) {
        if (index != null) index.remove("17");

        assertNotNull(data);
        assertNotNull(data.getValue3());
        assertEquals(NullFlavor.NI, data.getValue3().getNullFlavor());

        assertNull(data.getValue3().getAny());
        assertNull(data.getValue3().getHigh());
        assertNull(data.getValue3().getHighClosed());
        assertNull(data.getValue3().getLow());
        assertNull(data.getValue3().getLowClosed());
        assertNull(data.getValue3().getWidth());

        counter++;
        continue;
      }
      // Validate 2nd record
      if ((index == null && counter == 18) || (index != null && index.contains("18"))) {
        if (index != null) index.remove("18");

        assertNotNull(data);
        assertNotNull(data.getValue3());
        assertNull(data.getValue3().getNullFlavor());

        assertNotNull(data.getValue3().getAny());
        assertEquals(NullFlavor.NI, data.getValue3().getAny().getNullFlavor());
        assertEquals(new Double(610), data.getValue3().getHigh().getValue());
        assertEquals(Boolean.TRUE, data.getValue3().getHighClosed());
        assertEquals(new Double(251), data.getValue3().getLow().getValue());
        assertEquals(Boolean.TRUE, data.getValue3().getLowClosed());
        assertEquals(
            new Double(4), ((gov.nih.nci.iso21090.Real) data.getValue3().getWidth()).getValue());
        assertNull(data.getValue3().getWidth().getNullFlavor());

        assertNull(data.getValue3().getHigh().getNullFlavor());
        assertNull(data.getValue3().getLow().getNullFlavor());

        counter++;
        continue;
      }
      // Validate 3rd record
      else if ((index == null && counter == 19) || (index != null && index.contains("19"))) {
        if (index != null) index.remove("19");

        assertNotNull(data);
        assertNotNull(data.getValue3());
        assertNull(data.getValue3().getNullFlavor());

        assertNotNull(data.getValue3().getAny());
        assertEquals(NullFlavor.NI, data.getValue3().getAny().getNullFlavor());
        assertEquals(new Double(620), data.getValue3().getHigh().getValue());
        assertEquals(Boolean.TRUE, data.getValue3().getHighClosed());
        assertEquals(new Double(252), data.getValue3().getLow().getValue());
        assertEquals(Boolean.TRUE, data.getValue3().getLowClosed());
        assertEquals(
            new Double(4), ((gov.nih.nci.iso21090.Real) data.getValue3().getWidth()).getValue());
        assertNull(data.getValue3().getWidth().getNullFlavor());

        assertNull(data.getValue3().getHigh().getNullFlavor());
        assertNull(data.getValue3().getLow().getNullFlavor());

        counter++;
        continue;
      }
      // Validate 4th record
      else if ((index == null && counter == 20) || (index != null && index.contains("20"))) {
        if (index != null) index.remove("20");

        assertNotNull(data);
        assertNotNull(data.getValue3());
        assertNull(data.getValue3().getNullFlavor());

        assertNotNull(data.getValue3().getAny());
        assertEquals(NullFlavor.NI, data.getValue3().getAny().getNullFlavor());
        assertEquals(new Double(630), data.getValue3().getHigh().getValue());
        assertEquals(Boolean.TRUE, data.getValue3().getHighClosed());
        assertEquals(new Double(253), data.getValue3().getLow().getValue());
        assertEquals(Boolean.TRUE, data.getValue3().getLowClosed());
        assertEquals(
            new Double(4), ((gov.nih.nci.iso21090.Real) data.getValue3().getWidth()).getValue());
        assertNull(data.getValue3().getWidth().getNullFlavor());

        assertNull(data.getValue3().getHigh().getNullFlavor());
        assertNull(data.getValue3().getLow().getNullFlavor());

        counter++;
        continue;
      }
      // Validate 5th record
      else if ((index == null && counter == 21) || (index != null && index.contains("21"))) {
        if (index != null) index.remove("21");

        assertNotNull(data);
        assertNotNull(data.getValue3());
        assertNull(data.getValue3().getNullFlavor());

        assertNotNull(data.getValue3().getAny());
        assertEquals(NullFlavor.NI, data.getValue3().getAny().getNullFlavor());
        assertEquals(new Double(640), data.getValue3().getHigh().getValue());
        assertEquals(Boolean.TRUE, data.getValue3().getHighClosed());
        assertEquals(new Double(254), data.getValue3().getLow().getValue());
        assertEquals(Boolean.TRUE, data.getValue3().getLowClosed());
        assertEquals(
            new Double(4), ((gov.nih.nci.iso21090.Real) data.getValue3().getWidth()).getValue());
        assertNull(data.getValue3().getWidth().getNullFlavor());

        assertNull(data.getValue3().getHigh().getNullFlavor());
        assertNull(data.getValue3().getLow().getNullFlavor());

        counter++;
        continue;
      }
      // Validate 6th record
      else if ((index == null && counter == 22) || (index != null && index.contains("22"))) {
        if (index != null) index.remove("22");

        assertNotNull(data);
        assertNotNull(data.getValue3());
        assertNull(data.getValue3().getNullFlavor());

        assertEquals(new Double(101), data.getValue3().getAny().getValue());
        assertEquals(new Double(650), data.getValue3().getHigh().getValue());
        assertEquals(Boolean.TRUE, data.getValue3().getHighClosed());
        assertEquals(new Double(255), data.getValue3().getLow().getValue());
        assertEquals(Boolean.TRUE, data.getValue3().getLowClosed());
        assertEquals(
            new Double(4), ((gov.nih.nci.iso21090.Real) data.getValue3().getWidth()).getValue());

        assertNull(data.getValue3().getWidth().getNullFlavor());

        assertNull(data.getValue3().getHigh().getNullFlavor());
        assertNull(data.getValue3().getLow().getNullFlavor());

        counter++;
        continue;
      }
      // Validate all remaining records
      else {
        assertNotNull(data);
        assertNotNull(data.getValue3());
        assertNotNull(data.getValue3().getNullFlavor());
        // assertEquals(NullFlavor.NI, data.getValue3().getHigh().getNullFlavor());
        // assertEquals(NullFlavor.NI, data.getValue3().getLow().getNullFlavor());

        counter++;
      }
    }
  }
Ejemplo n.º 3
0
  private void assertValue2(Collection<IvlRealDataType> result, List<Integer> index) {
    assertNotNull(result);

    int counter = 1;
    for (IvlRealDataType data : result) {
      // Validate 2nd record
      if ((index == null && counter == 7) || (index != null && index.contains("7"))) {
        if (index != null) index.remove("7");

        assertNotNull(data);
        assertNotNull(data.getValue2());

        assertEquals(new Double(-310), data.getValue2().getHigh().getValue());
        assertNull(data.getValue2().getLowClosed());
        assertValue2Constants(data);

        counter++;
        continue;
      }
      // Validate 3rd record
      else if ((index == null && counter == 8) || (index != null && index.contains("8"))) {
        if (index != null) index.remove("8");

        assertNotNull(data);
        assertNotNull(data.getValue2());

        assertEquals(new Double(40), data.getValue2().getHigh().getValue());
        assertEquals(Boolean.TRUE, data.getValue2().getLowClosed());
        assertValue2Constants(data);

        counter++;
        continue;
      }
      // Validate 4th record
      else if ((index == null && counter == 9) || (index != null && index.contains("9"))) {
        if (index != null) index.remove("9");

        assertNotNull(data);
        assertNotNull(data.getValue2());

        assertNull(data.getValue2().getHigh().getValue());
        assertEquals(NullFlavor.NI, data.getValue2().getHigh().getNullFlavor());
        assertEquals(Boolean.TRUE, data.getValue2().getLowClosed());
        assertValue2Constants(data);

        counter++;
        continue;
      }
      // Validate 5th record
      else if ((index == null && counter == 10) || (index != null && index.contains("10"))) {
        if (index != null) index.remove("10");

        assertNotNull(data);
        assertNotNull(data.getValue2());

        assertEquals(new Double(4222222), data.getValue2().getHigh().getValue());
        assertEquals(Boolean.TRUE, data.getValue2().getLowClosed());
        assertValue2Constants(data);

        counter++;
        continue;
      }
      // Validate 6th record
      else if ((index == null && counter == 11) || (index != null && index.contains("11"))) {
        if (index != null) index.remove("11");

        assertNotNull(data);
        assertNotNull(data.getValue2());

        assertEquals(new Double(43), data.getValue2().getHigh().getValue());
        assertEquals(Boolean.FALSE, data.getValue2().getLowClosed());
        assertValue2Constants(data);

        counter++;
        continue;
      }
      // Validate 6th record
      else if ((index == null && counter == 12) || (index != null && index.contains("12"))) {
        if (index != null) index.remove("12");

        assertNotNull(data);
        assertNotNull(data.getValue2());

        assertEquals(new Double(44), data.getValue2().getHigh().getValue());
        assertEquals(Boolean.FALSE, data.getValue2().getLowClosed());
        assertValue2Constants(data);

        counter++;
        continue;
      }
      // Validate all remaining records
      else {
        assertNotNull(data);
        assertNotNull(data.getValue2());
        // Global constant
        assertEquals(NullFlavor.NI, data.getValue2().getNullFlavor());
        assertNull(data.getValue2().getHigh());
        assertNull(data.getValue2().getLowClosed());
        counter++;
      }
    }
  }
Ejemplo n.º 4
0
  private void assertValue1(Collection<IvlRealDataType> result, List<Integer> index) {
    assertNotNull(result);

    int counter = 1;
    for (IvlRealDataType data : result) {
      // Validate 2nd record
      if ((index == null && counter == 2) || (index != null && index.contains("2"))) {
        if (index != null) index.remove("2");

        assertNotNull(data);
        assertNotNull(data.getValue1());

        assertNull(data.getValue1().getNullFlavor());
        assertEquals(new Double(10.1), data.getValue1().getLow().getValue());
        assertEquals(NullFlavor.NI, data.getValue1().getHigh().getNullFlavor());
        assertNull(data.getValue1().getHigh().getValue());
        assertValue1Constants(data);

        counter++;
        continue;
      }
      // Validate 3rd record
      else if ((index == null && counter == 3) || (index != null && index.contains("3"))) {
        if (index != null) index.remove("3");

        assertNotNull(data);
        assertNotNull(data.getValue1());

        assertEquals(new Double(1), data.getValue1().getLow().getValue());
        assertEquals(new Double(210.2), data.getValue1().getHigh().getValue());
        assertTrue(
            data.getValue1().getHigh().getValue().compareTo(data.getValue1().getLow().getValue())
                > 0);
        assertValue1Constants(data);

        counter++;
        continue;
      }
      // Validate 4th record
      else if ((index == null && counter == 4) || (index != null && index.contains("4"))) {
        if (index != null) index.remove("4");

        assertNotNull(data);
        assertNotNull(data.getValue1());

        assertEquals(new Double(220.2), data.getValue1().getHigh().getValue());
        assertNull(data.getValue1().getLow().getValue());
        assertEquals(NullFlavor.NI, data.getValue1().getLow().getNullFlavor());
        assertValue1Constants(data);

        counter++;
        continue;
      }
      // Validate 5th record
      else if ((index == null && counter == 5) || (index != null && index.contains("5"))) {
        if (index != null) index.remove("5");

        assertNotNull(data);
        assertNotNull(data.getValue1());

        assertEquals(new Double(3), data.getValue1().getLow().getValue());
        assertEquals(new Double(230.2), data.getValue1().getHigh().getValue());
        assertValue1Constants(data);

        counter++;
        continue;
      }
      // Validate 6th record
      else if ((index == null && counter == 6) || (index != null && index.contains("6"))) {
        if (index != null) index.remove("6");

        assertNotNull(data);
        assertNotNull(data.getValue1());

        assertEquals(new Double(3), data.getValue1().getHigh().getValue());
        assertEquals(new Double(230.2), data.getValue1().getLow().getValue());
        assertFalse(
            data.getValue1().getHigh().getValue().compareTo(data.getValue1().getLow().getValue())
                > 0);
        assertValue1Constants(data);

        counter++;
        continue;
      }
      // Validate all remaining records
      else {
        assertNotNull(data);
        assertNotNull(data.getValue1());
        // Global constant
        assertEquals(NullFlavor.NI, data.getValue1().getNullFlavor());
        assertNull(data.getValue1().getLow());
        assertNull(data.getValue1().getHigh());
        counter++;
      }
    }
  }