summaryrefslogtreecommitdiffstats
path: root/java/sca
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-03-03 23:29:10 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-03-03 23:29:10 +0000
commit43b9ca7fabd00b0c3ec6d2d91f261f94babb2e91 (patch)
tree32fc008c3809b914df0ef953a1fb3f1444b21315 /java/sca
parent10ede45693e24dc7450560fa575ece3a346c51b8 (diff)
Minor refactoring of the test case
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@749840 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca')
-rw-r--r--java/sca/modules/definitions-xml/src/test/java/org/apache/tuscany/sca/definitions/MockPolicy.java (renamed from java/sca/modules/definitions-xml/src/test/java/org/apache/tuscany/sca/definitions/Policy.java)72
-rw-r--r--java/sca/modules/definitions-xml/src/test/java/org/apache/tuscany/sca/definitions/TestPolicyProcessor.java31
2 files changed, 46 insertions, 57 deletions
diff --git a/java/sca/modules/definitions-xml/src/test/java/org/apache/tuscany/sca/definitions/Policy.java b/java/sca/modules/definitions-xml/src/test/java/org/apache/tuscany/sca/definitions/MockPolicy.java
index 187b7fa9f8..496a909572 100644
--- a/java/sca/modules/definitions-xml/src/test/java/org/apache/tuscany/sca/definitions/Policy.java
+++ b/java/sca/modules/definitions-xml/src/test/java/org/apache/tuscany/sca/definitions/MockPolicy.java
@@ -1,33 +1,39 @@
-/*
- * 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 org.apache.tuscany.sca.definitions;
-
-import javax.xml.namespace.QName;
-
-/**
- * Interface that will abstract various types of policy specifications
- * and attachments for example WS-Policy
- *
- * @version $Rev$ $Date$
- */
-public interface Policy {
- QName getSchemaName();
- void setUnresolved(boolean unresolved);
- boolean isUnresolved();
-}
+/*
+ * 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 org.apache.tuscany.sca.definitions;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Mocked Policy
+ */
+public class MockPolicy {
+ public QName getName() {
+ return new QName("http://schemas.xmlsoap.org/ws/2004/09/policy", "PolicyAttachment");
+ }
+
+ public boolean isUnresolved() {
+ return false;
+ }
+
+ public void setUnresolved(boolean unresolved) {
+ }
+
+}
diff --git a/java/sca/modules/definitions-xml/src/test/java/org/apache/tuscany/sca/definitions/TestPolicyProcessor.java b/java/sca/modules/definitions-xml/src/test/java/org/apache/tuscany/sca/definitions/TestPolicyProcessor.java
index 270aed0f90..73a84f5354 100644
--- a/java/sca/modules/definitions-xml/src/test/java/org/apache/tuscany/sca/definitions/TestPolicyProcessor.java
+++ b/java/sca/modules/definitions-xml/src/test/java/org/apache/tuscany/sca/definitions/TestPolicyProcessor.java
@@ -34,41 +34,24 @@ import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
*
* @version $Rev$ $Date$
*/
-public class TestPolicyProcessor implements StAXArtifactProcessor<Policy> {
-
+public class TestPolicyProcessor implements StAXArtifactProcessor<MockPolicy> {
public QName getArtifactType() {
return new QName("http://schemas.xmlsoap.org/ws/2004/09/policy", "PolicyAttachment");
}
- public Policy read(XMLStreamReader arg0) throws ContributionReadException, XMLStreamException {
- return new MockPolicyImplOne();
+ public MockPolicy read(XMLStreamReader arg0) throws ContributionReadException, XMLStreamException {
+ return new MockPolicy();
}
- public void write(Policy arg0, XMLStreamWriter arg1) throws ContributionWriteException,
- XMLStreamException {
+ public void write(MockPolicy arg0, XMLStreamWriter arg1) throws ContributionWriteException, XMLStreamException {
}
- public Class<Policy> getModelType() {
- // TODO Auto-generated method stub
- return Policy.class;
+ public Class<MockPolicy> getModelType() {
+ return MockPolicy.class;
}
- public void resolve(Policy arg0, ModelResolver arg1) throws ContributionResolveException {
+ public void resolve(MockPolicy arg0, ModelResolver arg1) throws ContributionResolveException {
}
-
- public class MockPolicyImplOne implements Policy {
- public QName getSchemaName() {
- return new QName("http://schemas.xmlsoap.org/ws/2004/09/policy", "PolicyAttachment");
- }
-
- public boolean isUnresolved() {
- return false;
- }
-
- public void setUnresolved(boolean unresolved) {
- }
-
- }
}