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);
}
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);
}
Aggregations