From bdd0a41aed7edf21ec2a65cfa17a86af2ef8c48a Mon Sep 17 00:00:00 2001 From: dims Date: Tue, 17 Jun 2008 00:23:01 +0000 Subject: Move Tuscany from Incubator to top level. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@668359 13f79535-47bb-0310-9956-ffa450edef68 --- .../assembly/xml/ContributionReadException.java | 60 ++++++ .../xml/PolicyImplValidationException.java | 60 ++++++ .../xml/PolicyServiceValidationException.java | 60 ++++++ .../assembly/xml/UnexpectedBindingElement.java | 60 ++++++ .../xml/UnexpectedImplementationElement.java | 60 ++++++ .../assembly/xml/UnexpectedInterfaceElement.java | 58 ++++++ .../binding/ejb/UnknownEJBSessionTypeTestCase.java | 61 ++++++ .../binding/ejb/UnknownEJBVersionTestCase.java | 61 ++++++ .../jms/DoesntProcessActivationSpecTestCase.java | 58 ++++++ .../jms/DoesntProcessDestinationTypeTestCase.java | 58 ++++++ .../binding/jms/DoesntProcessHeadersTestCase.java | 58 ++++++ .../jms/DoesntProcessResourceAdapterTestCase.java | 58 ++++++ ...oesntProcessResponseActivationSpecTestCase.java | 58 ++++++ ...ntProcessResponseConnectionFactoryTestCase.java | 58 ++++++ ...esntProcessResponseDestinationTypeTestCase.java | 58 ++++++ .../jms/InvalidCorrelationSchemeTestCase.java | 58 ++++++ .../InvalidResponseDestinationTypeTestCase.java | 58 ++++++ .../jms/MissingActivationSpecNameTestCase.java | 58 ++++++ .../jms/MissingConnectionFactoryNameTestCase.java | 58 ++++++ .../jms/MissingResponseActivationSpecTestCase.java | 58 ++++++ .../MissingResponseConnectionFactoryTestCase.java | 58 ++++++ .../binding/jms/MustStartWithSchemaTestCase.java | 58 ++++++ .../binding/jms/UnexpectedElementTestCase.java | 58 ++++++ .../jms/UnexpectedResponseElementTestCase.java | 58 ++++++ .../binding/jms/UnknownTokenInURITestCase.java | 58 ++++++ .../wsxml/InvalidWsdlElementAttrTestCase.java | 60 ++++++ .../binding/wsxml/MustUseWsdlBindingTestCase.java | 60 ++++++ .../wsxml/WsdlBindingDoesNotMatchTestCase.java | 60 ++++++ .../wsxml/WsdlServiceDoesNotMatchTestCase.java | 60 ++++++ .../ComponentReferenceTargetNotFoundTestCase.java | 79 ++++++++ .../warning/DuplicateComponentNameTestCase.java | 76 ++++++++ ...uplicateImplementationPropertyNameTestCase.java | 65 +++++++ ...plicateImplementationReferenceNameTestCase.java | 66 +++++++ .../warning/DuplicatePropertyNameTestCase.java | 73 +++++++ .../warning/DuplicateReferenceNameTestCase.java | 73 +++++++ .../MultipleBindingsForServiceTestCase.java | 73 +++++++ .../warning/NoComponentImplementationTestCase.java | 69 +++++++ .../warning/NoCompositeNamespaceTestCase.java | 73 +++++++ .../warning/NoMatchingBindingTestCase.java | 81 ++++++++ .../warning/PromotedReferenceNotFoundTestCase.java | 73 +++++++ .../warning/PromotedServiceNotFoundTestCase.java | 73 +++++++ .../PropertyAttributeMustSupplyNullTestCase.java | 73 +++++++ .../warning/PropertyAttributeTestCase.java | 73 +++++++ .../warning/PropertyNotFoundTestCase.java | 73 +++++++ .../PropertyOverrideManyAttributeTestCase.java | 73 +++++++ ...enceIncompatibleComponentInterfaceTestCase.java | 73 +++++++ .../ReferenceIncompatibleInterfaceTestCase.java | 73 +++++++ .../ReferenceIncompatibleMultiplicityTestCase.java | 73 +++++++ .../warning/ReferenceNotFoundTestCase.java | 73 +++++++ .../warning/ReferenceWithoutTargetsTestCase.java | 73 +++++++ ...ServiceNotFoundForComponentServiceTestCase.java | 73 +++++++ .../UnresolvedComponentImplementationTestCase.java | 69 +++++++ .../calculator/warning/XSDValidationTestCase.java | 86 +++++++++ .../java/AttributePackageMissingTestCase.java | 60 ++++++ .../AttributeNameSpaceMissingTestCase.java | 60 ++++++ .../resource/AttributeURIMissingTestCase.java | 60 ++++++ .../xml/AttributeCompositeMissingTestCase.java | 60 ++++++ .../test/java/domain/CustomCompositeBuilder.java | 215 +++++++++++++++++++++ .../AttributeUnrecognizedNamespaceTestCase.java | 59 ++++++ .../bpel/AttributeWithoutNamespaceTestCase.java | 59 ++++++ .../impl/bpel/BPELProcessNotFoundTestCase.java | 59 ++++++ .../bpel/CannotResolveWSDLReferenceTestCase.java | 59 ++++++ .../impl/bpel/MyRolePartnerRoleNullTestCase.java | 59 ++++++ .../impl/bpel/PartnerLinkHasBothAttrTestCase.java | 59 ++++++ .../bpel/PartnerLinkNoMatchingTypeTestCase.java | 59 ++++++ .../impl/bpel/PartnerLinkTypeNoRolesTestCase.java | 59 ++++++ .../impl/java/ClassNotFoundExceptionTestCase.java | 59 ++++++ .../java/ContributionResolveExceptionTestCase.java | 60 ++++++ .../osgi/CouldNotLocateOSGiBundleTestCase.java | 62 ++++++ .../osgi/MissingComponentTypeFileTestCase.java | 62 ++++++ .../src/test/java/impl/osgi/OSGiTestBundles.java | 111 +++++++++++ .../impl/osgi/PropertyShouldSpecifySRTestCase.java | 62 ++++++ .../resource/CouldNotResolveLocationTestCase.java | 59 ++++++ .../resource/LocationAttributeMissingTestCase.java | 59 ++++++ .../ContributionResolveExceptionTestCase.java | 58 ++++++ .../spring/LocationAttributeMissingTestCase.java | 58 ++++++ .../UnableToResolveComponentTypeTestCase.java | 58 ++++++ .../widget/CouldNotResolveLocationTestCase.java | 59 ++++++ .../widget/LocationAttributeMissingTestCase.java | 59 ++++++ .../impl/xquery/CouldNotLocateFileTestCase.java | 58 ++++++ .../xquery/LocationAttributeMissingTestCase.java | 58 ++++++ .../interfacejava/xml/ClassNotFoundTestCase.java | 58 ++++++ .../xml/ContributionResolveExceptionTestCase.java | 58 ++++++ .../xml/InvalidWSDLInterfaceAttrTestCase.java | 58 ++++++ .../xml/WsdlInterfaceDoesNotMatchTestCase.java | 58 ++++++ .../xml/AlwaysProvidedIntentNotFoundTestCase.java | 58 ++++++ .../xml/ErrorInPolicyIntentDefinitionTestCase.java | 58 ++++++ .../policy/xml/IntentNotSpecifiedTestCase.java | 58 ++++++ .../xml/MayProvideIntentNotFoundTestCase.java | 58 ++++++ .../xml/RequiredAttributeMissingTestCase.java | 58 ++++++ .../policy/xml/UnableToMapPoliciesTestCase.java | 58 ++++++ .../UnrecognizedIntentAttachPointTypeTestCase.java | 58 ++++++ 92 files changed, 5972 insertions(+) create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/assembly/xml/ContributionReadException.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/assembly/xml/PolicyImplValidationException.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/assembly/xml/PolicyServiceValidationException.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/assembly/xml/UnexpectedBindingElement.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/assembly/xml/UnexpectedImplementationElement.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/assembly/xml/UnexpectedInterfaceElement.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/binding/ejb/UnknownEJBSessionTypeTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/binding/ejb/UnknownEJBVersionTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/DoesntProcessActivationSpecTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/DoesntProcessDestinationTypeTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/DoesntProcessHeadersTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/DoesntProcessResourceAdapterTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/DoesntProcessResponseActivationSpecTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/DoesntProcessResponseConnectionFactoryTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/DoesntProcessResponseDestinationTypeTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/InvalidCorrelationSchemeTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/InvalidResponseDestinationTypeTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/MissingActivationSpecNameTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/MissingConnectionFactoryNameTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/MissingResponseActivationSpecTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/MissingResponseConnectionFactoryTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/MustStartWithSchemaTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/UnexpectedElementTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/UnexpectedResponseElementTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/UnknownTokenInURITestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/binding/wsxml/InvalidWsdlElementAttrTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/binding/wsxml/MustUseWsdlBindingTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/binding/wsxml/WsdlBindingDoesNotMatchTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/binding/wsxml/WsdlServiceDoesNotMatchTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/ComponentReferenceTargetNotFoundTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/DuplicateComponentNameTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/DuplicateImplementationPropertyNameTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/DuplicateImplementationReferenceNameTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/DuplicatePropertyNameTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/DuplicateReferenceNameTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/MultipleBindingsForServiceTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/NoComponentImplementationTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/NoCompositeNamespaceTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/NoMatchingBindingTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/PromotedReferenceNotFoundTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/PromotedServiceNotFoundTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/PropertyAttributeMustSupplyNullTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/PropertyAttributeTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/PropertyNotFoundTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/PropertyOverrideManyAttributeTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/ReferenceIncompatibleComponentInterfaceTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/ReferenceIncompatibleInterfaceTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/ReferenceIncompatibleMultiplicityTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/ReferenceNotFoundTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/ReferenceWithoutTargetsTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/ServiceNotFoundForComponentServiceTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/UnresolvedComponentImplementationTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/XSDValidationTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/contribution/java/AttributePackageMissingTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/contribution/namespace/AttributeNameSpaceMissingTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/contribution/resource/AttributeURIMissingTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/contribution/xml/AttributeCompositeMissingTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/domain/CustomCompositeBuilder.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/impl/bpel/AttributeUnrecognizedNamespaceTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/impl/bpel/AttributeWithoutNamespaceTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/impl/bpel/BPELProcessNotFoundTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/impl/bpel/CannotResolveWSDLReferenceTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/impl/bpel/MyRolePartnerRoleNullTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/impl/bpel/PartnerLinkHasBothAttrTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/impl/bpel/PartnerLinkNoMatchingTypeTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/impl/bpel/PartnerLinkTypeNoRolesTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/impl/java/ClassNotFoundExceptionTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/impl/java/ContributionResolveExceptionTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/impl/osgi/CouldNotLocateOSGiBundleTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/impl/osgi/MissingComponentTypeFileTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/impl/osgi/OSGiTestBundles.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/impl/osgi/PropertyShouldSpecifySRTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/impl/resource/CouldNotResolveLocationTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/impl/resource/LocationAttributeMissingTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/impl/spring/ContributionResolveExceptionTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/impl/spring/LocationAttributeMissingTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/impl/spring/UnableToResolveComponentTypeTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/impl/widget/CouldNotResolveLocationTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/impl/widget/LocationAttributeMissingTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/impl/xquery/CouldNotLocateFileTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/impl/xquery/LocationAttributeMissingTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/interfacejava/xml/ClassNotFoundTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/interfacejava/xml/ContributionResolveExceptionTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/interfacewsdl/xml/InvalidWSDLInterfaceAttrTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/interfacewsdl/xml/WsdlInterfaceDoesNotMatchTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/policy/xml/AlwaysProvidedIntentNotFoundTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/policy/xml/ErrorInPolicyIntentDefinitionTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/policy/xml/IntentNotSpecifiedTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/policy/xml/MayProvideIntentNotFoundTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/policy/xml/RequiredAttributeMissingTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/policy/xml/UnableToMapPoliciesTestCase.java create mode 100644 sandbox/axis2-1.4/itest/validation/src/test/java/policy/xml/UnrecognizedIntentAttachPointTypeTestCase.java (limited to 'sandbox/axis2-1.4/itest/validation/src/test') diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/assembly/xml/ContributionReadException.java b/sandbox/axis2-1.4/itest/validation/src/test/java/assembly/xml/ContributionReadException.java new file mode 100644 index 0000000000..0200e6bd84 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/assembly/xml/ContributionReadException.java @@ -0,0 +1,60 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package assembly.xml; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; + +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class ContributionReadException extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/assemblyxml/ContributionReadException/Calculator.composite", + "TestContribution", "src/main/resources/assemblyxml/ContributionReadException/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("ContributionReadException", problem.getMessageId()); + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/assembly/xml/PolicyImplValidationException.java b/sandbox/axis2-1.4/itest/validation/src/test/java/assembly/xml/PolicyImplValidationException.java new file mode 100644 index 0000000000..ce5506a67c --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/assembly/xml/PolicyImplValidationException.java @@ -0,0 +1,60 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package assembly.xml; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; + +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class PolicyImplValidationException extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/assemblyxml/PolicyImplValidationException/Calculator.composite", + "TestContribution", "src/main/resources/assemblyxml/PolicyImplValidationException/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("PolicyImplValidationException", problem.getMessageId()); + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/assembly/xml/PolicyServiceValidationException.java b/sandbox/axis2-1.4/itest/validation/src/test/java/assembly/xml/PolicyServiceValidationException.java new file mode 100644 index 0000000000..b9260c4e26 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/assembly/xml/PolicyServiceValidationException.java @@ -0,0 +1,60 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package assembly.xml; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; + +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class PolicyServiceValidationException extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/assemblyxml/PolicyServiceValidationException/Calculator.composite", + "TestContribution", "src/main/resources/assemblyxml/PolicyServiceValidationException/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("PolicyServiceValidationException", problem.getMessageId()); + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/assembly/xml/UnexpectedBindingElement.java b/sandbox/axis2-1.4/itest/validation/src/test/java/assembly/xml/UnexpectedBindingElement.java new file mode 100644 index 0000000000..4c5aa48373 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/assembly/xml/UnexpectedBindingElement.java @@ -0,0 +1,60 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package assembly.xml; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; + +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class UnexpectedBindingElement extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/assemblyxml/UnexpectedBindingElement/Calculator.composite", + "TestContribution", "src/main/resources/assemblyxml/UnexpectedBindingElement/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("UnexpectedBindingElement", problem.getMessageId()); + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/assembly/xml/UnexpectedImplementationElement.java b/sandbox/axis2-1.4/itest/validation/src/test/java/assembly/xml/UnexpectedImplementationElement.java new file mode 100644 index 0000000000..3ba5dc4b74 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/assembly/xml/UnexpectedImplementationElement.java @@ -0,0 +1,60 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package assembly.xml; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; + +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class UnexpectedImplementationElement extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/assemblyxml/UnexpectedImplementationElement/Calculator.composite", + "TestContribution", "src/main/resources/assemblyxml/UnexpectedImplementationElement/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("UnexpectedImplementationElement", problem.getMessageId()); + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/assembly/xml/UnexpectedInterfaceElement.java b/sandbox/axis2-1.4/itest/validation/src/test/java/assembly/xml/UnexpectedInterfaceElement.java new file mode 100644 index 0000000000..f20d89abac --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/assembly/xml/UnexpectedInterfaceElement.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package assembly.xml; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import domain.CustomCompositeBuilder; +/** + * This shows how to test the Calculator service component. + */ +public class UnexpectedInterfaceElement extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/assemblyxml/UnexpectedInterfaceElement/Calculator.composite", + "TestContribution", "src/main/resources/assemblyxml/UnexpectedInterfaceElement/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("UnexpectedInterfaceElement", problem.getMessageId()); + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/binding/ejb/UnknownEJBSessionTypeTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/ejb/UnknownEJBSessionTypeTestCase.java new file mode 100644 index 0000000000..bb91ce4404 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/ejb/UnknownEJBSessionTypeTestCase.java @@ -0,0 +1,61 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package binding.ejb; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class UnknownEJBSessionTypeTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception { + System.setProperty("java.naming.factory.initial", "org.apache.openejb.client.RemoteInitialContextFactory"); + System.setProperty("java.naming.provider.url", "ejbd://localhost:8085"); + System.setProperty("managed", "false"); + + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/bindingejb/UnknownEJBSessionType/account.composite", + "TestContribution", "src/main/resources/bindingejb/UnknownEJBSessionType/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("UnknownEJBSessionType", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/binding/ejb/UnknownEJBVersionTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/ejb/UnknownEJBVersionTestCase.java new file mode 100644 index 0000000000..a930de1d6e --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/ejb/UnknownEJBVersionTestCase.java @@ -0,0 +1,61 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package binding.ejb; + +import junit.framework.TestCase; +import domain.CustomCompositeBuilder; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; + +/** + * This shows how to test the Calculator service component. + */ +public class UnknownEJBVersionTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception { + System.setProperty("java.naming.factory.initial", "org.apache.openejb.client.RemoteInitialContextFactory"); + System.setProperty("java.naming.provider.url", "ejbd://localhost:8085"); + System.setProperty("managed", "false"); + + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/bindingejb/UnknownEJBVersion/account.composite", + "TestContribution", "src/main/resources/bindingejb/UnknownEJBVersion/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("UnknownEJBVersion", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/DoesntProcessActivationSpecTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/DoesntProcessActivationSpecTestCase.java new file mode 100644 index 0000000000..3cbb9cbabb --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/DoesntProcessActivationSpecTestCase.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package binding.jms; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class DoesntProcessActivationSpecTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/bindingjms/DoesntProcessActivationSpec/service.composite", + "TestContribution", "src/main/resources/bindingjms/DoesntProcessActivationSpec/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("DoesntProcessActivationSpec", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/DoesntProcessDestinationTypeTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/DoesntProcessDestinationTypeTestCase.java new file mode 100644 index 0000000000..c565971650 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/DoesntProcessDestinationTypeTestCase.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package binding.jms; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class DoesntProcessDestinationTypeTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/bindingjms/DoesntProcessDestinationType/service.composite", + "TestContribution", "src/main/resources/bindingjms/DoesntProcessDestinationType/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("DoesntProcessDestinationType", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/DoesntProcessHeadersTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/DoesntProcessHeadersTestCase.java new file mode 100644 index 0000000000..691980d686 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/DoesntProcessHeadersTestCase.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package binding.jms; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class DoesntProcessHeadersTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/bindingjms/DoesntProcessHeaders/service.composite", + "TestContribution", "src/main/resources/bindingjms/DoesntProcessHeaders/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("DoesntProcessHeaders", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/DoesntProcessResourceAdapterTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/DoesntProcessResourceAdapterTestCase.java new file mode 100644 index 0000000000..c39c62f14b --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/DoesntProcessResourceAdapterTestCase.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package binding.jms; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class DoesntProcessResourceAdapterTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/bindingjms/DoesntProcessResourceAdapter/service.composite", + "TestContribution", "src/main/resources/bindingjms/DoesntProcessResourceAdapter/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("DoesntProcessResourceAdapter", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/DoesntProcessResponseActivationSpecTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/DoesntProcessResponseActivationSpecTestCase.java new file mode 100644 index 0000000000..3d78bf6c93 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/DoesntProcessResponseActivationSpecTestCase.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package binding.jms; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class DoesntProcessResponseActivationSpecTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/bindingjms/DoesntProcessResponseActivationSpec/service.composite", + "TestContribution", "src/main/resources/bindingjms/DoesntProcessResponseActivationSpec/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("DoesntProcessResponseActivationSpec", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/DoesntProcessResponseConnectionFactoryTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/DoesntProcessResponseConnectionFactoryTestCase.java new file mode 100644 index 0000000000..a9a6358061 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/DoesntProcessResponseConnectionFactoryTestCase.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package binding.jms; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class DoesntProcessResponseConnectionFactoryTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/bindingjms/DoesntProcessResponseConnectionFactory/service.composite", + "TestContribution", "src/main/resources/bindingjms/DoesntProcessResponseConnectionFactory/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("DoesntProcessResponseConnectionFactory", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/DoesntProcessResponseDestinationTypeTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/DoesntProcessResponseDestinationTypeTestCase.java new file mode 100644 index 0000000000..d941663166 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/DoesntProcessResponseDestinationTypeTestCase.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package binding.jms; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class DoesntProcessResponseDestinationTypeTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/bindingjms/DoesntProcessResponseDestinationType/service.composite", + "TestContribution", "src/main/resources/bindingjms/DoesntProcessResponseDestinationType/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("DoesntProcessResponseDestinationType", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/InvalidCorrelationSchemeTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/InvalidCorrelationSchemeTestCase.java new file mode 100644 index 0000000000..1a596b8ed2 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/InvalidCorrelationSchemeTestCase.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package binding.jms; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class InvalidCorrelationSchemeTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/bindingjms/InvalidCorrelationScheme/service.composite", + "TestContribution", "src/main/resources/bindingjms/InvalidCorrelationScheme/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("InvalidCorrelationScheme", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/InvalidResponseDestinationTypeTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/InvalidResponseDestinationTypeTestCase.java new file mode 100644 index 0000000000..49be5ff493 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/InvalidResponseDestinationTypeTestCase.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package binding.jms; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class InvalidResponseDestinationTypeTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/bindingjms/InvalidResponseDestinationType/service.composite", + "TestContribution", "src/main/resources/bindingjms/InvalidResponseDestinationType/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("InvalidResponseDestinationType", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/MissingActivationSpecNameTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/MissingActivationSpecNameTestCase.java new file mode 100644 index 0000000000..b7e05d748f --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/MissingActivationSpecNameTestCase.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package binding.jms; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class MissingActivationSpecNameTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/bindingjms/MissingActivationSpecName/service.composite", + "TestContribution", "src/main/resources/bindingjms/MissingActivationSpecName/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("MissingActivationSpecName", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/MissingConnectionFactoryNameTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/MissingConnectionFactoryNameTestCase.java new file mode 100644 index 0000000000..7dcfcb3f38 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/MissingConnectionFactoryNameTestCase.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package binding.jms; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class MissingConnectionFactoryNameTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/bindingjms/MissingConnectionFactoryName/service.composite", + "TestContribution", "src/main/resources/bindingjms/MissingConnectionFactoryName/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("MissingConnectionFactoryName", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/MissingResponseActivationSpecTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/MissingResponseActivationSpecTestCase.java new file mode 100644 index 0000000000..3e0cb17bdc --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/MissingResponseActivationSpecTestCase.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package binding.jms; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class MissingResponseActivationSpecTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/bindingjms/MissingResponseActivationSpec/service.composite", + "TestContribution", "src/main/resources/bindingjms/MissingResponseActivationSpec/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("MissingResponseActivationSpec", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/MissingResponseConnectionFactoryTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/MissingResponseConnectionFactoryTestCase.java new file mode 100644 index 0000000000..cfb8dd4d82 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/MissingResponseConnectionFactoryTestCase.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package binding.jms; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class MissingResponseConnectionFactoryTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/bindingjms/MissingResponseConnectionFactory/service.composite", + "TestContribution", "src/main/resources/bindingjms/MissingResponseConnectionFactory/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("MissingResponseConnectionFactory", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/MustStartWithSchemaTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/MustStartWithSchemaTestCase.java new file mode 100644 index 0000000000..d2b36ed202 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/MustStartWithSchemaTestCase.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package binding.jms; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class MustStartWithSchemaTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/bindingjms/MustStartWithSchema/service.composite", + "TestContribution", "src/main/resources/bindingjms/MustStartWithSchema/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("MustStartWithSchema", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/UnexpectedElementTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/UnexpectedElementTestCase.java new file mode 100644 index 0000000000..ae3cc5fa1d --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/UnexpectedElementTestCase.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package binding.jms; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class UnexpectedElementTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/bindingjms/UnexpectedElement/service.composite", + "TestContribution", "src/main/resources/bindingjms/UnexpectedElement/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("UnexpectedElement", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/UnexpectedResponseElementTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/UnexpectedResponseElementTestCase.java new file mode 100644 index 0000000000..015687136a --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/UnexpectedResponseElementTestCase.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package binding.jms; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class UnexpectedResponseElementTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/bindingjms/UnexpectedResponseElement/service.composite", + "TestContribution", "src/main/resources/bindingjms/UnexpectedResponseElement/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("UnexpectedResponseElement", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/UnknownTokenInURITestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/UnknownTokenInURITestCase.java new file mode 100644 index 0000000000..49c6292d49 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/jms/UnknownTokenInURITestCase.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package binding.jms; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class UnknownTokenInURITestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/bindingjms/UnknownTokenInURI/service.composite", + "TestContribution", "src/main/resources/bindingjms/UnknownTokenInURI/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("UnknownTokenInURI", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/binding/wsxml/InvalidWsdlElementAttrTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/wsxml/InvalidWsdlElementAttrTestCase.java new file mode 100644 index 0000000000..9f8ca78406 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/wsxml/InvalidWsdlElementAttrTestCase.java @@ -0,0 +1,60 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package binding.wsxml; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; + +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class InvalidWsdlElementAttrTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/binding/wsxml/InvalidWsdlElementAttr/Calculator.composite", + "TestContribution", "src/main/resources/binding/wsxml/InvalidWsdlElementAttr/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("InvalidWsdlElementAttr", problem.getMessageId()); + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/binding/wsxml/MustUseWsdlBindingTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/wsxml/MustUseWsdlBindingTestCase.java new file mode 100644 index 0000000000..e9e56686e0 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/wsxml/MustUseWsdlBindingTestCase.java @@ -0,0 +1,60 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package binding.wsxml; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; + +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class MustUseWsdlBindingTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/binding/wsxml/MustUseWsdlBinding/Calculator.composite", + "TestContribution", "src/main/resources/binding/wsxml/MustUseWsdlBinding/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("MustUseWsdlBinding", problem.getMessageId()); + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/binding/wsxml/WsdlBindingDoesNotMatchTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/wsxml/WsdlBindingDoesNotMatchTestCase.java new file mode 100644 index 0000000000..baea34c8ab --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/wsxml/WsdlBindingDoesNotMatchTestCase.java @@ -0,0 +1,60 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package binding.wsxml; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; + +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class WsdlBindingDoesNotMatchTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/binding/wsxml/WsdlBindingDoesNotMatch/helloworldwsjms.composite", + "TestContribution", "src/main/resources/binding/wsxml/WsdlBindingDoesNotMatch/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("WsdlBindingDoesNotMatch", problem.getMessageId()); + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/binding/wsxml/WsdlServiceDoesNotMatchTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/wsxml/WsdlServiceDoesNotMatchTestCase.java new file mode 100644 index 0000000000..5fc5e39f9c --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/binding/wsxml/WsdlServiceDoesNotMatchTestCase.java @@ -0,0 +1,60 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package binding.wsxml; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; + +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class WsdlServiceDoesNotMatchTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/binding/wsxml/WsdlServiceDoesNotMatch/helloworldwsjms.composite", + "TestContribution", "src/main/resources/binding/wsxml/WsdlServiceDoesNotMatch/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("WsdlServiceDoesNotMatch", problem.getMessageId()); + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/ComponentReferenceTargetNotFoundTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/ComponentReferenceTargetNotFoundTestCase.java new file mode 100644 index 0000000000..ddebf877bb --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/ComponentReferenceTargetNotFoundTestCase.java @@ -0,0 +1,79 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package calculator.warning; + +import java.io.File; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.UtilityExtensionPoint; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.MonitorFactory; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode2; +import org.apache.tuscany.sca.node.SCANode2Factory; +import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution; +import org.apache.tuscany.sca.node.impl.NodeImpl; + +import calculator.warning.CalculatorService; + +/** + * This shows how to test the Calculator service component. + */ +public class ComponentReferenceTargetNotFoundTestCase extends TestCase { + + private CalculatorService calculatorService; + private SCANode2 node; + + @Override + protected void setUp() throws Exception { + SCANode2Factory nodeFactory = SCANode2Factory.newInstance(); + node = nodeFactory.createSCANode(new File("src/main/resources/ComponentReferenceTargetNotFound/Calculator.composite").toURL().toString(), + new SCAContribution("TestContribution", + new File("src/main/resources/ComponentReferenceTargetNotFound").toURL().toString())); + + try { + node.start(); + } catch (Exception ex){ + // do nothing - the SCA binding throws and exception here + // because the interface for the reference is not remotable + } + calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent"); + } + + @Override + protected void tearDown() throws Exception { + node.stop(); + } + + public void testCalculator() throws Exception { + ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry(); + UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class); + MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class); + Monitor monitor = monitorFactory.createMonitor(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("ComponentReferenceTargetNotFound", problem.getMessageId()); + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/DuplicateComponentNameTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/DuplicateComponentNameTestCase.java new file mode 100644 index 0000000000..4fabf946a9 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/DuplicateComponentNameTestCase.java @@ -0,0 +1,76 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package calculator.warning; + +import java.io.File; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.UtilityExtensionPoint; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.MonitorFactory; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode2; +import org.apache.tuscany.sca.node.SCANode2Factory; +import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution; +import org.apache.tuscany.sca.node.impl.NodeImpl; + +import calculator.warning.CalculatorService; + +/** + * This shows how to test the Calculator service component. + */ +public class DuplicateComponentNameTestCase extends TestCase { + + private CalculatorService calculatorService; + private SCANode2 node; + + @Override + protected void setUp() throws Exception { + SCANode2Factory nodeFactory = SCANode2Factory.newInstance(); + node = nodeFactory.createSCANode(new File("src/main/resources/DuplicateComponentName/Calculator.composite").toURL().toString(), + new SCAContribution("TestContribution", + new File("src/main/resources/DuplicateComponentName").toURL().toString())); + /* + node = SCANode2Factory.createSCANodeWithComposite("DuplicateComponentName/Calculator.composite"); + */ + node.start(); + calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent"); + } + + @Override + protected void tearDown() throws Exception { + node.stop(); + } + + public void testCalculator() throws Exception { + ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry(); + UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class); + MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class); + Monitor monitor = monitorFactory.createMonitor(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("DuplicateComponentName", problem.getMessageId()); + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/DuplicateImplementationPropertyNameTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/DuplicateImplementationPropertyNameTestCase.java new file mode 100644 index 0000000000..979e8e389f --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/DuplicateImplementationPropertyNameTestCase.java @@ -0,0 +1,65 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package calculator.warning; + +import java.io.File; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.UtilityExtensionPoint; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.MonitorFactory; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import org.apache.tuscany.sca.node.SCANode2; +import org.apache.tuscany.sca.node.SCANode2Factory; +import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution; +import org.apache.tuscany.sca.node.impl.NodeImpl; + +/** + * This shows how to test the Calculator service component. + */ +public class DuplicateImplementationPropertyNameTestCase extends TestCase { + private SCANode2 node; + + @Override + protected void setUp() throws Exception { + SCANode2Factory nodeFactory = SCANode2Factory.newInstance(); + node = nodeFactory.createSCANode(new File("src/main/resources/DuplicateImplementationPropertyName/Calculator.composite").toURL().toString(), + new SCAContribution("TestContribution", + new File("src/main/resources/DuplicateImplementationPropertyName").toURL().toString())); + } + + @Override + protected void tearDown() throws Exception { + } + + public void testCalculator() throws Exception { + ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry(); + UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class); + MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class); + Monitor monitor = monitorFactory.createMonitor(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("DuplicateImplementationPropertyName", problem.getMessageId()); + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/DuplicateImplementationReferenceNameTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/DuplicateImplementationReferenceNameTestCase.java new file mode 100644 index 0000000000..4b09a561a2 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/DuplicateImplementationReferenceNameTestCase.java @@ -0,0 +1,66 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package calculator.warning; + +import java.io.File; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.UtilityExtensionPoint; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.MonitorFactory; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import org.apache.tuscany.sca.node.SCANode2; +import org.apache.tuscany.sca.node.SCANode2Factory; +import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution; +import org.apache.tuscany.sca.node.impl.NodeImpl; + +/** + * This shows how to test the Calculator service component. + */ +public class DuplicateImplementationReferenceNameTestCase extends TestCase { + + private SCANode2 node; + + @Override + protected void setUp() throws Exception { + SCANode2Factory nodeFactory = SCANode2Factory.newInstance(); + node = nodeFactory.createSCANode(new File("src/main/resources/DuplicateImplementationReferenceName/Calculator.composite").toURL().toString(), + new SCAContribution("TestContribution", + new File("src/main/resources/DuplicateImplementationReferenceName").toURL().toString())); + } + + @Override + protected void tearDown() throws Exception { + } + + public void testCalculator() throws Exception { + ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry(); + UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class); + MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class); + Monitor monitor = monitorFactory.createMonitor(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("DuplicateImplementationReferenceName", problem.getMessageId()); + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/DuplicatePropertyNameTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/DuplicatePropertyNameTestCase.java new file mode 100644 index 0000000000..2313fa6c61 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/DuplicatePropertyNameTestCase.java @@ -0,0 +1,73 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package calculator.warning; + +import java.io.File; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.UtilityExtensionPoint; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.MonitorFactory; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode2; +import org.apache.tuscany.sca.node.SCANode2Factory; +import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution; +import org.apache.tuscany.sca.node.impl.NodeImpl; + +import calculator.warning.CalculatorService; + +/** + * This shows how to test the Calculator service component. + */ +public class DuplicatePropertyNameTestCase extends TestCase { + + private CalculatorService calculatorService; + private SCANode2 node; + + @Override + protected void setUp() throws Exception { + SCANode2Factory nodeFactory = SCANode2Factory.newInstance(); + node = nodeFactory.createSCANode(new File("src/main/resources/DuplicatePropertyName/Calculator.composite").toURL().toString(), + new SCAContribution("TestContribution", + new File("src/main/resources/DuplicatePropertyName").toURL().toString())); + node.start(); + calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent"); + } + + @Override + protected void tearDown() throws Exception { + node.stop(); + } + + public void testCalculator() throws Exception { + ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry(); + UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class); + MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class); + Monitor monitor = monitorFactory.createMonitor(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("DuplicateComponentPropertyName", problem.getMessageId()); + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/DuplicateReferenceNameTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/DuplicateReferenceNameTestCase.java new file mode 100644 index 0000000000..43b7c811d9 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/DuplicateReferenceNameTestCase.java @@ -0,0 +1,73 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package calculator.warning; + +import java.io.File; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.UtilityExtensionPoint; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.MonitorFactory; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode2; +import org.apache.tuscany.sca.node.SCANode2Factory; +import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution; +import org.apache.tuscany.sca.node.impl.NodeImpl; + +import calculator.warning.CalculatorService; + +/** + * This shows how to test the Calculator service component. + */ +public class DuplicateReferenceNameTestCase extends TestCase { + + private CalculatorService calculatorService; + private SCANode2 node; + + @Override + protected void setUp() throws Exception { + SCANode2Factory nodeFactory = SCANode2Factory.newInstance(); + node = nodeFactory.createSCANode(new File("src/main/resources/DuplicateReferenceName/Calculator.composite").toURL().toString(), + new SCAContribution("TestContribution", + new File("src/main/resources/DuplicateReferenceName").toURL().toString())); + node.start(); + calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent"); + } + + @Override + protected void tearDown() throws Exception { + node.stop(); + } + + public void testCalculator() throws Exception { + ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry(); + UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class); + MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class); + Monitor monitor = monitorFactory.createMonitor(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("DuplicateComponentReferenceName", problem.getMessageId()); + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/MultipleBindingsForServiceTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/MultipleBindingsForServiceTestCase.java new file mode 100644 index 0000000000..bfb662379b --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/MultipleBindingsForServiceTestCase.java @@ -0,0 +1,73 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package calculator.warning; + +import java.io.File; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.UtilityExtensionPoint; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.MonitorFactory; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode2; +import org.apache.tuscany.sca.node.SCANode2Factory; +import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution; +import org.apache.tuscany.sca.node.impl.NodeImpl; + +import calculator.warning.CalculatorService; + +/** + * This shows how to test the Calculator service component. + */ +public class MultipleBindingsForServiceTestCase extends TestCase { + + private CalculatorService calculatorService; + private SCANode2 node; + + @Override + protected void setUp() throws Exception { + SCANode2Factory nodeFactory = SCANode2Factory.newInstance(); + node = nodeFactory.createSCANode(new File("src/main/resources/MultipleBindingsForService/Calculator.composite").toURL().toString(), + new SCAContribution("TestContribution", + new File("src/main/resources/MultipleBindingsForService").toURL().toString())); + node.start(); + calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent"); + } + + @Override + protected void tearDown() throws Exception { + node.stop(); + } + + public void testCalculator() throws Exception { + ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry(); + UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class); + MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class); + Monitor monitor = monitorFactory.createMonitor(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("MultipleBindingsForService", problem.getMessageId()); + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/NoComponentImplementationTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/NoComponentImplementationTestCase.java new file mode 100644 index 0000000000..100a6c2011 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/NoComponentImplementationTestCase.java @@ -0,0 +1,69 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package calculator.warning; + +import java.io.File; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.UtilityExtensionPoint; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.MonitorFactory; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import org.apache.tuscany.sca.node.SCANode2; +import org.apache.tuscany.sca.node.SCANode2Factory; +import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution; +import org.apache.tuscany.sca.node.impl.NodeImpl; + +import calculator.warning.CalculatorService; + +/** + * This shows how to test the Calculator service component. + */ +public class NoComponentImplementationTestCase extends TestCase { + + private CalculatorService calculatorService; + private SCANode2 node; + + @Override + protected void setUp() throws Exception { + SCANode2Factory nodeFactory = SCANode2Factory.newInstance(); + node = nodeFactory.createSCANode(new File("src/main/resources/NoComponentImplementation/Calculator.composite").toURL().toString(), + new SCAContribution("TestContribution", + new File("src/main/resources/NoComponentImplementation").toURL().toString())); + } + + @Override + protected void tearDown() throws Exception { + } + + public void testCalculator() throws Exception { + ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry(); + UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class); + MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class); + Monitor monitor = monitorFactory.createMonitor(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("NoComponentImplementation", problem.getMessageId()); + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/NoCompositeNamespaceTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/NoCompositeNamespaceTestCase.java new file mode 100644 index 0000000000..53d1136065 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/NoCompositeNamespaceTestCase.java @@ -0,0 +1,73 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package calculator.warning; + +import java.io.File; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.UtilityExtensionPoint; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.MonitorFactory; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode2; +import org.apache.tuscany.sca.node.SCANode2Factory; +import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution; +import org.apache.tuscany.sca.node.impl.NodeImpl; + +import calculator.warning.CalculatorService; + +/** + * This shows how to test the Calculator service component. + */ +public class NoCompositeNamespaceTestCase extends TestCase { + + private CalculatorService calculatorService; + private SCANode2 node; + + @Override + protected void setUp() throws Exception { + SCANode2Factory nodeFactory = SCANode2Factory.newInstance(); + node = nodeFactory.createSCANode(new File("src/main/resources/NoCompositeNamespace/Calculator.composite").toURL().toString(), + new SCAContribution("TestContribution", + new File("src/main/resources/NoCompositeNamespace").toURL().toString())); + node.start(); + calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent"); + } + + @Override + protected void tearDown() throws Exception { + node.stop(); + } + + public void testCalculator() throws Exception { + ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry(); + UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class); + MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class); + Monitor monitor = monitorFactory.createMonitor(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("NoCompositeNamespace", problem.getMessageId()); + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/NoMatchingBindingTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/NoMatchingBindingTestCase.java new file mode 100644 index 0000000000..700e550467 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/NoMatchingBindingTestCase.java @@ -0,0 +1,81 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package calculator.warning; + +import java.io.File; + +import junit.framework.Assert; +import junit.framework.TestCase; + +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.UtilityExtensionPoint; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.MonitorFactory; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode2; +import org.apache.tuscany.sca.node.SCANode2Factory; +import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution; +import org.apache.tuscany.sca.node.impl.NodeImpl; + +/** + * This shows how to test the Calculator service component. + */ +public class NoMatchingBindingTestCase extends TestCase { + + private CalculatorService calculatorService; + private SCANode2 node; + + @Override + protected void setUp() throws Exception { + try { + SCANode2Factory nodeFactory = SCANode2Factory.newInstance(); + node = nodeFactory.createSCANode(new File("src/main/resources/NoMatchingBinding/Calculator.composite").toURL().toString(), + new SCAContribution("TestContribution", + new File("src/main/resources/NoMatchingBinding").toURL().toString())); + + node.start(); + calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent"); + } catch (Exception ex){ + // do nothing + return; + } + Assert.fail(); + } + + @Override + protected void tearDown() throws Exception { + node.stop(); + } + + public void testCalculator() throws Exception { + /* + ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry(); + UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class); + MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class); + Monitor monitor = monitorFactory.createMonitor(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("NoMatchingBinding", problem.getMessageId()); + */ + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/PromotedReferenceNotFoundTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/PromotedReferenceNotFoundTestCase.java new file mode 100644 index 0000000000..0c14651b16 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/PromotedReferenceNotFoundTestCase.java @@ -0,0 +1,73 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package calculator.warning; + +import java.io.File; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.UtilityExtensionPoint; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.MonitorFactory; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode2; +import org.apache.tuscany.sca.node.SCANode2Factory; +import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution; +import org.apache.tuscany.sca.node.impl.NodeImpl; + +import calculator.warning.CalculatorService; + +/** + * This shows how to test the Calculator service component. + */ +public class PromotedReferenceNotFoundTestCase extends TestCase { + + private CalculatorService calculatorService; + private SCANode2 node; + + @Override + protected void setUp() throws Exception { + SCANode2Factory nodeFactory = SCANode2Factory.newInstance(); + node = nodeFactory.createSCANode(new File("src/main/resources/PromotedReferenceNotFound/Calculator.composite").toURL().toString(), + new SCAContribution("TestContribution", + new File("src/main/resources/PromotedReferenceNotFound").toURL().toString())); + node.start(); + calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent"); + } + + @Override + protected void tearDown() throws Exception { + node.stop(); + } + + public void testCalculator() throws Exception { + ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry(); + UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class); + MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class); + Monitor monitor = monitorFactory.createMonitor(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("PromotedReferenceNotFound", problem.getMessageId()); + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/PromotedServiceNotFoundTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/PromotedServiceNotFoundTestCase.java new file mode 100644 index 0000000000..dc384c8047 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/PromotedServiceNotFoundTestCase.java @@ -0,0 +1,73 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package calculator.warning; + +import java.io.File; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.UtilityExtensionPoint; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.MonitorFactory; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode2; +import org.apache.tuscany.sca.node.SCANode2Factory; +import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution; +import org.apache.tuscany.sca.node.impl.NodeImpl; + +import calculator.warning.CalculatorService; + +/** + * This shows how to test the Calculator service component. + */ +public class PromotedServiceNotFoundTestCase extends TestCase { + + private CalculatorService calculatorService; + private SCANode2 node; + + @Override + protected void setUp() throws Exception { + SCANode2Factory nodeFactory = SCANode2Factory.newInstance(); + node = nodeFactory.createSCANode(new File("src/main/resources/PromotedServiceNotFound/Calculator.composite").toURL().toString(), + new SCAContribution("TestContribution", + new File("src/main/resources/PromotedServiceNotFound").toURL().toString())); + node.start(); + calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent"); + } + + @Override + protected void tearDown() throws Exception { + node.stop(); + } + + public void testCalculator() throws Exception { + ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry(); + UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class); + MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class); + Monitor monitor = monitorFactory.createMonitor(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("PromotedServiceNotFound", problem.getMessageId()); + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/PropertyAttributeMustSupplyNullTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/PropertyAttributeMustSupplyNullTestCase.java new file mode 100644 index 0000000000..3435befd97 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/PropertyAttributeMustSupplyNullTestCase.java @@ -0,0 +1,73 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package calculator.warning; + +import java.io.File; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.UtilityExtensionPoint; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.MonitorFactory; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode2; +import org.apache.tuscany.sca.node.SCANode2Factory; +import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution; +import org.apache.tuscany.sca.node.impl.NodeImpl; + +import calculator.warning.CalculatorService; + +/** + * This shows how to test the Calculator service component. + */ +public class PropertyAttributeMustSupplyNullTestCase extends TestCase { + + private CalculatorService calculatorService; + private SCANode2 node; + + @Override + protected void setUp() throws Exception { + SCANode2Factory nodeFactory = SCANode2Factory.newInstance(); + node = nodeFactory.createSCANode(new File("src/main/resources/PropertyAttribute/CalculatorNullMustSupply.composite").toURL().toString(), + new SCAContribution("TestContribution", + new File("src/main/resources/PropertyAttribute").toURL().toString())); + node.start(); + calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent"); + } + + @Override + protected void tearDown() throws Exception { + node.stop(); + } + + public void testCalculator() throws Exception { + ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry(); + UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class); + MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class); + Monitor monitor = monitorFactory.createMonitor(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("PropertyMustSupplyNull", problem.getMessageId()); + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/PropertyAttributeTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/PropertyAttributeTestCase.java new file mode 100644 index 0000000000..aea571fead --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/PropertyAttributeTestCase.java @@ -0,0 +1,73 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package calculator.warning; + +import java.io.File; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.UtilityExtensionPoint; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.MonitorFactory; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode2; +import org.apache.tuscany.sca.node.SCANode2Factory; +import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution; +import org.apache.tuscany.sca.node.impl.NodeImpl; + +import calculator.warning.CalculatorService; + +/** + * This shows how to test the Calculator service component. + */ +public class PropertyAttributeTestCase extends TestCase { + + private CalculatorService calculatorService; + private SCANode2 node; + + @Override + protected void setUp() throws Exception { + SCANode2Factory nodeFactory = SCANode2Factory.newInstance(); + node = nodeFactory.createSCANode(new File("src/main/resources/PropertyAttribute/Calculator.composite").toURL().toString(), + new SCAContribution("TestContribution", + new File("src/main/resources/PropertyAttribute").toURL().toString())); + node.start(); + calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent"); + } + + @Override + protected void tearDown() throws Exception { + node.stop(); + } + + public void testCalculator() throws Exception { + ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry(); + UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class); + MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class); + Monitor monitor = monitorFactory.createMonitor(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("PropertyMustSupplyIncompatible", problem.getMessageId()); + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/PropertyNotFoundTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/PropertyNotFoundTestCase.java new file mode 100644 index 0000000000..5a1554976c --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/PropertyNotFoundTestCase.java @@ -0,0 +1,73 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package calculator.warning; + +import java.io.File; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.UtilityExtensionPoint; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.MonitorFactory; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode2; +import org.apache.tuscany.sca.node.SCANode2Factory; +import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution; +import org.apache.tuscany.sca.node.impl.NodeImpl; + +import calculator.warning.CalculatorService; + +/** + * This shows how to test the Calculator service component. + */ +public class PropertyNotFoundTestCase extends TestCase { + + private CalculatorService calculatorService; + private SCANode2 node; + + @Override + protected void setUp() throws Exception { + SCANode2Factory nodeFactory = SCANode2Factory.newInstance(); + node = nodeFactory.createSCANode(new File("src/main/resources/PropertyNotFound/Calculator.composite").toURL().toString(), + new SCAContribution("TestContribution", + new File("src/main/resources/PropertyNotFound").toURL().toString())); + node.start(); + calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent"); + } + + @Override + protected void tearDown() throws Exception { + node.stop(); + } + + public void testCalculator() throws Exception { + ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry(); + UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class); + MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class); + Monitor monitor = monitorFactory.createMonitor(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("PropertyNotFound", problem.getMessageId()); + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/PropertyOverrideManyAttributeTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/PropertyOverrideManyAttributeTestCase.java new file mode 100644 index 0000000000..22d70042aa --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/PropertyOverrideManyAttributeTestCase.java @@ -0,0 +1,73 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package calculator.warning; + +import java.io.File; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.UtilityExtensionPoint; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.MonitorFactory; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode2; +import org.apache.tuscany.sca.node.SCANode2Factory; +import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution; +import org.apache.tuscany.sca.node.impl.NodeImpl; + +import calculator.warning.CalculatorService; + +/** + * This shows how to test the Calculator service component. + */ +public class PropertyOverrideManyAttributeTestCase extends TestCase { + + private CalculatorService calculatorService; + private SCANode2 node; + + @Override + protected void setUp() throws Exception { + SCANode2Factory nodeFactory = SCANode2Factory.newInstance(); + node = nodeFactory.createSCANode(new File("src/main/resources/PropertyAttribute/CalculatorOverrideManyAttribute.composite").toURL().toString(), + new SCAContribution("TestContribution", + new File("src/main/resources/PropertyAttribute").toURL().toString())); + node.start(); + calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent"); + } + + @Override + protected void tearDown() throws Exception { + node.stop(); + } + + public void testCalculator() throws Exception { + ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry(); + UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class); + MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class); + Monitor monitor = monitorFactory.createMonitor(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("PropertyOverrideManyAttribute", problem.getMessageId()); + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/ReferenceIncompatibleComponentInterfaceTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/ReferenceIncompatibleComponentInterfaceTestCase.java new file mode 100644 index 0000000000..c7b691810b --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/ReferenceIncompatibleComponentInterfaceTestCase.java @@ -0,0 +1,73 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package calculator.warning; + +import java.io.File; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.UtilityExtensionPoint; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.MonitorFactory; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode2; +import org.apache.tuscany.sca.node.SCANode2Factory; +import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution; +import org.apache.tuscany.sca.node.impl.NodeImpl; + +import calculator.warning.CalculatorService; + +/** + * This shows how to test the Calculator service component. + */ +public class ReferenceIncompatibleComponentInterfaceTestCase extends TestCase { + + private CalculatorService calculatorService; + private SCANode2 node; + + @Override + protected void setUp() throws Exception { + SCANode2Factory nodeFactory = SCANode2Factory.newInstance(); + node = nodeFactory.createSCANode(new File("src/main/resources/ReferenceIncompatibleComponentInterface/Calculator.composite").toURL().toString(), + new SCAContribution("TestContribution", + new File("src/main/resources/ReferenceIncompatibleComponentInterface").toURL().toString())); + node.start(); + calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent"); + } + + @Override + protected void tearDown() throws Exception { + node.stop(); + } + + public void testCalculator() throws Exception { + ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry(); + UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class); + MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class); + Monitor monitor = monitorFactory.createMonitor(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("ReferenceIncompatibleComponentInterface", problem.getMessageId()); + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/ReferenceIncompatibleInterfaceTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/ReferenceIncompatibleInterfaceTestCase.java new file mode 100644 index 0000000000..170e4ff801 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/ReferenceIncompatibleInterfaceTestCase.java @@ -0,0 +1,73 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package calculator.warning; + +import java.io.File; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.UtilityExtensionPoint; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.MonitorFactory; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode2; +import org.apache.tuscany.sca.node.SCANode2Factory; +import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution; +import org.apache.tuscany.sca.node.impl.NodeImpl; + +import calculator.warning.CalculatorService; + +/** + * This shows how to test the Calculator service component. + */ +public class ReferenceIncompatibleInterfaceTestCase extends TestCase { + + private CalculatorService calculatorService; + private SCANode2 node; + + @Override + protected void setUp() throws Exception { + SCANode2Factory nodeFactory = SCANode2Factory.newInstance(); + node = nodeFactory.createSCANode(new File("src/main/resources/ReferenceIncompatibleInterface/Calculator.composite").toURL().toString(), + new SCAContribution("TestContribution", + new File("src/main/resources/ReferenceIncompatibleInterface").toURL().toString())); + node.start(); + calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent"); + } + + @Override + protected void tearDown() throws Exception { + node.stop(); + } + + public void testCalculator() throws Exception { + ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry(); + UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class); + MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class); + Monitor monitor = monitorFactory.createMonitor(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("ReferenceIncompatibleInterface", problem.getMessageId()); + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/ReferenceIncompatibleMultiplicityTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/ReferenceIncompatibleMultiplicityTestCase.java new file mode 100644 index 0000000000..4d4adfbf32 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/ReferenceIncompatibleMultiplicityTestCase.java @@ -0,0 +1,73 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package calculator.warning; + +import java.io.File; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.UtilityExtensionPoint; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.MonitorFactory; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode2; +import org.apache.tuscany.sca.node.SCANode2Factory; +import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution; +import org.apache.tuscany.sca.node.impl.NodeImpl; + +import calculator.warning.CalculatorService; + +/** + * This shows how to test the Calculator service component. + */ +public class ReferenceIncompatibleMultiplicityTestCase extends TestCase { + + private CalculatorService calculatorService; + private SCANode2 node; + + @Override + protected void setUp() throws Exception { + SCANode2Factory nodeFactory = SCANode2Factory.newInstance(); + node = nodeFactory.createSCANode(new File("src/main/resources/ReferenceIncompatibleMultiplicity/Calculator.composite").toURL().toString(), + new SCAContribution("TestContribution", + new File("src/main/resources/ReferenceIncompatibleMultiplicity").toURL().toString())); + node.start(); + calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent"); + } + + @Override + protected void tearDown() throws Exception { + node.stop(); + } + + public void testCalculator() throws Exception { + ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry(); + UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class); + MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class); + Monitor monitor = monitorFactory.createMonitor(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("ReferenceIncompatibleMultiplicity", problem.getMessageId()); + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/ReferenceNotFoundTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/ReferenceNotFoundTestCase.java new file mode 100644 index 0000000000..2c239bb003 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/ReferenceNotFoundTestCase.java @@ -0,0 +1,73 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package calculator.warning; + +import java.io.File; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.UtilityExtensionPoint; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.MonitorFactory; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode2; +import org.apache.tuscany.sca.node.SCANode2Factory; +import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution; +import org.apache.tuscany.sca.node.impl.NodeImpl; + +import calculator.warning.CalculatorService; + +/** + * This shows how to test the Calculator service component. + */ +public class ReferenceNotFoundTestCase extends TestCase { + + private CalculatorService calculatorService; + private SCANode2 node; + + @Override + protected void setUp() throws Exception { + SCANode2Factory nodeFactory = SCANode2Factory.newInstance(); + node = nodeFactory.createSCANode(new File("src/main/resources/ReferenceNotFound/Calculator.composite").toURL().toString(), + new SCAContribution("TestContribution", + new File("src/main/resources/ReferenceNotFound").toURL().toString())); + node.start(); + calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent"); + } + + @Override + protected void tearDown() throws Exception { + node.stop(); + } + + public void testCalculator() throws Exception { + ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry(); + UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class); + MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class); + Monitor monitor = monitorFactory.createMonitor(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("ReferenceNotFound", problem.getMessageId()); + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/ReferenceWithoutTargetsTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/ReferenceWithoutTargetsTestCase.java new file mode 100644 index 0000000000..a8fb1d07cf --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/ReferenceWithoutTargetsTestCase.java @@ -0,0 +1,73 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package calculator.warning; + +import java.io.File; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.UtilityExtensionPoint; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.MonitorFactory; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode2; +import org.apache.tuscany.sca.node.SCANode2Factory; +import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution; +import org.apache.tuscany.sca.node.impl.NodeImpl; + +import calculator.warning.CalculatorService; + +/** + * This shows how to test the Calculator service component. + */ +public class ReferenceWithoutTargetsTestCase extends TestCase { + + private CalculatorService calculatorService; + private SCANode2 node; + + @Override + protected void setUp() throws Exception { + SCANode2Factory nodeFactory = SCANode2Factory.newInstance(); + node = nodeFactory.createSCANode(new File("src/main/resources/ReferenceWithoutTargets/Calculator.composite").toURL().toString(), + new SCAContribution("TestContribution", + new File("src/main/resources/ReferenceWithoutTargets").toURL().toString())); + node.start(); + calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent"); + } + + @Override + protected void tearDown() throws Exception { + node.stop(); + } + + public void testCalculator() throws Exception { + ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry(); + UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class); + MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class); + Monitor monitor = monitorFactory.createMonitor(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("ReferenceWithoutTargets", problem.getMessageId()); + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/ServiceNotFoundForComponentServiceTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/ServiceNotFoundForComponentServiceTestCase.java new file mode 100644 index 0000000000..9ea6d8915a --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/ServiceNotFoundForComponentServiceTestCase.java @@ -0,0 +1,73 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package calculator.warning; + +import java.io.File; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.UtilityExtensionPoint; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.MonitorFactory; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode2; +import org.apache.tuscany.sca.node.SCANode2Factory; +import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution; +import org.apache.tuscany.sca.node.impl.NodeImpl; + +import calculator.warning.CalculatorService; + +/** + * This shows how to test the Calculator service component. + */ +public class ServiceNotFoundForComponentServiceTestCase extends TestCase { + + private CalculatorService calculatorService; + private SCANode2 node; + + @Override + protected void setUp() throws Exception { + SCANode2Factory nodeFactory = SCANode2Factory.newInstance(); + node = nodeFactory.createSCANode(new File("src/main/resources/ServiceNotFoundForComponentService/Calculator.composite").toURL().toString(), + new SCAContribution("TestContribution", + new File("src/main/resources/ServiceNotFoundForComponentService").toURL().toString())); + node.start(); + calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent"); + } + + @Override + protected void tearDown() throws Exception { + node.stop(); + } + + public void testCalculator() throws Exception { + ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry(); + UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class); + MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class); + Monitor monitor = monitorFactory.createMonitor(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("ServiceNotFoundForComponentService", problem.getMessageId()); + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/UnresolvedComponentImplementationTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/UnresolvedComponentImplementationTestCase.java new file mode 100644 index 0000000000..268a8539e1 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/UnresolvedComponentImplementationTestCase.java @@ -0,0 +1,69 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package calculator.warning; + +import java.io.File; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.UtilityExtensionPoint; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.MonitorFactory; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import org.apache.tuscany.sca.node.SCANode2; +import org.apache.tuscany.sca.node.SCANode2Factory; +import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution; +import org.apache.tuscany.sca.node.impl.NodeImpl; + +import calculator.warning.CalculatorService; + +/** + * This shows how to test the Calculator service component. + */ +public class UnresolvedComponentImplementationTestCase extends TestCase { + + private CalculatorService calculatorService; + private SCANode2 node; + + @Override + protected void setUp() throws Exception { + SCANode2Factory nodeFactory = SCANode2Factory.newInstance(); + node = nodeFactory.createSCANode(new File("src/main/resources/UnresolvedComponentImplementation/Calculator.composite").toURL().toString(), + new SCAContribution("TestContribution", + new File("src/main/resources/UnresolvedComponentImplementation").toURL().toString())); + } + + @Override + protected void tearDown() throws Exception { + } + + public void testCalculator() throws Exception { + ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry(); + UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class); + MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class); + Monitor monitor = monitorFactory.createMonitor(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("UnresolvedComponentImplementation", problem.getMessageId()); + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/XSDValidationTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/XSDValidationTestCase.java new file mode 100644 index 0000000000..53296fb2be --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/calculator/warning/XSDValidationTestCase.java @@ -0,0 +1,86 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package calculator.warning; + +import java.io.File; + +import junit.framework.Assert; +import junit.framework.TestCase; + +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.UtilityExtensionPoint; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.MonitorFactory; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode2; +import org.apache.tuscany.sca.node.SCANode2Factory; +import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution; +import org.apache.tuscany.sca.node.impl.NodeImpl; +import org.osoa.sca.ServiceRuntimeException; + +import calculator.warning.CalculatorService; + +/** + * This shows how to test the Calculator service component. + */ +public class XSDValidationTestCase extends TestCase { + + private CalculatorService calculatorService; + private SCANode2 node; + + @Override + protected void setUp() throws Exception { + SCANode2Factory nodeFactory = SCANode2Factory.newInstance(); + try { + node = nodeFactory.createSCANode(new File("src/main/resources/XsdValidation/Calculator.composite").toURL().toString(), + new SCAContribution("TestContribution", + new File("src/main/resources/XsdValidation").toURL().toString())); + node.start(); + calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent"); + } catch (Exception ex){ + // do nothing + return; + } + Assert.fail(); + } + + @Override + protected void tearDown() throws Exception { + if (node != null){ + node.stop(); + } + } + + + public void testCalculator() throws Exception { + /* + ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry(); + UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class); + MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class); + Monitor monitor = monitorFactory.createMonitor(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("SchemaError", problem.getMessageId()); + */ + } + +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/contribution/java/AttributePackageMissingTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/contribution/java/AttributePackageMissingTestCase.java new file mode 100644 index 0000000000..32d6dcd7da --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/contribution/java/AttributePackageMissingTestCase.java @@ -0,0 +1,60 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package contribution.java; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; + +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class AttributePackageMissingTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/contribution/java/AttributePackageMissing/Calculator.composite", + "TestContribution", "src/main/resources/contribution/java/AttributePackageMissing/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("AttributePackageMissing", problem.getMessageId()); + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/contribution/namespace/AttributeNameSpaceMissingTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/contribution/namespace/AttributeNameSpaceMissingTestCase.java new file mode 100644 index 0000000000..efd651e92b --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/contribution/namespace/AttributeNameSpaceMissingTestCase.java @@ -0,0 +1,60 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package contribution.namespace; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; + +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class AttributeNameSpaceMissingTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/contribution/namespace/AttributeNameSpaceMissing/Calculator.composite", + "TestContribution", "src/main/resources/contribution/namespace/AttributeNameSpaceMissing/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("AttributeNameSpaceMissing", problem.getMessageId()); + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/contribution/resource/AttributeURIMissingTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/contribution/resource/AttributeURIMissingTestCase.java new file mode 100644 index 0000000000..956324aff2 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/contribution/resource/AttributeURIMissingTestCase.java @@ -0,0 +1,60 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package contribution.resource; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; + +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class AttributeURIMissingTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/contribution/resource/AttributeURIMissing/Calculator.composite", + "TestContribution", "src/main/resources/contribution/resource/AttributeURIMissing/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("AttributeURIMissing", problem.getMessageId()); + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/contribution/xml/AttributeCompositeMissingTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/contribution/xml/AttributeCompositeMissingTestCase.java new file mode 100644 index 0000000000..27cdc99c16 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/contribution/xml/AttributeCompositeMissingTestCase.java @@ -0,0 +1,60 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package contribution.xml; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; + +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class AttributeCompositeMissingTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/contribution/xml/AttributeCompositeMissing/Calculator.composite", + "TestContribution", "src/main/resources/contribution/xml/AttributeCompositeMissing/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("AttributeCompositeMissing", problem.getMessageId()); + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/domain/CustomCompositeBuilder.java b/sandbox/axis2-1.4/itest/validation/src/test/java/domain/CustomCompositeBuilder.java new file mode 100644 index 0000000000..3ed8103d9f --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/domain/CustomCompositeBuilder.java @@ -0,0 +1,215 @@ +package domain; + +import java.io.File; +import java.net.URI; +import java.net.URL; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLOutputFactory; + +import org.apache.tuscany.sca.assembly.AssemblyFactory; +import org.apache.tuscany.sca.assembly.SCABindingFactory; +import org.apache.tuscany.sca.assembly.builder.CompositeBuilder; +import org.apache.tuscany.sca.assembly.builder.impl.CompositeBuilderImpl; +import org.apache.tuscany.sca.context.ContextFactoryExtensionPoint; +import org.apache.tuscany.sca.context.DefaultContextFactoryExtensionPoint; +import org.apache.tuscany.sca.contribution.Contribution; +import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; +import org.apache.tuscany.sca.contribution.processor.DefaultValidatingXMLInputFactory; +import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor; +import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; +import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint; +import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor; +import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessorExtensionPoint; +import org.apache.tuscany.sca.contribution.processor.ValidationSchemaExtensionPoint; +import org.apache.tuscany.sca.contribution.resolver.ExtensibleModelResolver; +import org.apache.tuscany.sca.contribution.resolver.ModelResolverExtensionPoint; +import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry; +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.ModuleActivator; +import org.apache.tuscany.sca.core.ModuleActivatorExtensionPoint; +import org.apache.tuscany.sca.core.UtilityExtensionPoint; +import org.apache.tuscany.sca.core.invocation.DefaultProxyFactoryExtensionPoint; +import org.apache.tuscany.sca.core.invocation.MessageFactoryImpl; +import org.apache.tuscany.sca.core.invocation.ProxyFactory; +import org.apache.tuscany.sca.implementation.node.NodeImplementationFactory; +import org.apache.tuscany.sca.implementation.node.builder.impl.NodeCompositeBuilderImpl; +import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper; +import org.apache.tuscany.sca.interfacedef.impl.InterfaceContractMapperImpl; +import org.apache.tuscany.sca.invocation.MessageFactory; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.MonitorFactory; +import org.apache.tuscany.sca.policy.IntentAttachPointTypeFactory; +import org.apache.tuscany.sca.workspace.Workspace; +import org.apache.tuscany.sca.workspace.WorkspaceFactory; +import org.apache.tuscany.sca.workspace.builder.ContributionDependencyBuilder; +import org.apache.tuscany.sca.workspace.builder.impl.ContributionDependencyBuilderImpl; +import org.apache.tuscany.sca.definitions.SCADefinitions; + +public class CustomCompositeBuilder { + private URLArtifactProcessor contributionProcessor; + private ModelResolverExtensionPoint modelResolvers; + private ModelFactoryExtensionPoint modelFactories; + private WorkspaceFactory workspaceFactory; + private AssemblyFactory assemblyFactory; + private XMLOutputFactory outputFactory; + private StAXArtifactProcessor xmlProcessor; + private ContributionDependencyBuilder contributionDependencyBuilder; + private CompositeBuilder domainCompositeBuilder; + private CompositeBuilder nodeCompositeBuilder; + private NodeImplementationFactory nodeFactory; + //private AtomBindingFactory atomBindingFactory; + private static Workspace workspace; + private List policyDefinitions; + private Monitor monitor; + + private CustomCompositeBuilder() { + // no code req'd + } + + public static CustomCompositeBuilder getInstance() + { + if (ref == null) + ref = new CustomCompositeBuilder(); + return ref; + } + + private static CustomCompositeBuilder ref; + + private void init() { + + // Create extension point registry + ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry(); + + // Create a monitor + UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class); + MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class); + monitor = monitorFactory.createMonitor(); + + // Create an interface contract mapper + InterfaceContractMapper mapper = new InterfaceContractMapperImpl(); + extensionPoints.addExtensionPoint(mapper); + + // Create Message factory + MessageFactory messageFactory = new MessageFactoryImpl(); + + // Create Proxy factory + ProxyFactory proxyFactory = new DefaultProxyFactoryExtensionPoint(messageFactory, mapper); + extensionPoints.addExtensionPoint(proxyFactory); + + // Create context factory extension point + ContextFactoryExtensionPoint contextFactories = new DefaultContextFactoryExtensionPoint(extensionPoints); + extensionPoints.addExtensionPoint(contextFactories); + + // Initialize the Tuscany module activators + ModuleActivatorExtensionPoint moduleActivators = extensionPoints.getExtensionPoint(ModuleActivatorExtensionPoint.class); + for (ModuleActivator activator: moduleActivators.getModuleActivators()) { + activator.start(extensionPoints); + } + + // Get XML input/output factories + modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class); + XMLInputFactory inputFactory = modelFactories.getFactory(XMLInputFactory.class); + outputFactory = modelFactories.getFactory(XMLOutputFactory.class); + + modelFactories.addFactory(messageFactory); + + // Get contribution workspace and assembly model factories + workspaceFactory = modelFactories.getFactory(WorkspaceFactory.class); + assemblyFactory = modelFactories.getFactory(AssemblyFactory.class); + nodeFactory = modelFactories.getFactory(NodeImplementationFactory.class); + //atomBindingFactory = modelFactories.getFactory(AtomBindingFactory.class); + + // Create XML artifact processors + StAXArtifactProcessorExtensionPoint xmlProcessorExtensions = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class); + xmlProcessor = new ExtensibleStAXArtifactProcessor(xmlProcessorExtensions, inputFactory, outputFactory, monitor); + + // Create contribution content processor + URLArtifactProcessorExtensionPoint docProcessorExtensions = extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class); + contributionProcessor = docProcessorExtensions.getProcessor(Contribution.class); + + // Get the model resolvers + modelResolvers = extensionPoints.getExtensionPoint(ModelResolverExtensionPoint.class); + + // Create a contribution dependency builder + contributionDependencyBuilder = new ContributionDependencyBuilderImpl(monitor); + + // Create a composite builder + SCABindingFactory scaBindingFactory = modelFactories.getFactory(SCABindingFactory.class); + IntentAttachPointTypeFactory attachPointTypeFactory = modelFactories.getFactory(IntentAttachPointTypeFactory.class); + InterfaceContractMapper contractMapper = utilities.getUtility(InterfaceContractMapper.class); + domainCompositeBuilder = new CompositeBuilderImpl(assemblyFactory, scaBindingFactory, attachPointTypeFactory, contractMapper, monitor); + + // Create a node composite builder + nodeCompositeBuilder = new NodeCompositeBuilderImpl(assemblyFactory, scaBindingFactory, contractMapper, null, monitor); + } + + public void loadContribution(String compositeURL, String sourceURI, String sourceURL) throws Exception { + init(); + + // Create workspace model + workspace = workspaceFactory.createWorkspace(); + workspace.setModelResolver(new ExtensibleModelResolver(workspace, modelResolvers, modelFactories)); + + // Read the sample store contribution + URI artifactURI = URI.create(sourceURI); + //URL contributionURL = FileHelper.toFile(new URL(sourceURL)).toURI().toURL(); + URL artifactURL = new File(sourceURL).toURI().toURL(); + URL contributionURL = new File(compositeURL).toURI().toURL(); + Contribution storeContribution = contributionProcessor.read(contributionURL, artifactURI, artifactURL); + workspace.getContributions().add(storeContribution); + + // Build the contribution dependencies + Map> contributionDependencies = new HashMap>(); + Set resolved = new HashSet(); + for (Contribution contribution: workspace.getContributions()) { + List dependencies = contributionDependencyBuilder.buildContributionDependencies(contribution, workspace); + + // Resolve contributions + for (Contribution dependency: dependencies) { + if (!resolved.contains(dependency)) { + resolved.add(dependency); + contributionProcessor.resolve(dependency, workspace.getModelResolver()); + } + } + + contributionDependencies.put(contribution, dependencies); + } + + // Create a composite model for the domain + /*Composite domainComposite = assemblyFactory.createComposite(); + domainComposite.setName(new QName(Constants.SCA10_NS, "domain")); + + // Add all deployables to it, normally the domain administrator would select + // the deployables to include + domainComposite.getIncludes().addAll(workspace.getDeployables()); + + // Build the domain composite and wire the components included in it + domainCompositeBuilder.build(domainComposite);*/ + } + + public Monitor getMonitorInstance() { + return monitor; + } + + public void readContribution(String compositeURL, String sourceURI, String sourceURL) throws Exception { + init(); + + // Create workspace model + workspace = workspaceFactory.createWorkspace(); + workspace.setModelResolver(new ExtensibleModelResolver(workspace, modelResolvers, modelFactories)); + + // Read the sample store contribution + URI artifactURI = URI.create(sourceURI); + //URL contributionURL = FileHelper.toFile(new URL(sourceURL)).toURI().toURL(); + URL artifactURL = new File(sourceURL).toURI().toURL(); + URL contributionURL = new File(compositeURL).toURI().toURL(); + Contribution storeContribution = contributionProcessor.read(contributionURL, artifactURI, artifactURL); + workspace.getContributions().add(storeContribution); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/impl/bpel/AttributeUnrecognizedNamespaceTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/bpel/AttributeUnrecognizedNamespaceTestCase.java new file mode 100644 index 0000000000..f38432fe6d --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/bpel/AttributeUnrecognizedNamespaceTestCase.java @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package impl.bpel; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; + +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class AttributeUnrecognizedNamespaceTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/impl/bpel/AttributeUnrecognizedNamespace/helloworld.composite", + "TestContribution", "src/main/resources/impl/bpel/AttributeUnrecognizedNamespace/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //nothing to do + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("AttributeUnrecognizedNamespace", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/impl/bpel/AttributeWithoutNamespaceTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/bpel/AttributeWithoutNamespaceTestCase.java new file mode 100644 index 0000000000..767744ba73 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/bpel/AttributeWithoutNamespaceTestCase.java @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package impl.bpel; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; + +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class AttributeWithoutNamespaceTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/impl/bpel/AttributeWithoutNamespace/helloworld.composite", + "TestContribution", "src/main/resources/impl/bpel/AttributeWithoutNamespace/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //nothing to do + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("AttributeWithoutNamespace", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/impl/bpel/BPELProcessNotFoundTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/bpel/BPELProcessNotFoundTestCase.java new file mode 100644 index 0000000000..3a0af571fe --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/bpel/BPELProcessNotFoundTestCase.java @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package impl.bpel; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; + +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class BPELProcessNotFoundTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/impl/bpel/BPELProcessNotFound/helloworld.composite", + "TestContribution", "src/main/resources/impl/bpel/BPELProcessNotFound/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //nothing to do + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("BPELProcessNotFound", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/impl/bpel/CannotResolveWSDLReferenceTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/bpel/CannotResolveWSDLReferenceTestCase.java new file mode 100644 index 0000000000..a3e19103e3 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/bpel/CannotResolveWSDLReferenceTestCase.java @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package impl.bpel; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; + +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class CannotResolveWSDLReferenceTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/impl/bpel/CannotResolveWSDLReference/helloworld.composite", + "TestContribution", "src/main/resources/impl/bpel/CannotResolveWSDLReference/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //nothing to do + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("CannotResolveWSDLReference", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/impl/bpel/MyRolePartnerRoleNullTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/bpel/MyRolePartnerRoleNullTestCase.java new file mode 100644 index 0000000000..d08f8c0ce1 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/bpel/MyRolePartnerRoleNullTestCase.java @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package impl.bpel; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; + +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class MyRolePartnerRoleNullTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/impl/bpel/MyRolePartnerRoleNull/helloworld.composite", + "TestContribution", "src/main/resources/impl/bpel/MyRolePartnerRoleNull/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //nothing to do + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("MyRolePartnerRoleNull", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/impl/bpel/PartnerLinkHasBothAttrTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/bpel/PartnerLinkHasBothAttrTestCase.java new file mode 100644 index 0000000000..3323f4281f --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/bpel/PartnerLinkHasBothAttrTestCase.java @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package impl.bpel; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; + +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class PartnerLinkHasBothAttrTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/impl/bpel/PartnerLinkHasBothAttr/helloworld.composite", + "TestContribution", "src/main/resources/impl/bpel/PartnerLinkHasBothAttr/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //nothing to do + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("PartnerLinkHasBothAttr", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/impl/bpel/PartnerLinkNoMatchingTypeTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/bpel/PartnerLinkNoMatchingTypeTestCase.java new file mode 100644 index 0000000000..4981105395 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/bpel/PartnerLinkNoMatchingTypeTestCase.java @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package impl.bpel; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; + +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class PartnerLinkNoMatchingTypeTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/impl/bpel/PartnerLinkNoMatchingType/helloworld.composite", + "TestContribution", "src/main/resources/impl/bpel/PartnerLinkNoMatchingType/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //nothing to do + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("PartnerLinkNoMatchingType", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/impl/bpel/PartnerLinkTypeNoRolesTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/bpel/PartnerLinkTypeNoRolesTestCase.java new file mode 100644 index 0000000000..003d4f523c --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/bpel/PartnerLinkTypeNoRolesTestCase.java @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package impl.bpel; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; + +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class PartnerLinkTypeNoRolesTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/impl/bpel/PartnerLinkTypeNoRoles/helloworld.composite", + "TestContribution", "src/main/resources/impl/bpel/PartnerLinkTypeNoRoles/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //nothing to do + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("PartnerLinkTypeNoRoles", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/impl/java/ClassNotFoundExceptionTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/java/ClassNotFoundExceptionTestCase.java new file mode 100644 index 0000000000..97fe84eb0b --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/java/ClassNotFoundExceptionTestCase.java @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package impl.java; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; + +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class ClassNotFoundExceptionTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/impl/java/ClassNotFoundException/Calculator.composite", + "TestContribution", "src/main/resources/impl/java/ClassNotFoundException/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //nothing to do + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("ClassNotFoundException", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/impl/java/ContributionResolveExceptionTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/java/ContributionResolveExceptionTestCase.java new file mode 100644 index 0000000000..7bd1ab6233 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/java/ContributionResolveExceptionTestCase.java @@ -0,0 +1,60 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package impl.java; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; + +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class ContributionResolveExceptionTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/impl/java/ContributionResolveException/Calculator.composite", + "TestContribution", "src/main/resources/impl/java/ContributionResolveException/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //nothing to do + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + + assertNotNull(problem); + assertEquals("ContributionResolveException", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/impl/osgi/CouldNotLocateOSGiBundleTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/osgi/CouldNotLocateOSGiBundleTestCase.java new file mode 100644 index 0000000000..70b9bd1b45 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/osgi/CouldNotLocateOSGiBundleTestCase.java @@ -0,0 +1,62 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package impl.osgi; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import org.apache.tuscany.sca.osgi.runtime.OSGiRuntime; +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class CouldNotLocateOSGiBundleTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + //OSGiTestBundles.createBundle("src/main/resources/impl/osgi/MissingComponentTypeFile/OSGiTestService.jar", OSGiTestInterface.class, OSGiTestImpl.class); + + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/impl/osgi/CouldNotLocateOSGiBundle/osgitest.composite", + "TestContribution", "src/main/resources/impl/osgi/CouldNotLocateOSGiBundle/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //nothing to do + OSGiRuntime.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("CouldNotLocateOSGiBundle", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/impl/osgi/MissingComponentTypeFileTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/osgi/MissingComponentTypeFileTestCase.java new file mode 100644 index 0000000000..46672e7cfa --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/osgi/MissingComponentTypeFileTestCase.java @@ -0,0 +1,62 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package impl.osgi; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import org.apache.tuscany.sca.osgi.runtime.OSGiRuntime; +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class MissingComponentTypeFileTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + OSGiTestBundles.createBundle("src/main/resources/impl/osgi/MissingComponentTypeFile/OSGiTestService.jar", OSGiTestInterface.class, OSGiTestImpl.class); + + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/impl/osgi/MissingComponentTypeFile/osgitest.composite", + "TestContribution", "src/main/resources/impl/osgi/MissingComponentTypeFile/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //nothing to do + OSGiRuntime.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("MissingComponentTypeFile", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/impl/osgi/OSGiTestBundles.java b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/osgi/OSGiTestBundles.java new file mode 100644 index 0000000000..398c028dd8 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/osgi/OSGiTestBundles.java @@ -0,0 +1,111 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package impl.osgi; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.net.URL; +import java.util.jar.JarOutputStream; +import java.util.jar.Manifest; +import java.util.zip.ZipEntry; + + +/** + * + * Utility class to create OSGi bundles + * + * @version $Rev$ $Date$ + */ +public class OSGiTestBundles { + + public static void createBundle(String jarName, + Class interfaceClass, Class implClass) throws Exception { + + ByteArrayOutputStream out = new ByteArrayOutputStream(); + + String EOL = System.getProperty("line.separator"); + + String packageName = interfaceClass.getPackage().getName(); + String bundleName = interfaceClass.getName(); + + String manifestStr = "Manifest-Version: 1.0" + EOL + + "Bundle-ManifestVersion: 2" + EOL + "Bundle-Name: " + + bundleName + EOL + "Bundle-SymbolicName: " + bundleName + EOL + + "Bundle-Version: " + "1.0.0" + EOL + + "Bundle-Localization: plugin" + EOL; + + StringBuilder manifestBuf = new StringBuilder(); + manifestBuf.append(manifestStr); + manifestBuf.append("Export-Package: " + packageName + EOL); + manifestBuf.append("Import-Package: org.osgi.framework" + EOL); + manifestBuf.append("Bundle-Activator: " + implClass.getName() + EOL); + + ByteArrayInputStream manifestStream = new ByteArrayInputStream(manifestBuf.toString().getBytes()); + Manifest manifest = new Manifest(); + manifest.read(manifestStream); + + + JarOutputStream jarOut = new JarOutputStream(out, manifest); + + String interfaceClassName = interfaceClass.getName().replaceAll("\\.", + "/") + + ".class"; + + URL url = interfaceClass.getClassLoader().getResource( + interfaceClassName); + String path = url.getPath(); + + ZipEntry ze = new ZipEntry(interfaceClassName); + + jarOut.putNextEntry(ze); + FileInputStream file = new FileInputStream(path); + byte[] fileContents = new byte[file.available()]; + file.read(fileContents); + jarOut.write(fileContents); + + String implClassName = implClass.getName().replaceAll("\\.", + "/") + + ".class"; + + url = implClass.getClassLoader().getResource(implClassName); + path = url.getPath(); + + ze = new ZipEntry(implClassName); + + jarOut.putNextEntry(ze); + file = new FileInputStream(path); + fileContents = new byte[file.available()]; + file.read(fileContents); + jarOut.write(fileContents); + + file.close(); + + jarOut.close(); + out.close(); + + FileOutputStream fileOut = new FileOutputStream(jarName); + fileOut.write(out.toByteArray()); + fileOut.close(); + + + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/impl/osgi/PropertyShouldSpecifySRTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/osgi/PropertyShouldSpecifySRTestCase.java new file mode 100644 index 0000000000..979e69433e --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/osgi/PropertyShouldSpecifySRTestCase.java @@ -0,0 +1,62 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package impl.osgi; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import org.apache.tuscany.sca.osgi.runtime.OSGiRuntime; +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class PropertyShouldSpecifySRTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + OSGiTestBundles.createBundle("src/main/resources/impl/osgi/PropertyShouldSpecifySR/OSGiTestService.jar", OSGiTestInterface.class, OSGiTestImpl.class); + + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/impl/osgi/PropertyShouldSpecifySR/osgitest.composite", + "TestContribution", "src/main/resources/impl/osgi/PropertyShouldSpecifySR/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //nothing to do + OSGiRuntime.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("PropertyShouldSpecifySR", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/impl/resource/CouldNotResolveLocationTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/resource/CouldNotResolveLocationTestCase.java new file mode 100644 index 0000000000..b7bd573c66 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/resource/CouldNotResolveLocationTestCase.java @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package impl.resource; + +import junit.framework.Assert; +import junit.framework.TestCase; + +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; + +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class CouldNotResolveLocationTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/impl/resource/CouldNotResolveLocation/resource.composite", + "TestContribution", "src/main/resources/impl/resource/CouldNotResolveLocation/"); + } catch (Exception ex){ + //throw ex; + } + } + + protected void tearDown() throws Exception { + //nothing to do + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + Assert.assertNotNull(problem); + Assert.assertEquals("CouldNotResolveLocation", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/impl/resource/LocationAttributeMissingTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/resource/LocationAttributeMissingTestCase.java new file mode 100644 index 0000000000..3ca4e275f0 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/resource/LocationAttributeMissingTestCase.java @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package impl.resource; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; + +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class LocationAttributeMissingTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/impl/resource/LocationAttributeMissing/resource.composite", + "TestContribution", "src/main/resources/impl/resource/LocationAttributeMissing/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //nothing to do + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("LocationAttributeMissing", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/impl/spring/ContributionResolveExceptionTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/spring/ContributionResolveExceptionTestCase.java new file mode 100644 index 0000000000..a8e9d6eefc --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/spring/ContributionResolveExceptionTestCase.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package impl.spring; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class ContributionResolveExceptionTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/impl/spring/ContributionResolveException/SpringHelloWorld.composite", + "TestContribution", "src/main/resources/impl/spring/ContributionResolveException/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("ContributionResolveException", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/impl/spring/LocationAttributeMissingTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/spring/LocationAttributeMissingTestCase.java new file mode 100644 index 0000000000..b5dc64fdcd --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/spring/LocationAttributeMissingTestCase.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package impl.spring; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class LocationAttributeMissingTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/impl/spring/LocationAttributeMissing/SpringHelloWorld.composite", + "TestContribution", "src/main/resources/impl/spring/LocationAttributeMissing/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("LocationAttributeMissing", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/impl/spring/UnableToResolveComponentTypeTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/spring/UnableToResolveComponentTypeTestCase.java new file mode 100644 index 0000000000..f06f4081b5 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/spring/UnableToResolveComponentTypeTestCase.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package impl.spring; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class UnableToResolveComponentTypeTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/impl/spring/UnableToResolveComponentType/SpringHelloWorld.composite", + "TestContribution", "src/main/resources/impl/spring/UnableToResolveComponentType/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + //assertNotNull(problem); + //assertEquals("UnableToResolveComponentType", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/impl/widget/CouldNotResolveLocationTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/widget/CouldNotResolveLocationTestCase.java new file mode 100644 index 0000000000..c838d58b1a --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/widget/CouldNotResolveLocationTestCase.java @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package impl.widget; + +import junit.framework.Assert; +import junit.framework.TestCase; + +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; + +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class CouldNotResolveLocationTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/impl/widget/CouldNotResolveLocation/widget.composite", + "TestContribution", "src/main/resources/impl/widget/CouldNotResolveLocation/"); + } catch (Exception ex){ + //throw ex; + } + } + + protected void tearDown() throws Exception { + //nothing to do + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + Assert.assertNotNull(problem); + Assert.assertEquals("CouldNotResolveLocation", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/impl/widget/LocationAttributeMissingTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/widget/LocationAttributeMissingTestCase.java new file mode 100644 index 0000000000..9c5f99ea40 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/widget/LocationAttributeMissingTestCase.java @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package impl.widget; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; + +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class LocationAttributeMissingTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/impl/widget/LocationAttributeMissing/widget.composite", + "TestContribution", "src/main/resources/impl/widget/LocationAttributeMissing/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //nothing to do + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("LocationAttributeMissing", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/impl/xquery/CouldNotLocateFileTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/xquery/CouldNotLocateFileTestCase.java new file mode 100644 index 0000000000..fcaeb27bc0 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/xquery/CouldNotLocateFileTestCase.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package impl.xquery; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class CouldNotLocateFileTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/impl/xquery/CouldNotLocateFile/HelloWorld.composite", + "TestContribution", "src/main/resources/impl/xquery/CouldNotLocateFile/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("CouldNotLocateFile", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/impl/xquery/LocationAttributeMissingTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/xquery/LocationAttributeMissingTestCase.java new file mode 100644 index 0000000000..8fdf7cf61c --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/impl/xquery/LocationAttributeMissingTestCase.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package impl.xquery; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class LocationAttributeMissingTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/impl/xquery/LocationAttributeMissing/HelloWorld.composite", + "TestContribution", "src/main/resources/impl/xquery/LocationAttributeMissing/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("LocationAttributeMissing", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/interfacejava/xml/ClassNotFoundTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/interfacejava/xml/ClassNotFoundTestCase.java new file mode 100644 index 0000000000..af022fad27 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/interfacejava/xml/ClassNotFoundTestCase.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package interfacejava.xml; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class ClassNotFoundTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/interfacejava/xml/ClassNotFoundException/Calculator.composite", + "TestContribution", "src/main/resources/interfacejava/xml/ClassNotFoundException/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("ClassNotFoundException", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/interfacejava/xml/ContributionResolveExceptionTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/interfacejava/xml/ContributionResolveExceptionTestCase.java new file mode 100644 index 0000000000..719bbb540a --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/interfacejava/xml/ContributionResolveExceptionTestCase.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package interfacejava.xml; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class ContributionResolveExceptionTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/interfacejava/xml/ContributionResolveException/Calculator.composite", + "TestContribution", "src/main/resources/interfacejava/xml/ContributionResolveException/"); + } catch (Exception ex){ + throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + //assertNotNull(problem); + //assertEquals("ContributionResolveException", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/interfacewsdl/xml/InvalidWSDLInterfaceAttrTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/interfacewsdl/xml/InvalidWSDLInterfaceAttrTestCase.java new file mode 100644 index 0000000000..ce6178c022 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/interfacewsdl/xml/InvalidWSDLInterfaceAttrTestCase.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package interfacewsdl.xml; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class InvalidWSDLInterfaceAttrTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/interfacewsdl/xml/InvalidWSDLInterfaceAttr/Calculator.composite", + "TestContribution", "src/main/resources/interfacewsdl/xml/InvalidWSDLInterfaceAttr/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("InvalidWSDLInterfaceAttr", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/interfacewsdl/xml/WsdlInterfaceDoesNotMatchTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/interfacewsdl/xml/WsdlInterfaceDoesNotMatchTestCase.java new file mode 100644 index 0000000000..32f2e9751b --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/interfacewsdl/xml/WsdlInterfaceDoesNotMatchTestCase.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package interfacewsdl.xml; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class WsdlInterfaceDoesNotMatchTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/interfacewsdl/xml/WsdlInterfaceDoesNotMatch/helloworldwsjms.composite", + "TestContribution", "src/main/resources/interfacewsdl/xml/WsdlInterfaceDoesNotMatch/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("WsdlInterfaceDoesNotMatch", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/policy/xml/AlwaysProvidedIntentNotFoundTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/policy/xml/AlwaysProvidedIntentNotFoundTestCase.java new file mode 100644 index 0000000000..955d07524f --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/policy/xml/AlwaysProvidedIntentNotFoundTestCase.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package policy.xml; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class AlwaysProvidedIntentNotFoundTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/policy/xml/AlwaysProvidedIntentNotFound/Calculator.composite", + "TestContribution", "src/main/resources/policy/xml/AlwaysProvidedIntentNotFound/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("AlwaysProvidedIntentNotFound", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/policy/xml/ErrorInPolicyIntentDefinitionTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/policy/xml/ErrorInPolicyIntentDefinitionTestCase.java new file mode 100644 index 0000000000..dfcc14d528 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/policy/xml/ErrorInPolicyIntentDefinitionTestCase.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package policy.xml; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class ErrorInPolicyIntentDefinitionTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/policy/xml/ErrorInPolicyIntentDefinition/Calculator.composite", + "TestContribution", "src/main/resources/policy/xml/ErrorInPolicyIntentDefinition/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("ErrorInPolicyIntentDefinition", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/policy/xml/IntentNotSpecifiedTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/policy/xml/IntentNotSpecifiedTestCase.java new file mode 100644 index 0000000000..c14dd29c1a --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/policy/xml/IntentNotSpecifiedTestCase.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package policy.xml; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class IntentNotSpecifiedTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/policy/xml/IntentNotSpecified/Calculator.composite", + "TestContribution", "src/main/resources/policy/xml/IntentNotSpecified/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("IntentNotSpecified", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/policy/xml/MayProvideIntentNotFoundTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/policy/xml/MayProvideIntentNotFoundTestCase.java new file mode 100644 index 0000000000..69d516babe --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/policy/xml/MayProvideIntentNotFoundTestCase.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package policy.xml; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class MayProvideIntentNotFoundTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/policy/xml/MayProvideIntentNotFound/Calculator.composite", + "TestContribution", "src/main/resources/policy/xml/MayProvideIntentNotFound/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("MayProvideIntentNotFound", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/policy/xml/RequiredAttributeMissingTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/policy/xml/RequiredAttributeMissingTestCase.java new file mode 100644 index 0000000000..36f2e3a8f9 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/policy/xml/RequiredAttributeMissingTestCase.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package policy.xml; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class RequiredAttributeMissingTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/policy/xml/RequiredAttributeMissing/Calculator.composite", + "TestContribution", "src/main/resources/policy/xml/RequiredAttributeMissing/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("RequiredAttributeMissing", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/policy/xml/UnableToMapPoliciesTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/policy/xml/UnableToMapPoliciesTestCase.java new file mode 100644 index 0000000000..4f9a19730c --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/policy/xml/UnableToMapPoliciesTestCase.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package policy.xml; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class UnableToMapPoliciesTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/policy/xml/UnableToMapPolicies/Calculator.composite", + "TestContribution", "src/main/resources/policy/xml/UnableToMapPolicies/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("UnableToMapPolicies", problem.getMessageId()); + } +} diff --git a/sandbox/axis2-1.4/itest/validation/src/test/java/policy/xml/UnrecognizedIntentAttachPointTypeTestCase.java b/sandbox/axis2-1.4/itest/validation/src/test/java/policy/xml/UnrecognizedIntentAttachPointTypeTestCase.java new file mode 100644 index 0000000000..a3fa4040d6 --- /dev/null +++ b/sandbox/axis2-1.4/itest/validation/src/test/java/policy/xml/UnrecognizedIntentAttachPointTypeTestCase.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package policy.xml; + +import junit.framework.TestCase; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl; +import domain.CustomCompositeBuilder; + +/** + * This shows how to test the Calculator service component. + */ +public class UnrecognizedIntentAttachPointTypeTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/policy/xml/UnrecognizedIntentAttachPointType/Calculator.composite", + "TestContribution", "src/main/resources/policy/xml/UnrecognizedIntentAttachPointType/"); + } catch (Exception ex){ + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); + + assertNotNull(problem); + assertEquals("UnrecognizedIntentAttachPointType", problem.getMessageId()); + } +} -- cgit v1.2.3