use of com.sun.xml.ws.policy.sourcemodel.AssertionData in project metro-jax-ws by eclipse-ee4j.
the class ManagedServiceAssertionTest method testMonitoringAttributeFalse.
public void testMonitoringAttributeFalse() throws AssertionCreationException {
final HashMap<QName, String> attributes = new HashMap<QName, String>();
attributes.put(ID_ATTRIBUTE_QNAME, "id1");
attributes.put(MONITORING_ATTRIBUTE_QNAME, "false");
final AssertionData data = AssertionData.createAssertionData(ManagedServiceAssertion.MANAGED_SERVICE_QNAME, null, attributes, false, false);
final ManagedServiceAssertion instance = new ManagedServiceAssertion(data, null);
final Setting result = instance.monitoringAttribute();
assertSame(Setting.OFF, result);
}
use of com.sun.xml.ws.policy.sourcemodel.AssertionData in project metro-jax-ws by eclipse-ee4j.
the class ManagedServiceAssertionTest method testGetConfigReaderImplementation.
/**
* Test of getConfigReaderImplementation method, of class ManagedServiceAssertion.
*/
public void testGetConfigReaderImplementation() throws AssertionCreationException {
final HashMap<QName, String> configReaderAttributes = new HashMap<QName, String>();
configReaderAttributes.put(CLASS_NAME_ATTRIBUTE_QNAME, "ConfigReaderTestClass");
final AssertionData configReaderData = AssertionData.createAssertionData(CONFIG_READER_IMPLEMENTATION_PARAMETER_QNAME, null, configReaderAttributes, false, false);
final PolicyAssertion configReaderParameter = new SimpleAssertion(configReaderData, null) {
};
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<QName, String> expMap = new HashMap<QName, String>();
ImplementationRecord expResult = new ImplementationRecord("ConfigReaderTestClass", expMap, new LinkedList<NestedParameters>());
ImplementationRecord result = instance.getConfigReaderImplementation();
assertEquals(expResult, result);
}
use of com.sun.xml.ws.policy.sourcemodel.AssertionData in project metro-jax-ws by eclipse-ee4j.
the class ManagedServiceAssertionTest method testGetCommunicationServerJmxServerUrl.
public void testGetCommunicationServerJmxServerUrl() throws AssertionCreationException {
final QName jmxServerUrlName = new QName(PolicyConstants.SUN_MANAGEMENT_NAMESPACE, "JmxServerUrl");
final AssertionData environmentData = AssertionData.createAssertionData(jmxServerUrlName, "http://localhost/", null, false, false);
final LinkedList<PolicyAssertion> environmentParameters = new LinkedList<PolicyAssertion>();
environmentParameters.add(new SimpleAssertion(environmentData, null) {
});
final AssertionData commServerData = AssertionData.createAssertionData(COMMUNICATION_SERVER_IMPLEMENTATION_PARAMETER_QNAME, null, null, false, false);
final LinkedList<PolicyAssertion> commServerParameters = new LinkedList<PolicyAssertion>();
commServerParameters.add(new SimpleAssertion(commServerData, environmentParameters) {
});
final AssertionData commServersData = AssertionData.createAssertionData(COMMUNICATION_SERVER_IMPLEMENTATIONS_PARAMETER_QNAME, null, null, false, false);
final LinkedList<PolicyAssertion> managedServiceParameters = new LinkedList<PolicyAssertion>();
managedServiceParameters.add(new SimpleAssertion(commServersData, commServerParameters) {
});
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 Collection<ImplementationRecord> implementations = instance.getCommunicationServerImplementations();
final ImplementationRecord implementation = implementations.iterator().next();
final Map<QName, String> result = implementation.getParameters();
final Map<QName, String> expResult = new HashMap<QName, String>();
expResult.put(jmxServerUrlName, "http://localhost/");
assertEquals(expResult, result);
}
use of com.sun.xml.ws.policy.sourcemodel.AssertionData in project metro-jax-ws by eclipse-ee4j.
the class ManagedServiceAssertionTest method testNoIdManagementDisabled.
/**
* Test of getId method, of class ManagedServiceAssertion.
*/
public void testNoIdManagementDisabled() throws AssertionCreationException {
final HashMap<QName, String> attributes = new HashMap<QName, String>();
attributes.put(MANAGEMENT_ATTRIBUTE_QNAME, "false");
final AssertionData data = AssertionData.createAssertionData(ManagedServiceAssertion.MANAGED_SERVICE_QNAME, null, attributes, false, false);
ManagedServiceAssertion instance = new ManagedServiceAssertion(data, null);
String result = instance.getId();
assertNull(result);
}
use of com.sun.xml.ws.policy.sourcemodel.AssertionData in project metro-jax-ws by eclipse-ee4j.
the class ManagedServiceAssertionTest method testGetConfiguratorImplementation.
/**
* Test of getConfiguratorImplementation method, of class ManagedServiceAssertion.
*/
public void testGetConfiguratorImplementation() throws AssertionCreationException {
final HashMap<QName, String> configuratorAttributes = new HashMap<QName, String>();
configuratorAttributes.put(CLASS_NAME_ATTRIBUTE_QNAME, "ConfiguratorTestClass");
final AssertionData configuratorData = AssertionData.createAssertionData(CONFIGURATOR_IMPLEMENTATION_PARAMETER_QNAME, null, configuratorAttributes, false, false);
final PolicyAssertion configuratorParameter = new SimpleAssertion(configuratorData, null) {
};
final LinkedList<PolicyAssertion> managedServiceParameters = new LinkedList<PolicyAssertion>();
managedServiceParameters.add(configuratorParameter);
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("ConfiguratorTestClass", expMap, new LinkedList<NestedParameters>());
ImplementationRecord result = instance.getConfiguratorImplementation();
assertEquals(expResult, result);
}
Aggregations