/**
  * Test method for {@link tuwien.auto.calimero.dptxlator.DPTXlator4ByteSigned#getValue()}.
  *
  * @throws KNXFormatException
  */
 public void testGetValue() throws KNXFormatException {
   Helper.assertSimilar("0", t.getValue());
   t.setValues(new String[0]);
   Helper.assertSimilar("0", t.getValue());
   t.setValue(longs[0]);
   Helper.assertSimilar(strings[0], t.getValue());
   t.setData(dataValue2, 2);
   Helper.assertSimilar(value2, t.getValue());
   t.setData(data);
   Helper.assertSimilar(max, t.getValue());
 }
 /**
  * Test method for {@link tuwien.auto.calimero.dptxlator.DPTXlator4ByteSigned#setValue(int)}.
  *
  * @throws KNXFormatException
  */
 public void testSetValueInt() throws KNXFormatException {
   for (int i = 0; i < longs.length; i++) {
     t.setValue(longs[i]);
     assertEquals(longs[i], t.getValueSigned());
     Helper.assertSimilar(strings[i], t.getValue());
   }
 }
  /**
   * Test method for {@link tuwien.auto.calimero.dptxlator.DPTXlator#setValues(java.lang.String[])}.
   *
   * @throws KNXFormatException
   */
  public void testSetValues() throws KNXFormatException {
    t.setValues(strings);
    assertEquals(strings.length, t.getItems());
    Helper.assertSimilar(strings, t.getAllValues());

    t.setValues(new String[0]);
    assertEquals(strings.length, t.getItems());
    Helper.assertSimilar(strings, t.getAllValues());

    final String[] s = {value1};
    t.setValues(s);
    assertEquals(s.length, t.getItems());
    Helper.assertSimilar(s, t.getAllValues());

    t.setValues(new String[] {t.getValue(), t.getValue()});
  }
  /**
   * Test method for {@link tuwien.auto.calimero.dptxlator.DPTXlator#setValue(java.lang.String)}.
   *
   * @throws KNXFormatException
   */
  public void testSetValueString() throws KNXFormatException {
    t.setValue(value2);
    Helper.assertSimilar(value2, t.getValue());
    String s = t.getValue();
    t.setValue(s);
    Helper.assertSimilar(value2, t.getValue());
    assertEquals(s, t.getValue());

    t.setValue(value1);
    Helper.assertSimilar(value1, t.getValue());
    s = t.getValue();
    t.setValue(s);
    Helper.assertSimilar(value1, t.getValue());
    assertEquals(s, t.getValue());

    final long l = 0x1234567890L;
    t.setValue(l);
    Helper.assertSimilar(Long.toString(l), t.getValue());
    s = t.getValue();
    t.setValue(s);
    Helper.assertSimilar(Long.toString(l), t.getValue());
    assertEquals(s, t.getValue());

    t.setValue(-1);
    Helper.assertSimilar("-1", t.getValue());
    s = t.getValue();
    t.setValue(s);
    Helper.assertSimilar("-1", t.getValue());
    assertEquals(s, t.getValue());
  }