Exemplo n.º 1
0
  @Test
  public void test_faultcode_messageargs_constructor() {
    IFaultCode expectedFaultCode = ExampleFaultCode.ACCESS_DENIED;

    UncheckedException e = new UncheckedException(expectedFaultCode, "sangeeth");

    Fault expectedFault = Fault.valueOf(expectedFaultCode, "sangeeth");

    AssertEx.assertException(
        null,
        expectedFault,
        expectedFaultCode,
        Locale.getDefault(), // expectedLocale
        expectedFault.getSummary(), // expectedMessage
        Severity.SEVERE, // expectedSeverity
        e); // actualException
  }
Exemplo n.º 2
0
  @Test
  public void test_cause_faultcode_severity_messageargs_constructor() {
    IFaultCode expectedFaultCode = ExampleFaultCode.ACCESS_DENIED;
    IllegalArgumentException expectedCause = new IllegalArgumentException();
    ISeverity expectedSeverity = CustomSeverity.DISASTER;
    UncheckedException e =
        new UncheckedException(expectedCause, expectedFaultCode, expectedSeverity, "sangeeth");

    Fault expectedFault = Fault.valueOf(expectedFaultCode, "sangeeth");

    AssertEx.assertException(
        expectedCause,
        expectedFault,
        expectedFaultCode,
        Locale.getDefault(), // expectedLocale
        expectedFault.getSummary(), // expectedMessage
        expectedSeverity, // expectedSeverity
        e); // actualException
  }
Exemplo n.º 3
0
  @Test
  public void test_faultcode_severity_locale_messageargs_constructor() {
    IFaultCode expectedFaultCode = ExampleFaultCode.ACCESS_DENIED;

    ISeverity expectedSeverity = CustomSeverity.DISASTER;
    UncheckedException e =
        new UncheckedException(expectedFaultCode, expectedSeverity, Locale.FRENCH, "sangeeth");

    Fault expectedFault = Fault.valueOf(expectedFaultCode, Locale.FRENCH, "sangeeth");

    AssertEx.assertException(
        null,
        expectedFault,
        expectedFaultCode,
        Locale.FRENCH, // expectedLocale
        expectedFault.getSummary(), // expectedMessage
        expectedSeverity, // expectedSeverity
        e); // actualException
  }