You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2009/06/16 10:42:11 UTC
svn commit: r785111 - in /camel/trunk/components/camel-hl7: ./
src/test/java/org/apache/camel/component/hl7/
Author: ningjiang
Date: Tue Jun 16 08:42:11 2009
New Revision: 785111
URL: http://svn.apache.org/viewvc?rev=785111&view=rev
Log:
CAMEL-1712 Upgraded the camel-hl7 to JUnit4
Modified:
camel/trunk/components/camel-hl7/pom.xml
camel/trunk/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7DataFormatTest.java
camel/trunk/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecLongTest.java
camel/trunk/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecPlainStringTest.java
camel/trunk/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecStandAndEndBytesTest.java
camel/trunk/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecTest.java
camel/trunk/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7RouteTest.java
Modified: camel/trunk/components/camel-hl7/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-hl7/pom.xml?rev=785111&r1=785110&r2=785111&view=diff
==============================================================================
--- camel/trunk/components/camel-hl7/pom.xml (original)
+++ camel/trunk/components/camel-hl7/pom.xml Tue Jun 16 08:42:11 2009
@@ -65,8 +65,7 @@
<!-- testing -->
<dependency>
<groupId>org.apache.camel</groupId>
- <artifactId>camel-core</artifactId>
- <type>test-jar</type>
+ <artifactId>camel-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Modified: camel/trunk/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7DataFormatTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7DataFormatTest.java?rev=785111&r1=785110&r2=785111&view=diff
==============================================================================
--- camel/trunk/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7DataFormatTest.java (original)
+++ camel/trunk/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7DataFormatTest.java Tue Jun 16 08:42:11 2009
@@ -21,15 +21,18 @@
import ca.uhn.hl7v2.model.v24.segment.MSA;
import ca.uhn.hl7v2.model.v24.segment.MSH;
import ca.uhn.hl7v2.model.v24.segment.QRD;
-import org.apache.camel.ContextTestSupport;
+
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
/**
* Unit test for HL7 DataFormat.
*/
-public class HL7DataFormatTest extends ContextTestSupport {
+public class HL7DataFormatTest extends CamelTestSupport {
+ @Test
public void testMarshal() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:marshal");
mock.expectedMessageCount(1);
@@ -43,6 +46,7 @@
assertMockEndpointsSatisfied();
}
+ @Test
public void testUnmarshal() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:unmarshal");
mock.expectedMessageCount(1);
Modified: camel/trunk/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecLongTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecLongTest.java?rev=785111&r1=785110&r2=785111&view=diff
==============================================================================
--- camel/trunk/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecLongTest.java (original)
+++ camel/trunk/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecLongTest.java Tue Jun 16 08:42:11 2009
@@ -23,17 +23,18 @@
import ca.uhn.hl7v2.model.v25.message.MDM_T02;
import ca.uhn.hl7v2.model.v25.segment.MSH;
-import org.apache.camel.ContextTestSupport;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.JndiRegistry;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
/**
* Unit test for the HL7MLLP Codec.
*/
-public class HL7MLLPCodecLongTest extends ContextTestSupport {
+public class HL7MLLPCodecLongTest extends CamelTestSupport {
protected JndiRegistry createRegistry() throws Exception {
JndiRegistry jndi = super.createRegistry();
@@ -65,6 +66,7 @@
};
}
+ @Test
public void testSendHL7Message() throws Exception {
// START SNIPPET: e2
BufferedReader in = new BufferedReader(new InputStreamReader(getClass().getResourceAsStream("/mdm_t02.txt")));
Modified: camel/trunk/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecPlainStringTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecPlainStringTest.java?rev=785111&r1=785110&r2=785111&view=diff
==============================================================================
--- camel/trunk/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecPlainStringTest.java (original)
+++ camel/trunk/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecPlainStringTest.java Tue Jun 16 08:42:11 2009
@@ -16,18 +16,19 @@
*/
package org.apache.camel.component.hl7;
-import org.apache.camel.ContextTestSupport;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.impl.JndiRegistry;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
/**
* Unit test to demonstrate the HL7MLLPCodec is message format agnostic (don't require the HAPI library).
* The message format can be java.lang.String.
*/
-public class HL7MLLPCodecPlainStringTest extends ContextTestSupport {
+public class HL7MLLPCodecPlainStringTest extends CamelTestSupport {
protected JndiRegistry createRegistry() throws Exception {
JndiRegistry jndi = super.createRegistry();
@@ -40,6 +41,7 @@
return jndi;
}
+ @Test
public void testPlainString() throws Exception {
// START SNIPPET: e1
MockEndpoint mock = getMockEndpoint("mock:result");
Modified: camel/trunk/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecStandAndEndBytesTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecStandAndEndBytesTest.java?rev=785111&r1=785110&r2=785111&view=diff
==============================================================================
--- camel/trunk/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecStandAndEndBytesTest.java (original)
+++ camel/trunk/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecStandAndEndBytesTest.java Tue Jun 16 08:42:11 2009
@@ -22,16 +22,17 @@
import ca.uhn.hl7v2.model.v24.segment.MSH;
import ca.uhn.hl7v2.model.v24.segment.QRD;
-import org.apache.camel.ContextTestSupport;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.JndiRegistry;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
/**
* Unit test for the HL7MLLP Codec using different start and end bytes.
*/
-public class HL7MLLPCodecStandAndEndBytesTest extends ContextTestSupport {
+public class HL7MLLPCodecStandAndEndBytesTest extends CamelTestSupport {
protected JndiRegistry createRegistry() throws Exception {
JndiRegistry jndi = super.createRegistry();
@@ -70,6 +71,7 @@
};
}
+ @Test
public void testSendHL7Message() throws Exception {
String line1 = "MSH|^~\\&|MYSENDER|MYRECEIVER|MYAPPLICATION||200612211200||QRY^A19|1234|P|2.4";
String line2 = "QRD|200612211200|R|I|GetPatient|||1^RD|0101701234|DEM||";
Modified: camel/trunk/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecTest.java?rev=785111&r1=785110&r2=785111&view=diff
==============================================================================
--- camel/trunk/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecTest.java (original)
+++ camel/trunk/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecTest.java Tue Jun 16 08:42:11 2009
@@ -22,16 +22,17 @@
import ca.uhn.hl7v2.model.v24.segment.MSH;
import ca.uhn.hl7v2.model.v24.segment.QRD;
-import org.apache.camel.ContextTestSupport;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.JndiRegistry;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
/**
* Unit test for the HL7MLLP Codec.
*/
-public class HL7MLLPCodecTest extends ContextTestSupport {
+public class HL7MLLPCodecTest extends CamelTestSupport {
protected JndiRegistry createRegistry() throws Exception {
JndiRegistry jndi = super.createRegistry();
@@ -67,6 +68,7 @@
};
}
+ @Test
public void testSendHL7Message() throws Exception {
// START SNIPPET: e2
String line1 = "MSH|^~\\&|MYSENDER|MYRECEIVER|MYAPPLICATION||200612211200||QRY^A19|1234|P|2.4";
Modified: camel/trunk/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7RouteTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7RouteTest.java?rev=785111&r1=785110&r2=785111&view=diff
==============================================================================
--- camel/trunk/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7RouteTest.java (original)
+++ camel/trunk/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7RouteTest.java Tue Jun 16 08:42:11 2009
@@ -24,16 +24,17 @@
import ca.uhn.hl7v2.model.v24.segment.MSH;
import ca.uhn.hl7v2.model.v24.segment.PID;
import ca.uhn.hl7v2.model.v24.segment.QRD;
-import org.apache.camel.ContextTestSupport;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.impl.JndiRegistry;
import org.apache.camel.spi.DataFormat;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
/**
* Unit test for HL7 routing.
*/
-public class HL7RouteTest extends ContextTestSupport {
+public class HL7RouteTest extends CamelTestSupport {
protected JndiRegistry createRegistry() throws Exception {
JndiRegistry jndi = super.createRegistry();
@@ -49,6 +50,7 @@
return jndi;
}
+ @Test
public void testSendA19() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:a19");
mock.expectedMessageCount(1);
@@ -71,6 +73,7 @@
assertMockEndpointsSatisfied();
}
+ @Test
public void testSendA01() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:a01");
mock.expectedMessageCount(1);
@@ -92,6 +95,7 @@
assertMockEndpointsSatisfied();
}
+ @Test
public void testSendUnknown() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:unknown");
mock.expectedMessageCount(1);