Search in sources :

Example 6 with SchemaValidationPolicy

use of org.talend.esb.policy.schemavalidate.SchemaValidationPolicy in project tesb-rt-se by Talend.

the class CustomSchemaPolicyTest method testLocalCustomSchemaConsumerResponseValid.

@Test
public void testLocalCustomSchemaConsumerResponseValid() throws Exception {
    SchemaValidationPolicy policy = new SchemaValidationPolicy();
    policy.setAppliesToType(SchemaValidationPolicy.AppliesToType.valueOf("consumer"));
    policy.setMessageType(SchemaValidationPolicy.MessageType.valueOf("response"));
    policy.setValidationType(ValidationType.valueOf("CustomSchema"));
    policy.setCustomSchemaPath("schema/valid.xsd");
    customPolicyTest(policy, VALID_CUSTOMER_NAME);
}
Also used : SchemaValidationPolicy(org.talend.esb.policy.schemavalidate.SchemaValidationPolicy) Test(org.junit.Test)

Example 7 with SchemaValidationPolicy

use of org.talend.esb.policy.schemavalidate.SchemaValidationPolicy in project tesb-rt-se by Talend.

the class CustomSchemaPolicyTest method testLocalCustomSchemaConsumerResponseNotValid.

@Test(expected = SOAPFaultException.class)
public void testLocalCustomSchemaConsumerResponseNotValid() throws Exception {
    SchemaValidationPolicy policy = new SchemaValidationPolicy();
    policy.setAppliesToType(SchemaValidationPolicy.AppliesToType.valueOf("consumer"));
    policy.setMessageType(SchemaValidationPolicy.MessageType.valueOf("response"));
    policy.setValidationType(ValidationType.valueOf("CustomSchema"));
    policy.setCustomSchemaPath("schema/valid.xsd");
    customPolicyTest(policy, NOT_VALID_CUSTOMER_NAME);
}
Also used : SchemaValidationPolicy(org.talend.esb.policy.schemavalidate.SchemaValidationPolicy) Test(org.junit.Test)

Aggregations

SchemaValidationPolicy (org.talend.esb.policy.schemavalidate.SchemaValidationPolicy)7 Test (org.junit.Test)5 CustomerService (com.example.customerservice.CustomerService)1 IOException (java.io.IOException)1 ClientProxyFactoryBean (org.apache.cxf.frontend.ClientProxyFactoryBean)1 AssertionInfo (org.apache.cxf.ws.policy.AssertionInfo)1 AssertionInfoMap (org.apache.cxf.ws.policy.AssertionInfoMap)1 Policy (org.apache.neethi.Policy)1 ClassPathXmlApplicationContext (org.springframework.context.support.ClassPathXmlApplicationContext)1 AppliesToType (org.talend.esb.policy.schemavalidate.SchemaValidationPolicy.AppliesToType)1 MessageType (org.talend.esb.policy.schemavalidate.SchemaValidationPolicy.MessageType)1 ValidationType (org.talend.esb.policy.schemavalidate.SchemaValidationPolicy.ValidationType)1 CustomerServiceTester (org.talend.esb.policy.schemavalidate.testservice.client.CustomerServiceTester)1