diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2008-09-29 07:32:09 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2008-09-29 07:32:09 +0000 |
commit | 023074370754b13a5bdd8a2c589225fb12275b20 (patch) | |
tree | f8aae48c347a545d97413cb89802768751da3a1e /branches/sca-equinox/itest/validation/src/test/java/impl/bpel | |
parent | fcef778b4fb5b4ee7d828c1e9cfb62af2d48d869 (diff) |
More fixes to monitor. Removed remaining dependencies on DefaultLoggingMonitorImpl implementation class.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@700007 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-equinox/itest/validation/src/test/java/impl/bpel')
8 files changed, 30 insertions, 18 deletions
diff --git a/branches/sca-equinox/itest/validation/src/test/java/impl/bpel/AttributeUnrecognizedNamespaceTestCase.java b/branches/sca-equinox/itest/validation/src/test/java/impl/bpel/AttributeUnrecognizedNamespaceTestCase.java index 9d97e3611a..690fb97a31 100644 --- a/branches/sca-equinox/itest/validation/src/test/java/impl/bpel/AttributeUnrecognizedNamespaceTestCase.java +++ b/branches/sca-equinox/itest/validation/src/test/java/impl/bpel/AttributeUnrecognizedNamespaceTestCase.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 AttributeUnrecognizedNamespaceTestCase extends TestCase { public void testCalculator() { Monitor monitor = customDomain.getMonitorInstance(); - Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + Problem problem = monitor.getLastProblem(); assertNotNull(problem); assertEquals("AttributeUnrecognizedNamespace", problem.getMessageId()); diff --git a/branches/sca-equinox/itest/validation/src/test/java/impl/bpel/AttributeWithoutNamespaceTestCase.java b/branches/sca-equinox/itest/validation/src/test/java/impl/bpel/AttributeWithoutNamespaceTestCase.java index 80c15dc444..a768535fde 100644 --- a/branches/sca-equinox/itest/validation/src/test/java/impl/bpel/AttributeWithoutNamespaceTestCase.java +++ b/branches/sca-equinox/itest/validation/src/test/java/impl/bpel/AttributeWithoutNamespaceTestCase.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 AttributeWithoutNamespaceTestCase extends TestCase { public void testCalculator() { Monitor monitor = customDomain.getMonitorInstance(); - Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + Problem problem = monitor.getLastProblem(); assertNotNull(problem); assertEquals("AttributeWithoutNamespace", problem.getMessageId()); diff --git a/branches/sca-equinox/itest/validation/src/test/java/impl/bpel/BPELProcessNotFoundTestCase.java b/branches/sca-equinox/itest/validation/src/test/java/impl/bpel/BPELProcessNotFoundTestCase.java index 81e8aecfeb..64d41bdb48 100644 --- a/branches/sca-equinox/itest/validation/src/test/java/impl/bpel/BPELProcessNotFoundTestCase.java +++ b/branches/sca-equinox/itest/validation/src/test/java/impl/bpel/BPELProcessNotFoundTestCase.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 BPELProcessNotFoundTestCase extends TestCase { public void testCalculator() { Monitor monitor = customDomain.getMonitorInstance(); - Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + Problem problem = monitor.getLastProblem(); assertNotNull(problem); assertEquals("BPELProcessNotFound", problem.getMessageId()); diff --git a/branches/sca-equinox/itest/validation/src/test/java/impl/bpel/CannotResolveWSDLReferenceTestCase.java b/branches/sca-equinox/itest/validation/src/test/java/impl/bpel/CannotResolveWSDLReferenceTestCase.java index fb0c525aea..585bd62027 100644 --- a/branches/sca-equinox/itest/validation/src/test/java/impl/bpel/CannotResolveWSDLReferenceTestCase.java +++ b/branches/sca-equinox/itest/validation/src/test/java/impl/bpel/CannotResolveWSDLReferenceTestCase.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 CannotResolveWSDLReferenceTestCase extends TestCase { public void testCalculator() { Monitor monitor = customDomain.getMonitorInstance(); - Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + Problem problem = monitor.getLastProblem(); assertNotNull(problem); assertEquals("CannotResolveWSDLReference", problem.getMessageId()); diff --git a/branches/sca-equinox/itest/validation/src/test/java/impl/bpel/MyRolePartnerRoleNullTestCase.java b/branches/sca-equinox/itest/validation/src/test/java/impl/bpel/MyRolePartnerRoleNullTestCase.java index 445629457e..aab3529fba 100644 --- a/branches/sca-equinox/itest/validation/src/test/java/impl/bpel/MyRolePartnerRoleNullTestCase.java +++ b/branches/sca-equinox/itest/validation/src/test/java/impl/bpel/MyRolePartnerRoleNullTestCase.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 MyRolePartnerRoleNullTestCase extends TestCase { public void testCalculator() { Monitor monitor = customDomain.getMonitorInstance(); - Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + Problem problem = monitor.getLastProblem(); assertNotNull(problem); assertEquals("MyRolePartnerRoleNull", problem.getMessageId()); diff --git a/branches/sca-equinox/itest/validation/src/test/java/impl/bpel/PartnerLinkHasBothAttrTestCase.java b/branches/sca-equinox/itest/validation/src/test/java/impl/bpel/PartnerLinkHasBothAttrTestCase.java index 00b904ae65..4c3226f4c8 100644 --- a/branches/sca-equinox/itest/validation/src/test/java/impl/bpel/PartnerLinkHasBothAttrTestCase.java +++ b/branches/sca-equinox/itest/validation/src/test/java/impl/bpel/PartnerLinkHasBothAttrTestCase.java @@ -21,7 +21,7 @@ package impl.bpel; 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 PartnerLinkHasBothAttrTestCase extends TestCase { //nothing to do } + 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("PartnerLinkHasBothAttr")); - /*Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + assertTrue(isMessageLogged(monitor, "PartnerLinkHasBothAttr")); + /*Problem problem = monitor.getLastLoggedProblem(); assertNotNull(problem); assertEquals("PartnerLinkHasBothAttr", problem.getMessageId());*/ } diff --git a/branches/sca-equinox/itest/validation/src/test/java/impl/bpel/PartnerLinkNoMatchingTypeTestCase.java b/branches/sca-equinox/itest/validation/src/test/java/impl/bpel/PartnerLinkNoMatchingTypeTestCase.java index b7a4ee6fef..b9c0b68f7e 100644 --- a/branches/sca-equinox/itest/validation/src/test/java/impl/bpel/PartnerLinkNoMatchingTypeTestCase.java +++ b/branches/sca-equinox/itest/validation/src/test/java/impl/bpel/PartnerLinkNoMatchingTypeTestCase.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 PartnerLinkNoMatchingTypeTestCase extends TestCase { public void testCalculator() { Monitor monitor = customDomain.getMonitorInstance(); - Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + Problem problem = monitor.getLastProblem(); assertNotNull(problem); assertEquals("PartnerLinkNoMatchingType", problem.getMessageId()); diff --git a/branches/sca-equinox/itest/validation/src/test/java/impl/bpel/PartnerLinkTypeNoRolesTestCase.java b/branches/sca-equinox/itest/validation/src/test/java/impl/bpel/PartnerLinkTypeNoRolesTestCase.java index 32d3211f36..fc32e96b52 100644 --- a/branches/sca-equinox/itest/validation/src/test/java/impl/bpel/PartnerLinkTypeNoRolesTestCase.java +++ b/branches/sca-equinox/itest/validation/src/test/java/impl/bpel/PartnerLinkTypeNoRolesTestCase.java @@ -21,7 +21,7 @@ package impl.bpel; 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 PartnerLinkTypeNoRolesTestCase extends TestCase { //nothing to do } + 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("PartnerLinkTypeNoRoles")); - /*Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + assertTrue(isMessageLogged(monitor, "PartnerLinkTypeNoRoles")); + /*Problem problem = monitor.getLastLoggedProblem(); assertNotNull(problem); assertEquals("PartnerLinkTypeNoRoles", problem.getMessageId());*/ |