Esempio n. 1
0
 /**
  * Accuracy test case for method 'getMessage()'.<br>
  * The method should work properly according to the use case, all the fields should be set as
  * expected.
  */
 public void testGetMessage2_Accuracy6() {
   String appCode = "TCUML";
   String moduleCode = "XMI_Writer";
   String errorCode = "1290_for_empty";
   String result = ExceptionUtils.getMessage(bundle, appCode, moduleCode, errorCode);
   String expected = "TCUML-XMI_Writer-1290_for_empty";
   assertEquals("Test accuracy for method getMessage() failed.", expected, result);
 }
Esempio n. 2
0
 /**
  * Accuracy test case for method 'getMessage()'.<br>
  * The method should work properly according to the use case, all the fields should be set as
  * expected.
  */
 public void testGetMessage2_Accuracy5() {
   String appCode = "";
   String moduleCode = "";
   String errorCode = "";
   String result = ExceptionUtils.getMessage(bundle, appCode, moduleCode, errorCode);
   String expected = "Message for empty key";
   assertEquals("Test accuracy for method getMessage() failed.", expected, result);
 }
Esempio n. 3
0
 /**
  * Accuracy test case for method checkNullOrEmpty()'.<br>
  * The method should work properly according to the use case, all the fields should be set as
  * expected.
  */
 public void testCheckNullOrEmpty_Accuracy2() {
   try {
     ExceptionUtils.checkNullOrEmpty("   ", bundle, "empty", "default message");
     fail("Test accuracy for method 'checkNull()' failed.");
   } catch (IllegalArgumentException iae) {
     assertEquals(
         "Test accuracy for method checkNullOrEmpty() failed.",
         "The argument should not be empty",
         iae.getMessage());
   }
 }
Esempio n. 4
0
 /**
  * Accuracy test case for method 'getMessage()'.<br>
  * The method should work properly according to the use case, all the fields should be set as
  * expected.
  */
 public void testGetMessage1_Accuracy4() {
   String key = "unknown_key";
   String defaultMessage = "The default message";
   String result = ExceptionUtils.getMessage(bundle, key, defaultMessage);
   assertEquals("Test accuracy for method getMessage() failed.", defaultMessage, result);
 }
Esempio n. 5
0
 /**
  * Accuracy test case for method 'getMessage()'.<br>
  * The method should work properly according to the use case, all the fields should be set as
  * expected.
  */
 public void testGetMessage1_Accuracy3() {
   String key = "author";
   String defaultMessage = "The default message";
   String result = ExceptionUtils.getMessage(bundle, key, defaultMessage);
   assertEquals("Test accuracy for method getMessage() failed.", "TCSDEVELOPER", result);
 }
Esempio n. 6
0
 /**
  * Accuracy test case for method 'getMessage()'.<br>
  * The method should work properly according to the use case, all the fields should be set as
  * expected.
  */
 public void testGetMessage1_Accuracy1() {
   String key = "author";
   String defaultMessage = "The default message";
   String result = ExceptionUtils.getMessage(null, key, defaultMessage);
   assertEquals("Test accuracy for method getMessage() failed.", defaultMessage, result);
 }
Esempio n. 7
0
 /**
  * Accuracy test case for method checkNullOrEmpty()'.<br>
  * The method should work properly according to the use case, all the fields should be set as
  * expected.
  */
 public void testCheckNullOrEmpty_Accuracy3() {
   ExceptionUtils.checkNullOrEmpty("String", bundle, "key1", "default message");
 }
Esempio n. 8
0
 /**
  * Accuracy test case for method 'checkNull()'.<br>
  * The method should work properly according to the use case, all the fields should be set as
  * expected.
  */
 public void testCheckNull_Accuracy2() {
   ExceptionUtils.checkNull(new Object(), bundle, "key1", "default message");
 }