summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/implementation-web/src
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2008-07-28 12:32:27 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2008-07-28 12:32:27 +0000
commit5a315d4ba3fe1c046e139269ea82ad2330c25a06 (patch)
tree6d72b9670d31d2149b9f51c1ec91473d8dc00108 /java/sca/modules/implementation-web/src
parentf17aaa54bb07ff13a92b464fdea23699c9f9f9cc (diff)
Update to use web-uri attribute
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@680334 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/implementation-web/src')
-rw-r--r--java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/WebImplementation.java4
-rw-r--r--java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationImpl.java10
-rw-r--r--java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/xml/WebImplementationProcessor.java13
-rw-r--r--java/sca/modules/implementation-web/src/test/java/org/apache/tuscany/sca/implementation/web/xml/ReadTestCase.java2
-rw-r--r--java/sca/modules/implementation-web/src/test/java/org/apache/tuscany/sca/implementation/web/xml/WriteTestCase.java2
-rw-r--r--java/sca/modules/implementation-web/src/test/resources/org/apache/tuscany/sca/implementation/web/xml/TestWeb.composite2
6 files changed, 23 insertions, 10 deletions
diff --git a/java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/WebImplementation.java b/java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/WebImplementation.java
index 0870afc977..86af3d7204 100644
--- a/java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/WebImplementation.java
+++ b/java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/WebImplementation.java
@@ -31,12 +31,12 @@ public interface WebImplementation extends Implementation {
* Returns the webapp URI.
* @return the webapp URI
*/
- String getURI();
+ String getWebURI();
/**
* Sets the Webapp URI.
* @param uri the webapp URI
*/
- void setURI(String webappURI);
+ void setWebURI(String webappURI);
}
diff --git a/java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationImpl.java b/java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationImpl.java
index 79705dee7c..6a46eb03c5 100644
--- a/java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationImpl.java
+++ b/java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationImpl.java
@@ -38,6 +38,8 @@ class WebImplementationImpl implements WebImplementation {
private List<Reference> references = new ArrayList<Reference>();
private String uri;
private boolean unresolved;
+
+ private String webURI;
/**
* Constructs a new Web implementation.
@@ -81,4 +83,12 @@ class WebImplementationImpl implements WebImplementation {
public void setUnresolved(boolean unresolved) {
this.unresolved = unresolved;
}
+
+ public String getWebURI() {
+ return webURI;
+ }
+
+ public void setWebURI(String webURI) {
+ this.webURI = webURI;
+ }
}
diff --git a/java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/xml/WebImplementationProcessor.java b/java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/xml/WebImplementationProcessor.java
index cd8e47f5ba..d4a0ab7ef1 100644
--- a/java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/xml/WebImplementationProcessor.java
+++ b/java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/xml/WebImplementationProcessor.java
@@ -72,10 +72,13 @@ public class WebImplementationProcessor extends BaseStAXArtifactProcessor implem
WebImplementation implementation = implementationFactory.createWebImplementation();
implementation.setUnresolved(true);
- // Read the uri attribute
- String webappURI = getString(reader, "uri");
- if (webappURI != null) {
- implementation.setURI(webappURI);
+ // Read the webapp uri attribute
+ String webURI = getString(reader, "web-uri");
+ if (webURI != null) {
+ implementation.setWebURI(webURI);
+
+ // Set the URI of the component type
+ implementation.setURI(webURI);
}
// Skip to end element
@@ -111,7 +114,7 @@ public class WebImplementationProcessor extends BaseStAXArtifactProcessor implem
// Write <implementation.web>
writeStart(writer, IMPLEMENTATION_WEB.getNamespaceURI(), IMPLEMENTATION_WEB.getLocalPart(),
- new XAttr("uri", implementation.getURI()));
+ new XAttr("web-uri", implementation.getWebURI()));
writeEnd(writer);
}
diff --git a/java/sca/modules/implementation-web/src/test/java/org/apache/tuscany/sca/implementation/web/xml/ReadTestCase.java b/java/sca/modules/implementation-web/src/test/java/org/apache/tuscany/sca/implementation/web/xml/ReadTestCase.java
index b47aa0fbe1..10a7df7ae5 100644
--- a/java/sca/modules/implementation-web/src/test/java/org/apache/tuscany/sca/implementation/web/xml/ReadTestCase.java
+++ b/java/sca/modules/implementation-web/src/test/java/org/apache/tuscany/sca/implementation/web/xml/ReadTestCase.java
@@ -75,7 +75,7 @@ public class ReadTestCase extends TestCase {
compositeBuilder.build(composite);
- assertTrue(((WebImplementation) composite.getComponents().get(0).getImplementation()).getURI().equals("MyWebapp"));
+ assertTrue(((WebImplementation) composite.getComponents().get(0).getImplementation()).getWebURI().equals("MyWebapp"));
}
}
diff --git a/java/sca/modules/implementation-web/src/test/java/org/apache/tuscany/sca/implementation/web/xml/WriteTestCase.java b/java/sca/modules/implementation-web/src/test/java/org/apache/tuscany/sca/implementation/web/xml/WriteTestCase.java
index 7e609f5868..723672270d 100644
--- a/java/sca/modules/implementation-web/src/test/java/org/apache/tuscany/sca/implementation/web/xml/WriteTestCase.java
+++ b/java/sca/modules/implementation-web/src/test/java/org/apache/tuscany/sca/implementation/web/xml/WriteTestCase.java
@@ -59,7 +59,7 @@ public class WriteTestCase extends TestCase {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
staxProcessor.write(composite, outputFactory.createXMLStreamWriter(bos));
- assertTrue(bos.toString().contains("MyWebapp"));
+ assertTrue(bos.toString().contains("web-uri=\"MyWebapp\""));
}
diff --git a/java/sca/modules/implementation-web/src/test/resources/org/apache/tuscany/sca/implementation/web/xml/TestWeb.composite b/java/sca/modules/implementation-web/src/test/resources/org/apache/tuscany/sca/implementation/web/xml/TestWeb.composite
index 8d8db875af..181de3772b 100644
--- a/java/sca/modules/implementation-web/src/test/resources/org/apache/tuscany/sca/implementation/web/xml/TestWeb.composite
+++ b/java/sca/modules/implementation-web/src/test/resources/org/apache/tuscany/sca/implementation/web/xml/TestWeb.composite
@@ -23,7 +23,7 @@
name="TestWeb">
<component name="TestWeb">
- <implementation.web uri="MyWebapp"/>
+ <implementation.web web-uri="MyWebapp"/>
</component>
</composite>