View Javadoc
1   /*
2    * Copyright 2008 the original author or authors.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *     
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
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   * @author Martin Krasser
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  }