private XException(ERROR error, String message, Throwable cause) {
    super(message, cause);
    this.error = error;
  }
@Test
  public void testXException() throws Exception {
    XException ex = new XException(TestERROR.TC);
    assertEquals(ex.getError(), TestERROR.TC);
    assertEquals(ex.getMessage(), "TC: {0}");
    assertNull(ex.getCause());

    ex = new XException(TestERROR.TC, "msg");
    assertEquals(ex.getError(), TestERROR.TC);
    assertEquals(ex.getMessage(), "TC: msg");
    assertNull(ex.getCause());

    Exception cause = new Exception();
    ex = new XException(TestERROR.TC, cause);
    assertEquals(ex.getError(), TestERROR.TC);
    assertEquals(ex.getMessage(), "TC: " + cause.toString());
    assertEquals(ex.getCause(), cause);

    XException xcause = ex;
    ex = new XException(xcause);
    assertEquals(ex.getError(), TestERROR.TC);
    assertEquals(ex.getMessage(), xcause.getMessage());
    assertEquals(ex.getCause(), xcause);
  }