use of com.sun.xml.ws.policy.sourcemodel.AssertionData in project metro-jax-ws by eclipse-ee4j.
the class ManagedServiceAssertionTest method testIsManagementEnabledOn.
public void testIsManagementEnabledOn() throws AssertionCreationException {
final HashMap<QName, String> attributes = new HashMap<QName, String>();
attributes.put(ID_ATTRIBUTE_QNAME, "id1");
attributes.put(MANAGEMENT_ATTRIBUTE_QNAME, "on");
final AssertionData data = AssertionData.createAssertionData(ManagedServiceAssertion.MANAGED_SERVICE_QNAME, null, attributes, false, false);
final ManagedServiceAssertion instance = new ManagedServiceAssertion(data, null);
final boolean result = instance.isManagementEnabled();
assertTrue(result);
}
use of com.sun.xml.ws.policy.sourcemodel.AssertionData in project metro-jax-ws by eclipse-ee4j.
the class ManagedServiceAssertionTest method testMonitoringAttributeOn.
public void testMonitoringAttributeOn() throws AssertionCreationException {
final HashMap<QName, String> attributes = new HashMap<QName, String>();
attributes.put(ID_ATTRIBUTE_QNAME, "id1");
attributes.put(MONITORING_ATTRIBUTE_QNAME, "on");
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.ON, result);
}
use of com.sun.xml.ws.policy.sourcemodel.AssertionData in project metro-jax-ws by eclipse-ee4j.
the class ManagedServiceAssertionTest method testIsManagementEnabledTrue.
public void testIsManagementEnabledTrue() throws AssertionCreationException {
final HashMap<QName, String> attributes = new HashMap<QName, String>();
attributes.put(ID_ATTRIBUTE_QNAME, "id1");
attributes.put(MANAGEMENT_ATTRIBUTE_QNAME, "true");
final AssertionData data = AssertionData.createAssertionData(ManagedServiceAssertion.MANAGED_SERVICE_QNAME, null, attributes, false, false);
final ManagedServiceAssertion instance = new ManagedServiceAssertion(data, null);
final boolean result = instance.isManagementEnabled();
assertTrue(result);
}
use of com.sun.xml.ws.policy.sourcemodel.AssertionData in project metro-jax-ws by eclipse-ee4j.
the class ManagedServiceAssertionTest method testEndpointDisposeDelayValue.
public void testEndpointDisposeDelayValue() throws AssertionCreationException {
final HashMap<QName, String> attributes = new HashMap<QName, String>();
attributes.put(ID_ATTRIBUTE_QNAME, "id1");
attributes.put(ENDPOINT_DISPOSE_DELAY_ATTRIBUTE_QNAME, "4500");
final AssertionData data = AssertionData.createAssertionData(ManagedServiceAssertion.MANAGED_SERVICE_QNAME, null, attributes, false, false);
final ManagedServiceAssertion instance = new ManagedServiceAssertion(data, null);
final long result = instance.getEndpointDisposeDelay(2000l);
assertEquals(4500l, result);
}
use of com.sun.xml.ws.policy.sourcemodel.AssertionData in project metro-jax-ws by eclipse-ee4j.
the class ManagedServiceAssertionTest method testEndpointDisposeDelayInvalid.
public void testEndpointDisposeDelayInvalid() throws AssertionCreationException {
final HashMap<QName, String> attributes = new HashMap<QName, String>();
attributes.put(ID_ATTRIBUTE_QNAME, "id1");
attributes.put(ENDPOINT_DISPOSE_DELAY_ATTRIBUTE_QNAME, "not an integer");
final AssertionData data = AssertionData.createAssertionData(ManagedServiceAssertion.MANAGED_SERVICE_QNAME, null, attributes, false, false);
final ManagedServiceAssertion instance = new ManagedServiceAssertion(data, null);
try {
final long result = instance.getEndpointDisposeDelay(2000l);
fail("Expected a WebserviceException, instead got this value: \"" + result + '"');
} catch (WebServiceException e) {
// Expected this exception
}
}
Aggregations