Search in sources :

Example 1 with CustomerServiceTester

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

the class AbstractFeatureTest method basicFeatureTest.

public void basicFeatureTest(final String[] springContextPath, String customerName) throws Exception {
    clientCtxt = new ClassPathXmlApplicationContext(springContextPath);
    CustomerServiceTester client = (CustomerServiceTester) clientCtxt.getBean("tester");
    client.testCustomerService(customerName);
    clientCtxt.close();
}
Also used : CustomerServiceTester(org.talend.esb.policy.schemavalidate.testservice.client.CustomerServiceTester) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext)

Example 2 with CustomerServiceTester

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

the class AbstractPolicyTest method basicPolicyTest.

public void basicPolicyTest(final String[] springContextPath, String customerName) throws Exception {
    clientCtxt = new ClassPathXmlApplicationContext(springContextPath);
    CustomerServiceTester tester = (CustomerServiceTester) clientCtxt.getBean("tester");
    tester.testCustomerService(customerName);
    clientCtxt.close();
}
Also used : CustomerServiceTester(org.talend.esb.policy.schemavalidate.testservice.client.CustomerServiceTester) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext)

Example 3 with CustomerServiceTester

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

the class AbstractPolicyTest method customPolicyTest.

public void customPolicyTest(SchemaValidationPolicy assertion, String customerName) throws Exception {
    clientCtxt = new ClassPathXmlApplicationContext("classpath:spring/client/policy/client-defaultApplicationContext.xml");
    ClientProxyFactoryBean clientFactory = (ClientProxyFactoryBean) clientCtxt.getBean(ClientProxyFactoryBean.class);
    Policy policy = new Policy();
    policy.addAssertion(assertion);
    clientFactory.getProperties().put(PolicyConstants.POLICY_OVERRIDE, policy);
    CustomerServiceTester tester = new CustomerServiceTester();
    tester.setCustomerService(clientFactory.create(CustomerService.class));
    tester.testCustomerService(customerName);
    clientCtxt.close();
}
Also used : SchemaValidationPolicy(org.talend.esb.policy.schemavalidate.SchemaValidationPolicy) Policy(org.apache.neethi.Policy) 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)

Example 4 with CustomerServiceTester

use of org.talend.esb.policy.schemavalidate.testservice.client.CustomerServiceTester 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

ClassPathXmlApplicationContext (org.springframework.context.support.ClassPathXmlApplicationContext)4 CustomerServiceTester (org.talend.esb.policy.schemavalidate.testservice.client.CustomerServiceTester)4 CustomerService (com.example.customerservice.CustomerService)2 ClientProxyFactoryBean (org.apache.cxf.frontend.ClientProxyFactoryBean)2 ArrayList (java.util.ArrayList)1 Policy (org.apache.neethi.Policy)1 SchemaValidationPolicy (org.talend.esb.policy.schemavalidate.SchemaValidationPolicy)1 SchemaValidationFeature (org.talend.esb.policy.schemavalidate.feature.SchemaValidationFeature)1