Search in sources :

Example 51 with AssertionData

use of com.sun.xml.ws.policy.sourcemodel.AssertionData in project metro-jax-ws by eclipse-ee4j.

the class ManagedServiceAssertionTest method testGetStart.

/**
 * Test of getStart method, of class ManagedServiceAssertion.
 */
public void testGetStart() throws AssertionCreationException {
    final HashMap<QName, String> attributes = new HashMap<QName, String>();
    attributes.put(ID_ATTRIBUTE_QNAME, "id1");
    attributes.put(START_ATTRIBUTE_QNAME, "notify");
    final AssertionData data = AssertionData.createAssertionData(ManagedServiceAssertion.MANAGED_SERVICE_QNAME, null, attributes, false, false);
    ManagedServiceAssertion instance = new ManagedServiceAssertion(data, null);
    String expResult = "notify";
    String result = instance.getStart();
    assertEquals(expResult, result);
}
Also used : HashMap(java.util.HashMap) QName(javax.xml.namespace.QName) AssertionData(com.sun.xml.ws.policy.sourcemodel.AssertionData)

Example 52 with AssertionData

use of com.sun.xml.ws.policy.sourcemodel.AssertionData 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 53 with AssertionData

use of com.sun.xml.ws.policy.sourcemodel.AssertionData 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)

Example 54 with AssertionData

use of com.sun.xml.ws.policy.sourcemodel.AssertionData in project metro-jax-ws by eclipse-ee4j.

the class ManagedServiceAssertionTest method testIsManagementEnabled.

public void testIsManagementEnabled() throws AssertionCreationException {
    final HashMap<QName, String> attributes = new HashMap<QName, String>();
    attributes.put(ID_ATTRIBUTE_QNAME, "id1");
    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);
}
Also used : HashMap(java.util.HashMap) QName(javax.xml.namespace.QName) AssertionData(com.sun.xml.ws.policy.sourcemodel.AssertionData)

Aggregations

AssertionData (com.sun.xml.ws.policy.sourcemodel.AssertionData)54 QName (javax.xml.namespace.QName)49 HashMap (java.util.HashMap)39 LinkedList (java.util.LinkedList)16 Setting (com.sun.xml.ws.api.config.management.policy.ManagementAssertion.Setting)10 PolicyAssertion (com.sun.xml.ws.policy.PolicyAssertion)9 ImplementationRecord (com.sun.xml.ws.api.config.management.policy.ManagedServiceAssertion.ImplementationRecord)7 SimpleAssertion (com.sun.xml.ws.policy.SimpleAssertion)7 NestedParameters (com.sun.xml.ws.api.config.management.policy.ManagedServiceAssertion.NestedParameters)5 ModelNode (com.sun.xml.ws.policy.sourcemodel.ModelNode)3 PolicySourceModel (com.sun.xml.ws.policy.sourcemodel.PolicySourceModel)3 AssertionSet (com.sun.xml.ws.policy.AssertionSet)2 PolicyModelTranslator (com.sun.xml.ws.policy.sourcemodel.PolicyModelTranslator)2 ModelTranslator (com.sun.xml.ws.api.policy.ModelTranslator)1 Policy (com.sun.xml.ws.policy.Policy)1 AssertionCreationException (com.sun.xml.ws.policy.spi.AssertionCreationException)1 WebServiceException (jakarta.xml.ws.WebServiceException)1 AddressingFeature (jakarta.xml.ws.soap.AddressingFeature)1 StringReader (java.io.StringReader)1 URI (java.net.URI)1