tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r738623 - /openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/rules/ValidationAssertions.java
Date Wed, 28 Jan 2009 21:09:04 GMT
Author: dblevins
Date: Wed Jan 28 21:09:03 2009
New Revision: 738623

URL: http://svn.apache.org/viewvc?rev=738623&view=rev
Log:
Cleaned up a bit

Modified:
    openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/rules/ValidationAssertions.java

Modified: openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/rules/ValidationAssertions.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/rules/ValidationAssertions.java?rev=738623&r1=738622&r2=738623&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/rules/ValidationAssertions.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/rules/ValidationAssertions.java
Wed Jan 28 21:09:03 2009
@@ -18,7 +18,6 @@
 
 import org.apache.openejb.config.ValidationFailedException;
 import org.apache.openejb.config.ValidationException;
-import org.apache.openejb.config.ValidationFailure;
 
 import java.util.List;
 import java.util.ArrayList;
@@ -33,21 +32,21 @@
 public class ValidationAssertions {
 
     public static void assertFailures(List<String> expectedKeys, ValidationFailedException
e) {
-        assertValidation(expectedKeys, e, e.getFailures());
+        assertValidation(expectedKeys, e.getFailures());
     }
 
     public static void assertErrors(List<String> expectedKeys, ValidationFailedException
e) {
-        assertValidation(expectedKeys, e, e.getErrors());
+        assertValidation(expectedKeys, e.getErrors());
     }
 
     public static void assertWarnings(List<String> expectedKeys, ValidationFailedException
e) {
-        assertValidation(expectedKeys, e, e.getWarnings());
+        assertValidation(expectedKeys, e.getWarnings());
     }
 
-    private static void assertValidation(List<String> expectedKeys, ValidationFailedException
e, ValidationException[] failures) {
+    private static void assertValidation(List<String> expectedKeys, ValidationException[]
validations) {
         List<String> actualKeys = new ArrayList<String>();
-        for (ValidationException failure : failures) {
-            actualKeys.add(failure.getMessageKey());
+        for (ValidationException validation : validations) {
+            actualKeys.add(validation.getMessageKey());
         }
 
         Collections.sort(expectedKeys);
@@ -68,11 +67,11 @@
 
         // Ensure the i18n message is there by checking
         // the key is not in the getMessage() output
-        for (ValidationFailure failure : e.getFailures()) {
-            String key = failure.getMessageKey();
+        for (ValidationException validation : validations) {
+            String key = validation.getMessageKey();
 
             for (Integer level : Arrays.asList(1, 2, 3)) {
-                String message = failure.getMessage(level);
+                String message = validation.getMessage(level);
                 Assert.assertFalse("No message text (key=" + key + ", level=" + level + "):
" + message, message.contains(key));
                 Assert.assertFalse("Not all parameters substituted (key=" + key + ", level="
+ level + "): " + message, message.matches(".*\\{[0-9]\\}.*"));
             }



Mime
View raw message