diff options
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());*/ |