summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/assembly-xml/src/test/java/org/apache
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-03-25 23:40:38 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-03-25 23:40:38 +0000
commit1eafab3193550a62edf9a9c7c60c119796a9e7e8 (patch)
tree3b9da17022bb79565b4e24748ce8c34e87821cee /java/sca/modules/assembly-xml/src/test/java/org/apache
parent6b71f86309fc1c20aaac34c205fe783664a48477 (diff)
Match the document using wildcards against the artifact URI
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@758464 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/assembly-xml/src/test/java/org/apache')
-rw-r--r--java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/BuildPolicyTestCase.java93
-rw-r--r--java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadDocumentTestCase.java78
-rw-r--r--java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ResolvePolicyTestCase.java52
3 files changed, 108 insertions, 115 deletions
diff --git a/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/BuildPolicyTestCase.java b/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/BuildPolicyTestCase.java
index f624f77b81..7db6d964c4 100644
--- a/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/BuildPolicyTestCase.java
+++ b/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/BuildPolicyTestCase.java
@@ -6,15 +6,15 @@
* 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.
+ * under the License.
*/
package org.apache.tuscany.sca.assembly.xml;
@@ -29,8 +29,11 @@ import java.util.List;
import javax.xml.namespace.QName;
+import org.apache.tuscany.sca.assembly.Component;
import org.apache.tuscany.sca.assembly.Composite;
import org.apache.tuscany.sca.assembly.ConstrainingType;
+import org.apache.tuscany.sca.assembly.Endpoint2;
+import org.apache.tuscany.sca.assembly.EndpointReference2;
import org.apache.tuscany.sca.assembly.SCABindingFactory;
import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
import org.apache.tuscany.sca.assembly.builder.CompositeBuilderExtensionPoint;
@@ -46,53 +49,53 @@ import org.apache.tuscany.sca.core.FactoryExtensionPoint;
import org.apache.tuscany.sca.core.UtilityExtensionPoint;
import org.apache.tuscany.sca.definitions.Definitions;
import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
-import org.apache.tuscany.sca.monitor.DefaultMonitorFactory;
import org.apache.tuscany.sca.monitor.Monitor;
import org.apache.tuscany.sca.monitor.MonitorFactory;
import org.apache.tuscany.sca.policy.PolicySubject;
import org.junit.BeforeClass;
-import org.junit.Ignore;
import org.junit.Test;
/**
* Test reading SCA XML assembly documents.
- *
+ *
* @version $Rev: 561254 $ $Date: 2007-07-31 13:16:27 +0530 (Tue, 31 Jul 2007) $
*/
-public class BuildPolicyTestCase {
+public class BuildPolicyTestCase {
private static URLArtifactProcessor<Object> documentProcessor;
private static URLArtifactProcessor<Definitions> policyDefinitionsProcessor;
- private static ModelResolver resolver;
+ private static ModelResolver resolver;
private static CompositeBuilder compositeBuilder;
private static Composite composite;
private static Monitor monitor;
-
@BeforeClass
public static void setUp() throws Exception {
- /*
DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
SCABindingFactory scaBindingFactory = new TestSCABindingFactoryImpl();
modelFactories.addFactory(scaBindingFactory);
- compositeBuilder = extensionPoints.getExtensionPoint(CompositeBuilderExtensionPoint.class).getCompositeBuilder("org.apache.tuscany.sca.assembly.builder.CompositeBuilder");
+ compositeBuilder =
+ extensionPoints.getExtensionPoint(CompositeBuilderExtensionPoint.class)
+ .getCompositeBuilder("org.apache.tuscany.sca.assembly.builder.CompositeBuilder");
List<Definitions> policyDefinitions = new ArrayList<Definitions>();
resolver = new DefaultModelResolver();
-
- MonitorFactory monitorFactory = new DefaultMonitorFactory();
- monitor = monitorFactory.createMonitor();
-
+
UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
+ MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
+ monitor = monitorFactory.createMonitor();
+
InterfaceContractMapper mapper = utilities.getUtility(InterfaceContractMapper.class);
-
- URLArtifactProcessorExtensionPoint documentProcessors = new DefaultURLArtifactProcessorExtensionPoint(extensionPoints);
+
+ URLArtifactProcessorExtensionPoint documentProcessors =
+ new DefaultURLArtifactProcessorExtensionPoint(extensionPoints);
documentProcessor = new ExtensibleURLArtifactProcessor(documentProcessors, null);
policyDefinitionsProcessor = documentProcessors.getProcessor(Definitions.class);
-
- StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
+
+ StAXArtifactProcessorExtensionPoint staxProcessors =
+ extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
staxProcessors.addArtifactProcessor(new TestPolicyProcessor());
-
+
URL url = BuildPolicyTestCase.class.getResource("CalculatorComponent.constrainingType");
URI uri = URI.create("CalculatorComponent.constrainingType");
ConstrainingType constrainingType = (ConstrainingType)documentProcessor.read(null, uri, url);
@@ -100,52 +103,38 @@ public class BuildPolicyTestCase {
resolver.addModel(constrainingType);
url = BuildPolicyTestCase.class.getResource("TestAllPolicyCalculator.composite");
- uri = URI.create("TestAllCalculator.constrainingType");
+ uri = URI.create("TestAllCalculator.composite");
composite = (Composite)documentProcessor.read(null, uri, url);
assertNotNull(composite);
-
+
url = BuildPolicyTestCase.class.getResource("another_test_definitions.xml");
uri = URI.create("another_test_definitions.xml");
Definitions definitions = (Definitions)policyDefinitionsProcessor.read(null, uri, url);
assertNotNull(definitions);
policyDefinitions.add(definitions);
-
+
documentProcessor.resolve(definitions, resolver);
documentProcessor.resolve(composite, resolver);
-
- compositeBuilder.build(composite, null, monitor);
- */
+
+ compositeBuilder.build(composite, definitions, monitor);
}
- //@Test
- @Ignore("The inheritance will be calculated differently in OASIS SCA")
+ @Test
+ // @Ignore("The inheritance will be calculated differently in OASIS SCA")
public void testPolicyIntentInheritance() throws Exception {
String namespaceUri = "http://test";
-
- PolicySubject policiedComposite = (PolicySubject)composite;
+
+ PolicySubject policiedComposite = composite;
assertEquals(policiedComposite.getRequiredIntents().size(), 1);
- assertEquals(policiedComposite.getRequiredIntents().get(0).getName(), new QName(namespaceUri, "tuscanyIntent_1"));
-
- //1 defined for composite, 2 defined for the service, 1 defined and 3 inherited for the promoted service (4)
- assertEquals(composite.getServices().get(0).getRequiredIntents().size(), 7);
- //1 from the operation defined in this service and 2 from the operation defined in the promoted service
- assertEquals(composite.getServices().get(0).getRequiredIntents().get(3).getName(), new QName(namespaceUri, "tuscanyIntent_3"));
- //bindings will have only 2 intents since duplications will be cut out
- assertEquals(((PolicySubject)composite.getServices().get(0).getBindings().get(0)).getRequiredIntents().size(), 3);
-
- assertEquals(composite.getReferences().get(0).getRequiredIntents().size(), 5);
- assertEquals(composite.getReferences().get(0).getRequiredIntents().get(1).getName(), new QName(namespaceUri, "tuscanyIntent_1"));
- assertEquals(((PolicySubject)composite.getReferences().get(0).getBindings().get(0)).getRequiredIntents().size(), 3);
-
- assertEquals(composite.getComponents().get(0).getRequiredIntents().size(), 3);
- assertEquals(composite.getComponents().get(0).getRequiredIntents().get(2).getName(), new QName(namespaceUri, "tuscanyIntent_1"));
- assertEquals(composite.getComponents().get(0).getServices().get(0).getRequiredIntents().size(), 4);
- assertEquals(composite.getComponents().get(0).getServices().get(0).getCallback().getRequiredIntents().size(), 4);
- assertEquals(composite.getComponents().get(0).getReferences().get(0).getRequiredIntents().size(), 5);
- }
+ assertEquals(policiedComposite.getRequiredIntents().get(0).getName(),
+ new QName(namespaceUri, "tuscanyIntent_1"));
- @Test
- public void testDummy() throws Exception {
-
+ Component component = composite.getComponents().get(0);
+ Endpoint2 ep = component.getServices().get(0).getEndpoints().get(0);
+ EndpointReference2 epr = component.getReferences().get(0).getEndpointReferences().get(0);
+
+ System.out.println(ep.getRequiredIntents());
+ System.out.println(epr.getRequiredIntents());
}
+
}
diff --git a/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadDocumentTestCase.java b/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadDocumentTestCase.java
index e1d1794f3c..e792fd2afd 100644
--- a/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadDocumentTestCase.java
+++ b/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadDocumentTestCase.java
@@ -6,15 +6,15 @@
* 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.
+ * under the License.
*/
package org.apache.tuscany.sca.assembly.xml;
@@ -54,33 +54,35 @@ import org.xml.sax.XMLReader;
/**
* Test reading SCA XML assembly documents.
- *
+ *
* @version $Rev$ $Date$
*/
public class ReadDocumentTestCase {
- private static final String TUSCANY_11_XSD = "tuscany-sca-1.1.xsd";
+ private static final String TUSCANY_11_XSD = "tuscany-sca-1.1.xsd";
private static URLArtifactProcessor<Object> documentProcessor;
private static ModelResolver resolver;
private static XMLInputFactory inputFactory;
- private static StAXArtifactProcessor<Object> staxProcessor;
+ private static StAXArtifactProcessor<Object> staxProcessor;
@BeforeClass
public static void setUp() throws Exception {
DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- URLArtifactProcessorExtensionPoint documentProcessors = extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
- documentProcessor = new ExtensibleURLArtifactProcessor(documentProcessors, null);
-
- StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
+ URLArtifactProcessorExtensionPoint documentProcessors =
+ extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
+ documentProcessor = new ExtensibleURLArtifactProcessor(documentProcessors, null);
+
+ StAXArtifactProcessorExtensionPoint staxProcessors =
+ extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
inputFactory = XMLInputFactory.newInstance();
staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, null);
-
+
resolver = new DefaultModelResolver();
}
@Test
public void testValidateAssembly() throws Exception {
-
+
SchemaFactory schemaFactory;
try {
schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
@@ -93,19 +95,19 @@ public class ReadDocumentTestCase {
}
Schema schema = schemaFactory.newSchema(getClass().getClassLoader().getResource(TUSCANY_11_XSD));
ValidatorHandler handler = schema.newValidatorHandler();
-
+
SAXParserFactory parserFactory = SAXParserFactory.newInstance();
URL url = getClass().getResource("Calculator.composite");
XMLReader reader = parserFactory.newSAXParser().getXMLReader();
reader.setFeature("http://xml.org/sax/features/namespaces", true);
reader.setContentHandler(handler);
reader.parse(new InputSource(url.openStream()));
-
+
}
@Test
public void testValidateImplementation() throws Exception {
-
+
SchemaFactory schemaFactory;
try {
schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
@@ -118,7 +120,7 @@ public class ReadDocumentTestCase {
}
Schema schema = schemaFactory.newSchema(getClass().getClassLoader().getResource(TUSCANY_11_XSD));
ValidatorHandler handler = schema.newValidatorHandler();
-
+
SAXParserFactory parserFactory = SAXParserFactory.newInstance();
URL url = getClass().getResource("Calculator.composite");
XMLReader reader = parserFactory.newSAXParser().getXMLReader();
@@ -126,27 +128,28 @@ public class ReadDocumentTestCase {
reader.setContentHandler(handler);
reader.parse(new InputSource(url.openStream()));
}
-
+
@Test
- public void testReadImplementation() throws Exception {
-
+ public void testReadImplementation() throws Exception {
+
ValidationSchemaExtensionPoint schemas = new DefaultValidationSchemaExtensionPoint();
schemas.addSchema(getClass().getClassLoader().getResource(TUSCANY_11_XSD).toString());
XMLInputFactory validatingInputFactory = new DefaultValidatingXMLInputFactory(inputFactory, schemas, null);
DefaultFactoryExtensionPoint factories = new DefaultFactoryExtensionPoint(new DefaultExtensionPointRegistry());
factories.addFactory(validatingInputFactory);
-
- CompositeDocumentProcessor compositeDocumentProcessor = new CompositeDocumentProcessor(factories , staxProcessor, null);
-
+
+ CompositeDocumentProcessor compositeDocumentProcessor =
+ new CompositeDocumentProcessor(factories, staxProcessor, null);
+
URL url = getClass().getResource("Calculator.composite");
URI uri = URI.create("Calculator.composite");
Composite composite = (Composite)compositeDocumentProcessor.read(null, uri, url);
assertNotNull(composite);
}
-
+
@Test
public void testValidateBinding() throws Exception {
-
+
SchemaFactory schemaFactory;
try {
schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
@@ -159,7 +162,7 @@ public class ReadDocumentTestCase {
}
Schema schema = schemaFactory.newSchema(getClass().getClassLoader().getResource(TUSCANY_11_XSD));
ValidatorHandler handler = schema.newValidatorHandler();
-
+
SAXParserFactory parserFactory = SAXParserFactory.newInstance();
URL url = getClass().getResource("RMIBindingTest.composite");
XMLReader reader = parserFactory.newSAXParser().getXMLReader();
@@ -167,26 +170,27 @@ public class ReadDocumentTestCase {
reader.setContentHandler(handler);
reader.parse(new InputSource(url.openStream()));
}
-
+
@Test
public void testReadBinding() throws Exception {
-
+
ValidationSchemaExtensionPoint schemas = new DefaultValidationSchemaExtensionPoint();
schemas.addSchema(getClass().getClassLoader().getResource(TUSCANY_11_XSD).toString());
XMLInputFactory validatingInputFactory = new DefaultValidatingXMLInputFactory(inputFactory, schemas, null);
DefaultFactoryExtensionPoint factories = new DefaultFactoryExtensionPoint(new DefaultExtensionPointRegistry());
factories.addFactory(validatingInputFactory);
- CompositeDocumentProcessor compositeDocumentProcessor = new CompositeDocumentProcessor(factories , staxProcessor, null);
-
+ CompositeDocumentProcessor compositeDocumentProcessor =
+ new CompositeDocumentProcessor(factories, staxProcessor, null);
+
URL url = getClass().getResource("RMIBindingTest.composite");
URI uri = URI.create("RMIBindingTest.composite");
Composite composite = (Composite)compositeDocumentProcessor.read(null, uri, url);
assertNotNull(composite);
}
-
+
@Test
public void testResolveConstrainingType() throws Exception {
-
+
URL url = getClass().getResource("CalculatorComponent.constrainingType");
URI uri = URI.create("CalculatorComponent.constrainingType");
ConstrainingType constrainingType = (ConstrainingType)documentProcessor.read(null, uri, url);
@@ -194,13 +198,13 @@ public class ReadDocumentTestCase {
resolver.addModel(constrainingType);
url = getClass().getResource("TestAllCalculator.composite");
- uri = URI.create("TestAllCalculator.constrainingType");
+ uri = URI.create("TestAllCalculator.composite");
Composite composite = (Composite)documentProcessor.read(null, uri, url);
assertNotNull(composite);
-
+
documentProcessor.resolve(composite, resolver);
-
- assertEquals(composite.getConstrainingType(), constrainingType);
+
+ assertEquals(composite.getConstrainingType(), constrainingType);
assertEquals(composite.getComponents().get(0).getConstrainingType(), constrainingType);
}
@@ -215,9 +219,9 @@ public class ReadDocumentTestCase {
url = getClass().getResource("TestAllCalculator.composite");
uri = URI.create("TestAllCalculator.composite");
Composite composite = (Composite)documentProcessor.read(null, uri, url);
-
+
documentProcessor.resolve(composite, resolver);
-
+
assertEquals(composite.getComponents().get(2).getImplementation(), nestedComposite);
}
diff --git a/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ResolvePolicyTestCase.java b/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ResolvePolicyTestCase.java
index c4519ef338..d9be1dff90 100644
--- a/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ResolvePolicyTestCase.java
+++ b/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ResolvePolicyTestCase.java
@@ -6,18 +6,18 @@
* 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.
+ * under the License.
*/
-package org.apache.tuscany.sca.assembly.xml;
+package org.apache.tuscany.sca.assembly.xml;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@@ -44,24 +44,24 @@ import org.junit.Test;
/**
* Test reading SCA XML assembly documents.
- *
+ *
* @version $Rev: 561254 $ $Date: 2007-07-31 13:16:27 +0530 (Tue, 31 Jul 2007) $
*/
public class ResolvePolicyTestCase {
private static URLArtifactProcessor<Object> documentProcessor;
- private static ModelResolver resolver;
+ private static ModelResolver resolver;
private static URLArtifactProcessor<Definitions> policyDefinitionsProcessor;
@BeforeClass
public static void setUp() throws Exception {
DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
resolver = new DefaultModelResolver();
-
+
URLArtifactProcessorExtensionPoint documentProcessors = extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
documentProcessor = new ExtensibleURLArtifactProcessor(documentProcessors, null);
policyDefinitionsProcessor = documentProcessors.getProcessor(Definitions.class);
-
+
// Create StAX processors
StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
staxProcessors.addArtifactProcessor(new TestPolicyProcessor());
@@ -69,7 +69,7 @@ public class ResolvePolicyTestCase {
@Test
public void testResolveConstrainingType() throws Exception {
-
+
URL url = getClass().getResource("CalculatorComponent.constrainingType");
URI uri = URI.create("CalculatorComponent.constrainingType");
ConstrainingType constrainingType = (ConstrainingType)documentProcessor.read(null, uri, url);
@@ -77,60 +77,60 @@ public class ResolvePolicyTestCase {
resolver.addModel(constrainingType);
url = getClass().getResource("TestAllCalculator.composite");
- uri = URI.create("TestAllCalculator.constrainingType");
+ uri = URI.create("TestAllCalculator.composite");
Composite composite = (Composite)documentProcessor.read(null, uri, url);
assertNotNull(composite);
-
+
url = getClass().getResource("test_definitions.xml");
uri = URI.create("test_definitions.xml");
Definitions scaDefns = (Definitions)policyDefinitionsProcessor.read(null, uri, url);
assertNotNull(scaDefns);
-
+
preResolvePolicyTests(composite);
documentProcessor.resolve(scaDefns, resolver);
documentProcessor.resolve(composite, resolver);
-
+
// Comment out the post resolving test
// postResolvePolicyTests(composite);
-
+
assertEquals(composite.getConstrainingType(), constrainingType);
assertEquals(composite.getComponents().get(0).getConstrainingType(), constrainingType);
}
-
+
private void preResolvePolicyTests(Composite composite) {
assertNull(((PolicySubject)composite).getRequiredIntents().get(0).getDescription());
assertTrue(((PolicySubject)composite).getPolicySets().get(0).getProvidedIntents().isEmpty());
-
+
assertNull(composite.getServices().get(0).getRequiredIntents().get(0).getDescription());
assertTrue(composite.getServices().get(0).getPolicySets().get(0).getProvidedIntents().isEmpty());
assertNull(composite.getServices().get(0).getCallback().getRequiredIntents().get(0).getDescription());
assertTrue(composite.getServices().get(0).getCallback().getPolicySets().get(0).getProvidedIntents().isEmpty());
-
+
assertNull(composite.getComponents().get(0).getRequiredIntents().get(0).getDescription());
assertTrue(composite.getComponents().get(0).getPolicySets().get(0).getProvidedIntents().isEmpty());
assertNull(composite.getComponents().get(0).getServices().get(0).getRequiredIntents().get(0).getDescription());
assertTrue(composite.getComponents().get(0).getServices().get(0).getPolicySets().get(0).getProvidedIntents().isEmpty());
assertNull(composite.getComponents().get(0).getReferences().get(0).getRequiredIntents().get(0).getDescription());
assertTrue(composite.getComponents().get(0).getReferences().get(0).getPolicySets().get(0).getProvidedIntents().isEmpty());
-
+
assertNull(composite.getReferences().get(0).getRequiredIntents().get(0).getDescription());
assertTrue(composite.getReferences().get(0).getPolicySets().get(0).getProvidedIntents().isEmpty());
assertNull(composite.getReferences().get(0).getCallback().getRequiredIntents().get(0).getDescription());
assertTrue(composite.getReferences().get(0).getCallback().getPolicySets().get(0).getProvidedIntents().isEmpty());
}
-
+
private void postResolvePolicyTests(Composite composite) {
assertNotNull(((PolicySubject)composite).getRequiredIntents().get(0).getDescription());
assertFalse(((PolicySubject)composite).getPolicySets().get(0).getProvidedIntents().isEmpty());
assertNotNull(((PolicySubject)composite).getPolicySets().get(0).getProvidedIntents().get(1).getDescription());
-
+
assertNotNull(composite.getServices().get(0).getRequiredIntents().get(0).getDescription());
assertFalse(composite.getServices().get(0).getPolicySets().get(0).getProvidedIntents().isEmpty());
assertNotNull(composite.getServices().get(0).getPolicySets().get(0).getProvidedIntents().get(1).getDescription());
assertNotNull(composite.getServices().get(0).getCallback().getRequiredIntents().get(0).getDescription());
assertFalse(composite.getServices().get(0).getCallback().getPolicySets().get(0).getProvidedIntents().isEmpty());
assertNotNull(composite.getServices().get(0).getCallback().getPolicySets().get(0).getProvidedIntents().get(1).getDescription());
-
+
assertNotNull(composite.getComponents().get(0).getRequiredIntents().get(0).getDescription());
assertFalse(composite.getComponents().get(0).getPolicySets().get(0).getProvidedIntents().isEmpty());
assertNotNull(composite.getComponents().get(0).getPolicySets().get(0).getProvidedIntents().get(1).getDescription());
@@ -140,15 +140,15 @@ public class ResolvePolicyTestCase {
assertNotNull(composite.getComponents().get(0).getReferences().get(0).getRequiredIntents().get(0).getDescription());
assertFalse(composite.getComponents().get(0).getReferences().get(0).getPolicySets().get(0).getProvidedIntents().isEmpty());
assertNotNull(composite.getComponents().get(0).getReferences().get(0).getPolicySets().get(0).getProvidedIntents().get(1).getDescription());
-
+
assertNotNull(composite.getReferences().get(0).getRequiredIntents().get(0).getDescription());
assertFalse(composite.getReferences().get(0).getPolicySets().get(0).getProvidedIntents().isEmpty());
assertNotNull(composite.getReferences().get(0).getPolicySets().get(0).getProvidedIntents().get(1).getDescription());
assertNotNull(composite.getReferences().get(0).getCallback().getRequiredIntents().get(0).getDescription());
assertFalse(composite.getReferences().get(0).getCallback().getPolicySets().get(0).getProvidedIntents().isEmpty());
assertNotNull(composite.getReferences().get(0).getCallback().getPolicySets().get(0).getProvidedIntents().get(1).getDescription());
-
-
+
+
}
@Test
@@ -162,9 +162,9 @@ public class ResolvePolicyTestCase {
url = getClass().getResource("TestAllCalculator.composite");
uri = URI.create("TestAllCalculator.composite");
Composite composite = (Composite)documentProcessor.read(null, uri, url);
-
+
documentProcessor.resolve(composite, resolver);
-
+
assertEquals(composite.getComponents().get(2).getImplementation(), nestedComposite);
}