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/17 16:08:33 UTC
svn commit: r785611 - in /camel/trunk/components/camel-jt400: ./
src/test/java/org/apache/camel/component/jt400/
Author: ningjiang
Date: Wed Jun 17 14:08:33 2009
New Revision: 785611
URL: http://svn.apache.org/viewvc?rev=785611&view=rev
Log:
CAMEL-1712 Upgraded the camel-jt400 to JUnit4
Modified:
camel/trunk/components/camel-jt400/pom.xml
camel/trunk/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400ComponentTest.java
camel/trunk/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400DataQueueEndpointTest.java
camel/trunk/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400RouteTest.java
Modified: camel/trunk/components/camel-jt400/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jt400/pom.xml?rev=785611&r1=785610&r2=785611&view=diff
==============================================================================
--- camel/trunk/components/camel-jt400/pom.xml (original)
+++ camel/trunk/components/camel-jt400/pom.xml Wed Jun 17 14:08:33 2009
@@ -45,8 +45,7 @@
<!-- test dependencies -->
<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-jt400/src/test/java/org/apache/camel/component/jt400/Jt400ComponentTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400ComponentTest.java?rev=785611&r1=785610&r2=785611&view=diff
==============================================================================
--- camel/trunk/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400ComponentTest.java (original)
+++ camel/trunk/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400ComponentTest.java Wed Jun 17 14:08:33 2009
@@ -22,24 +22,27 @@
import org.apache.camel.CamelException;
import org.apache.camel.Endpoint;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
/**
* Test case for {@link Jt400Component}
*/
@SuppressWarnings("unchecked")
-public class Jt400ComponentTest extends TestCase {
+public class Jt400ComponentTest extends Assert {
private Jt400Component component;
- @Override
- protected void setUp() throws Exception {
- super.setUp();
+ @Before
+ public void setUp() throws Exception {
component = new Jt400Component();
}
/**
* Test creation of a {@link Jt400DataQueueEndpoint}
*/
+ @Test
public void testCreateEndpoint() throws Exception {
Endpoint endpoint = component
.createEndpoint("jt400://user:password@host/qsys.lib/library.lib/queue.dtaq",
@@ -51,6 +54,7 @@
/**
* Test exception when trying to access any other object type on AS/400
*/
+ @Test
public void testCreateEndpointForOtherObjectType() throws Exception {
try {
component.createEndpoint("jt400://user:password@host/qsys.lib/library.lib/program.pgm",
Modified: camel/trunk/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400DataQueueEndpointTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400DataQueueEndpointTest.java?rev=785611&r1=785610&r2=785611&view=diff
==============================================================================
--- camel/trunk/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400DataQueueEndpointTest.java (original)
+++ camel/trunk/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400DataQueueEndpointTest.java Wed Jun 17 14:08:33 2009
@@ -16,18 +16,21 @@
*/
package org.apache.camel.component.jt400;
-import org.apache.camel.ContextTestSupport;
import org.apache.camel.component.jt400.Jt400DataQueueEndpoint.Format;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Before;
+import org.junit.Test;
/**
* Test case for {@link Jt400DataQueueEndpoint}
*/
-public class Jt400DataQueueEndpointTest extends ContextTestSupport {
+public class Jt400DataQueueEndpointTest extends CamelTestSupport {
private Jt400DataQueueEndpoint endpoint;
@Override
- protected void setUp() throws Exception {
+ @Before
+ public void setUp() throws Exception {
super.setUp();
endpoint = (Jt400DataQueueEndpoint)resolveMandatoryEndpoint("jt400://user:password@host/qsys.lib/library.lib/queue.dtaq?ccsid=500&format=binary");
}
@@ -35,6 +38,7 @@
/**
* Check that the AS/400 connection is correctly configured for the URL
*/
+ @Test
public void testSystemConfiguration() {
assertEquals("USER", endpoint.getSystem().getUserId());
assertEquals("host", endpoint.getSystem().getSystemName());
Modified: camel/trunk/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400RouteTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400RouteTest.java?rev=785611&r1=785610&r2=785611&view=diff
==============================================================================
--- camel/trunk/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400RouteTest.java (original)
+++ camel/trunk/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400RouteTest.java Wed Jun 17 14:08:33 2009
@@ -16,9 +16,10 @@
*/
package org.apache.camel.component.jt400;
-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;
/**
* Test case for routes that contain <code>jt400:</code> endpoints This test
@@ -27,7 +28,7 @@
* {@link #USER}, {@link #PASSWORD}, {@link #SYSTEM}, {@link #LIBRARY} and
* {@link #QUEUE}
*/
-public class Jt400RouteTest extends ContextTestSupport {
+public class Jt400RouteTest extends CamelTestSupport {
// fill in correct values for all constants to test with a real AS/400
// system
@@ -37,6 +38,7 @@
private static final String LIBRARY = "library";
private static final String QUEUE = "queue";
+ @Test
public void testBasicTest() throws Exception {
if (SYSTEM != null) {
MockEndpoint endpoint = getMockEndpoint("mock:a");