Search in sources :

Example 6 with ImplementationRecord

use of com.sun.xml.ws.api.config.management.policy.ManagedServiceAssertion.ImplementationRecord in project metro-jax-ws by eclipse-ee4j.

the class ManagedServiceAssertionTest method testGetConfigSaverImplementation.

/**
 * Test of getConfigSaverImplementation method, of class ManagedServiceAssertion.
 */
public void testGetConfigSaverImplementation() throws AssertionCreationException {
    final HashMap<QName, String> configSaverAttributes = new HashMap<QName, String>();
    configSaverAttributes.put(CLASS_NAME_ATTRIBUTE_QNAME, "ConfigSaverTestClass");
    final AssertionData configSaverData = AssertionData.createAssertionData(CONFIG_SAVER_IMPLEMENTATION_PARAMETER_QNAME, null, configSaverAttributes, false, false);
    final PolicyAssertion configSaverParameter = new SimpleAssertion(configSaverData, null) {
    };
    final LinkedList<PolicyAssertion> managedServiceParameters = new LinkedList<PolicyAssertion>();
    managedServiceParameters.add(configSaverParameter);
    final HashMap<QName, String> managedServiceAttributes = new HashMap<QName, String>();
    managedServiceAttributes.put(ID_ATTRIBUTE_QNAME, "id1");
    final AssertionData managedServiceData = AssertionData.createAssertionData(ManagedServiceAssertion.MANAGED_SERVICE_QNAME, null, managedServiceAttributes, false, false);
    final ManagedServiceAssertion instance = new ManagedServiceAssertion(managedServiceData, managedServiceParameters);
    final HashMap<QName, String> expMap = new HashMap<QName, String>();
    ImplementationRecord expResult = new ImplementationRecord("ConfigSaverTestClass", expMap, new LinkedList<NestedParameters>());
    ImplementationRecord result = instance.getConfigSaverImplementation();
    assertEquals(expResult, result);
}
Also used : PolicyAssertion(com.sun.xml.ws.policy.PolicyAssertion) HashMap(java.util.HashMap) QName(javax.xml.namespace.QName) SimpleAssertion(com.sun.xml.ws.policy.SimpleAssertion) ImplementationRecord(com.sun.xml.ws.api.config.management.policy.ManagedServiceAssertion.ImplementationRecord) LinkedList(java.util.LinkedList) NestedParameters(com.sun.xml.ws.api.config.management.policy.ManagedServiceAssertion.NestedParameters) AssertionData(com.sun.xml.ws.policy.sourcemodel.AssertionData)

Example 7 with ImplementationRecord

use of com.sun.xml.ws.api.config.management.policy.ManagedServiceAssertion.ImplementationRecord in project metro-jax-ws by eclipse-ee4j.

the class ManagedServiceAssertionTest method testGetConfigReaderImplementationJdbcDataSourceName.

public void testGetConfigReaderImplementationJdbcDataSourceName() throws AssertionCreationException {
    final AssertionData parameterData = AssertionData.createAssertionData(new QName("parameter"), "source1", null, false, false);
    final LinkedList<PolicyAssertion> configReaderParameters = new LinkedList<PolicyAssertion>();
    configReaderParameters.add(new SimpleAssertion(parameterData, null) {
    });
    final AssertionData configReaderData = AssertionData.createAssertionData(CONFIG_READER_IMPLEMENTATION_PARAMETER_QNAME, null, null, false, false);
    final PolicyAssertion configReaderParameter = new SimpleAssertion(configReaderData, configReaderParameters) {
    };
    final LinkedList<PolicyAssertion> managedServiceParameters = new LinkedList<PolicyAssertion>();
    managedServiceParameters.add(configReaderParameter);
    final HashMap<QName, String> managedServiceAttributes = new HashMap<QName, String>();
    managedServiceAttributes.put(ID_ATTRIBUTE_QNAME, "id1");
    final AssertionData managedServiceData = AssertionData.createAssertionData(ManagedServiceAssertion.MANAGED_SERVICE_QNAME, null, managedServiceAttributes, false, false);
    final ManagedServiceAssertion instance = new ManagedServiceAssertion(managedServiceData, managedServiceParameters);
    final HashMap<String, String> expMap = new HashMap<String, String>();
    ImplementationRecord implementation = instance.getConfigReaderImplementation();
    Map<QName, String> parameters = implementation.getParameters();
    String expResult = "source1";
    String result = parameters.get(new QName("parameter"));
    assertEquals(expResult, result);
}
Also used : PolicyAssertion(com.sun.xml.ws.policy.PolicyAssertion) HashMap(java.util.HashMap) QName(javax.xml.namespace.QName) SimpleAssertion(com.sun.xml.ws.policy.SimpleAssertion) ImplementationRecord(com.sun.xml.ws.api.config.management.policy.ManagedServiceAssertion.ImplementationRecord) LinkedList(java.util.LinkedList) AssertionData(com.sun.xml.ws.policy.sourcemodel.AssertionData)

Aggregations

ImplementationRecord (com.sun.xml.ws.api.config.management.policy.ManagedServiceAssertion.ImplementationRecord)7 PolicyAssertion (com.sun.xml.ws.policy.PolicyAssertion)7 SimpleAssertion (com.sun.xml.ws.policy.SimpleAssertion)7 AssertionData (com.sun.xml.ws.policy.sourcemodel.AssertionData)7 HashMap (java.util.HashMap)7 LinkedList (java.util.LinkedList)7 QName (javax.xml.namespace.QName)7 NestedParameters (com.sun.xml.ws.api.config.management.policy.ManagedServiceAssertion.NestedParameters)5