diff options
Diffstat (limited to 'branches/sca-equinox/itest/validation/src/test/java/policy/xml')
7 files changed, 19 insertions, 17 deletions
diff --git a/branches/sca-equinox/itest/validation/src/test/java/policy/xml/AlwaysProvidedIntentNotFoundTestCase.java b/branches/sca-equinox/itest/validation/src/test/java/policy/xml/AlwaysProvidedIntentNotFoundTestCase.java index 361e2f2bfb..2d4bb3d499 100644 --- a/branches/sca-equinox/itest/validation/src/test/java/policy/xml/AlwaysProvidedIntentNotFoundTestCase.java +++ b/branches/sca-equinox/itest/validation/src/test/java/policy/xml/AlwaysProvidedIntentNotFoundTestCase.java @@ -22,7 +22,6 @@ import junit.framework.TestCase; import org.apache.tuscany.sca.monitor.Monitor; import org.apache.tuscany.sca.monitor.Problem; -import org.apache.tuscany.sca.monitor.logging.impl.DefaultLoggingMonitorImpl; import domain.CustomCompositeBuilder; @@ -52,7 +51,7 @@ public class AlwaysProvidedIntentNotFoundTestCase extends TestCase { public void testCalculator() { Monitor monitor = customDomain.getMonitorInstance(); - Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + Problem problem = monitor.getLastProblem(); assertNotNull(problem); assertEquals("AlwaysProvidedIntentNotFound", problem.getMessageId()); diff --git a/branches/sca-equinox/itest/validation/src/test/java/policy/xml/ErrorInPolicyIntentDefinitionTestCase.java b/branches/sca-equinox/itest/validation/src/test/java/policy/xml/ErrorInPolicyIntentDefinitionTestCase.java index a85dc334f4..5b5bfe7b37 100644 --- a/branches/sca-equinox/itest/validation/src/test/java/policy/xml/ErrorInPolicyIntentDefinitionTestCase.java +++ b/branches/sca-equinox/itest/validation/src/test/java/policy/xml/ErrorInPolicyIntentDefinitionTestCase.java @@ -22,7 +22,6 @@ import junit.framework.TestCase; import org.apache.tuscany.sca.monitor.Monitor; import org.apache.tuscany.sca.monitor.Problem; -import org.apache.tuscany.sca.monitor.logging.impl.DefaultLoggingMonitorImpl; import domain.CustomCompositeBuilder; @@ -52,7 +51,7 @@ public class ErrorInPolicyIntentDefinitionTestCase extends TestCase { public void testCalculator() { Monitor monitor = customDomain.getMonitorInstance(); - Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + Problem problem = monitor.getLastProblem(); assertNotNull(problem); assertEquals("ErrorInPolicyIntentDefinition", problem.getMessageId()); diff --git a/branches/sca-equinox/itest/validation/src/test/java/policy/xml/IntentNotSpecifiedTestCase.java b/branches/sca-equinox/itest/validation/src/test/java/policy/xml/IntentNotSpecifiedTestCase.java index 3f98757ce5..8ef3cacc4e 100644 --- a/branches/sca-equinox/itest/validation/src/test/java/policy/xml/IntentNotSpecifiedTestCase.java +++ b/branches/sca-equinox/itest/validation/src/test/java/policy/xml/IntentNotSpecifiedTestCase.java @@ -21,7 +21,7 @@ package policy.xml; import junit.framework.TestCase; import org.apache.tuscany.sca.monitor.Monitor; -import org.apache.tuscany.sca.monitor.logging.impl.DefaultLoggingMonitorImpl; +import org.apache.tuscany.sca.monitor.Problem; import domain.CustomCompositeBuilder; @@ -49,10 +49,19 @@ public class IntentNotSpecifiedTestCase extends TestCase { //node.stop(); } + private static boolean isMessageLogged(Monitor monitor, String messageId) { + for (Problem problem : monitor.getProblems()){ + if (problem.getMessageId().equals(messageId)){ + return true; + } + } + return false; + } + public void testCalculator() { Monitor monitor = customDomain.getMonitorInstance(); - assertTrue(((DefaultLoggingMonitorImpl)monitor).isMessageLogged("IntentNotSpecified")); - /*Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + assertTrue(isMessageLogged(monitor, "IntentNotSpecified")); + /*Problem problem = monitor.getLastLoggedProblem(); assertNotNull(problem); assertEquals("IntentNotSpecified", problem.getMessageId());*/ } diff --git a/branches/sca-equinox/itest/validation/src/test/java/policy/xml/MayProvideIntentNotFoundTestCase.java b/branches/sca-equinox/itest/validation/src/test/java/policy/xml/MayProvideIntentNotFoundTestCase.java index 3b8d075165..38d59196dd 100644 --- a/branches/sca-equinox/itest/validation/src/test/java/policy/xml/MayProvideIntentNotFoundTestCase.java +++ b/branches/sca-equinox/itest/validation/src/test/java/policy/xml/MayProvideIntentNotFoundTestCase.java @@ -22,7 +22,6 @@ import junit.framework.TestCase; import org.apache.tuscany.sca.monitor.Monitor; import org.apache.tuscany.sca.monitor.Problem; -import org.apache.tuscany.sca.monitor.logging.impl.DefaultLoggingMonitorImpl; import domain.CustomCompositeBuilder; @@ -52,7 +51,7 @@ public class MayProvideIntentNotFoundTestCase extends TestCase { public void testCalculator() { Monitor monitor = customDomain.getMonitorInstance(); - Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + Problem problem = monitor.getLastProblem(); assertNotNull(problem); assertEquals("MayProvideIntentNotFound", problem.getMessageId()); diff --git a/branches/sca-equinox/itest/validation/src/test/java/policy/xml/RequiredAttributeMissingTestCase.java b/branches/sca-equinox/itest/validation/src/test/java/policy/xml/RequiredAttributeMissingTestCase.java index bcf1f82392..9671f9c983 100644 --- a/branches/sca-equinox/itest/validation/src/test/java/policy/xml/RequiredAttributeMissingTestCase.java +++ b/branches/sca-equinox/itest/validation/src/test/java/policy/xml/RequiredAttributeMissingTestCase.java @@ -22,7 +22,6 @@ import junit.framework.TestCase; import org.apache.tuscany.sca.monitor.Monitor; import org.apache.tuscany.sca.monitor.Problem; -import org.apache.tuscany.sca.monitor.logging.impl.DefaultLoggingMonitorImpl; import domain.CustomCompositeBuilder; @@ -52,7 +51,7 @@ public class RequiredAttributeMissingTestCase extends TestCase { public void testCalculator() { Monitor monitor = customDomain.getMonitorInstance(); - Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + Problem problem = monitor.getLastProblem(); assertNotNull(problem); assertEquals("RequiredAttributeMissing", problem.getMessageId()); diff --git a/branches/sca-equinox/itest/validation/src/test/java/policy/xml/UnableToMapPoliciesTestCase.java b/branches/sca-equinox/itest/validation/src/test/java/policy/xml/UnableToMapPoliciesTestCase.java index 5683d54e64..b3ccb8b278 100644 --- a/branches/sca-equinox/itest/validation/src/test/java/policy/xml/UnableToMapPoliciesTestCase.java +++ b/branches/sca-equinox/itest/validation/src/test/java/policy/xml/UnableToMapPoliciesTestCase.java @@ -20,8 +20,6 @@ package policy.xml; import junit.framework.TestCase; -import org.apache.tuscany.sca.monitor.Monitor; -import org.apache.tuscany.sca.monitor.logging.impl.DefaultLoggingMonitorImpl; import org.junit.Ignore; import domain.CustomCompositeBuilder; @@ -56,9 +54,9 @@ public class UnableToMapPoliciesTestCase extends TestCase { //elements... /* Monitor monitor = customDomain.getMonitorInstance(); - assertTrue(((DefaultLoggingMonitorImpl)monitor).isMessageLogged("UnableToMapPolicies")); + assertTrue(monitor.isMessageLogged("UnableToMapPolicies")); */ - /*Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + /*Problem problem = monitor.getLastLoggedProblem(); assertNotNull(problem); assertEquals("UnableToMapPolicies", problem.getMessageId());*/ } diff --git a/branches/sca-equinox/itest/validation/src/test/java/policy/xml/UnrecognizedIntentAttachPointTypeTestCase.java b/branches/sca-equinox/itest/validation/src/test/java/policy/xml/UnrecognizedIntentAttachPointTypeTestCase.java index eec39d711e..08c27ee011 100644 --- a/branches/sca-equinox/itest/validation/src/test/java/policy/xml/UnrecognizedIntentAttachPointTypeTestCase.java +++ b/branches/sca-equinox/itest/validation/src/test/java/policy/xml/UnrecognizedIntentAttachPointTypeTestCase.java @@ -22,7 +22,6 @@ import junit.framework.TestCase; import org.apache.tuscany.sca.monitor.Monitor; import org.apache.tuscany.sca.monitor.Problem; -import org.apache.tuscany.sca.monitor.logging.impl.DefaultLoggingMonitorImpl; import domain.CustomCompositeBuilder; @@ -52,7 +51,7 @@ public class UnrecognizedIntentAttachPointTypeTestCase extends TestCase { public void testCalculator() { Monitor monitor = customDomain.getMonitorInstance(); - Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + Problem problem = monitor.getLastProblem(); assertNotNull(problem); assertEquals("UnrecognizedIntentAttachPointType", problem.getMessageId()); |