diff options
Diffstat (limited to 'java/sca/modules/definitions-xml/src')
-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.java | 31 |
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) {
- }
-
- }
}
|