1   
2   
3   
4   
5   
6   
7   
8   
9   
10  
11  
12  
13  
14  
15  
16  package org.openehealth.ipf.platform.camel.core.extend;
17  
18  import org.apache.camel.CamelContext;
19  import org.apache.camel.EndpointInject;
20  import org.apache.camel.ProducerTemplate;
21  import org.apache.camel.component.mock.MockEndpoint;
22  import org.junit.After;
23  import org.junit.runner.RunWith;
24  import org.springframework.beans.factory.annotation.Autowired;
25  import org.springframework.test.context.ContextConfiguration;
26  import org.springframework.test.context.TestExecutionListeners;
27  import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
28  import org.springframework.test.context.support.DependencyInjectionTestExecutionListener;
29  
30  
31  
32  
33  @RunWith(SpringJUnit4ClassRunner.class)
34  @ContextConfiguration(locations = { 
35          "/context-core-extend.xml", 
36          "/context-core-extend-support.xml" 
37  })
38  @TestExecutionListeners({DependencyInjectionTestExecutionListener.class})
39  public abstract class AbstractExtensionTest {
40  
41      @Autowired
42      protected CamelContext cc;
43      
44      @Autowired
45      protected ProducerTemplate producerTemplate;
46      
47      @EndpointInject(uri="mock:output")
48      protected MockEndpoint mockOutput;
49      
50      @EndpointInject(uri="mock:error")
51      protected MockEndpoint mockError;
52      
53      @After
54      public void tearDown() throws Exception {
55          mockOutput.reset();
56          mockError.reset();
57      }
58  
59  }