Search in sources :

Example 1 with SchemaValidationFeature

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

the class CustomSchemaFeatureTest method testLocalCustomSchemaNotExists.

@Test(expected = SOAPFaultException.class)
public void testLocalCustomSchemaNotExists() throws Exception {
    SchemaValidationFeature f = new SchemaValidationFeature();
    f.setAppliesTo("consumer");
    f.setMessage("request");
    f.setType("CustomSchema");
    f.setPath(NOT_EXISTING_SCHEMA_RELATIVE_PATH);
    customFeatureTest(f, VALID_CUSTOMER_NAME);
}
Also used : SchemaValidationFeature(org.talend.esb.policy.schemavalidate.feature.SchemaValidationFeature) Test(org.junit.Test)

Example 2 with SchemaValidationFeature

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

the class CustomSchemaFeatureTest method testLocalNotValidCustomSchema.

@Test(expected = SOAPFaultException.class)
public void testLocalNotValidCustomSchema() throws Exception {
    SchemaValidationFeature f = new SchemaValidationFeature();
    f.setAppliesTo("consumer");
    f.setMessage("response");
    f.setType("CustomSchema");
    f.setPath(NOT_VALID_SCHEMA_RELATIVE_PATH);
    customFeatureTest(f, VALID_CUSTOMER_NAME);
}
Also used : SchemaValidationFeature(org.talend.esb.policy.schemavalidate.feature.SchemaValidationFeature) Test(org.junit.Test)

Example 3 with SchemaValidationFeature

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

the class CustomSchemaFeatureTest method testLocalCustomSchemaAbsolutePathConsumerResponseValid.

@Test
public void testLocalCustomSchemaAbsolutePathConsumerResponseValid() throws Exception {
    SchemaValidationFeature f = new SchemaValidationFeature();
    f.setAppliesTo("consumer");
    f.setMessage("response");
    f.setType("CustomSchema");
    f.setPath(VALID_SCHEMA_ABSOLUTE_PATH);
    customFeatureTest(f, VALID_CUSTOMER_NAME);
}
Also used : SchemaValidationFeature(org.talend.esb.policy.schemavalidate.feature.SchemaValidationFeature) Test(org.junit.Test)

Example 4 with SchemaValidationFeature

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

the class WSDLSchemaFeatureTest method testWsdlConsumerResponseValid.

@Test
public void testWsdlConsumerResponseValid() throws Exception {
    SchemaValidationFeature f = new SchemaValidationFeature();
    f.setAppliesTo("consumer");
    f.setMessage("response");
    f.setType("WSDLSchema");
    customFeatureTest(f, VALID_CUSTOMER_NAME);
}
Also used : SchemaValidationFeature(org.talend.esb.policy.schemavalidate.feature.SchemaValidationFeature) Test(org.junit.Test)

Example 5 with SchemaValidationFeature

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

the class AbstractFeatureTest method customFeatureTest.

public void customFeatureTest(SchemaValidationFeature feature, String customerName) throws Exception {
    clientCtxt = new ClassPathXmlApplicationContext("classpath:spring/client/feature/client-defaultApplicationContext.xml");
    ClientProxyFactoryBean clientFactory = (ClientProxyFactoryBean) clientCtxt.getBean(ClientProxyFactoryBean.class);
    List<SchemaValidationFeature> features = new ArrayList<SchemaValidationFeature>();
    features.add(feature);
    clientFactory.setFeatures(features);
    CustomerServiceTester tester = new CustomerServiceTester();
    tester.setCustomerService(clientFactory.create(CustomerService.class));
    tester.testCustomerService(customerName);
    clientCtxt.close();
}
Also used : CustomerService(com.example.customerservice.CustomerService) CustomerServiceTester(org.talend.esb.policy.schemavalidate.testservice.client.CustomerServiceTester) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) ClientProxyFactoryBean(org.apache.cxf.frontend.ClientProxyFactoryBean) ArrayList(java.util.ArrayList) SchemaValidationFeature(org.talend.esb.policy.schemavalidate.feature.SchemaValidationFeature)

Aggregations

SchemaValidationFeature (org.talend.esb.policy.schemavalidate.feature.SchemaValidationFeature)8 Test (org.junit.Test)7 CustomerService (com.example.customerservice.CustomerService)1 ArrayList (java.util.ArrayList)1 ClientProxyFactoryBean (org.apache.cxf.frontend.ClientProxyFactoryBean)1 ClassPathXmlApplicationContext (org.springframework.context.support.ClassPathXmlApplicationContext)1 CustomerServiceTester (org.talend.esb.policy.schemavalidate.testservice.client.CustomerServiceTester)1