camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r802309 - in /camel/branches/camel-1.x: ./ examples/camel-example-loan-broker/ examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/queue/version/ examples/camel-example-loan-broker/src/test/ examples/camel-example-l...
Date Sat, 08 Aug 2009 07:25:35 GMT
Author: ningjiang
Date: Sat Aug  8 07:25:34 2009
New Revision: 802309

URL: http://svn.apache.org/viewvc?rev=802309&view=rev
Log:
Merged revisions 802307 via svnmerge from 
https://svn.apache.org/repos/asf/camel/trunk

........
  r802307 | ningjiang | 2009-08-08 15:01:19 +0800 (Sat, 08 Aug 2009) | 1 line
  
  CAMEL-1890 Added unit test for camel-example-loan-broker
........

Added:
    camel/branches/camel-1.x/examples/camel-example-loan-broker/src/test/
      - copied from r802307, camel/trunk/examples/camel-example-loan-broker/src/test/
    camel/branches/camel-1.x/examples/camel-example-loan-broker/src/test/java/
      - copied from r802307, camel/trunk/examples/camel-example-loan-broker/src/test/java/
    camel/branches/camel-1.x/examples/camel-example-loan-broker/src/test/java/org/
      - copied from r802307, camel/trunk/examples/camel-example-loan-broker/src/test/java/org/
    camel/branches/camel-1.x/examples/camel-example-loan-broker/src/test/java/org/apache/
      - copied from r802307, camel/trunk/examples/camel-example-loan-broker/src/test/java/org/apache/
    camel/branches/camel-1.x/examples/camel-example-loan-broker/src/test/java/org/apache/camel/
      - copied from r802307, camel/trunk/examples/camel-example-loan-broker/src/test/java/org/apache/camel/
    camel/branches/camel-1.x/examples/camel-example-loan-broker/src/test/java/org/apache/camel/loanbroker/
      - copied from r802307, camel/trunk/examples/camel-example-loan-broker/src/test/java/org/apache/camel/loanbroker/
    camel/branches/camel-1.x/examples/camel-example-loan-broker/src/test/java/org/apache/camel/loanbroker/queue/
      - copied from r802307, camel/trunk/examples/camel-example-loan-broker/src/test/java/org/apache/camel/loanbroker/queue/
    camel/branches/camel-1.x/examples/camel-example-loan-broker/src/test/java/org/apache/camel/loanbroker/queue/version/
      - copied from r802307, camel/trunk/examples/camel-example-loan-broker/src/test/java/org/apache/camel/loanbroker/queue/version/
    camel/branches/camel-1.x/examples/camel-example-loan-broker/src/test/java/org/apache/camel/loanbroker/queue/version/LoanBrokerTest.java
      - copied, changed from r802307, camel/trunk/examples/camel-example-loan-broker/src/test/java/org/apache/camel/loanbroker/queue/version/LoanBrokerTest.java
    camel/branches/camel-1.x/examples/camel-example-loan-broker/src/test/java/org/apache/camel/loanbroker/webservice/
      - copied from r802307, camel/trunk/examples/camel-example-loan-broker/src/test/java/org/apache/camel/loanbroker/webservice/
    camel/branches/camel-1.x/examples/camel-example-loan-broker/src/test/java/org/apache/camel/loanbroker/webservice/version/
      - copied from r802307, camel/trunk/examples/camel-example-loan-broker/src/test/java/org/apache/camel/loanbroker/webservice/version/
    camel/branches/camel-1.x/examples/camel-example-loan-broker/src/test/java/org/apache/camel/loanbroker/webservice/version/LoadBrokerTest.java
      - copied, changed from r802307, camel/trunk/examples/camel-example-loan-broker/src/test/java/org/apache/camel/loanbroker/webservice/version/LoadBrokerTest.java
    camel/branches/camel-1.x/examples/camel-example-loan-broker/src/test/resources/
      - copied from r802307, camel/trunk/examples/camel-example-loan-broker/src/test/resources/
    camel/branches/camel-1.x/examples/camel-example-loan-broker/src/test/resources/log4j.properties
      - copied unchanged from r802307, camel/trunk/examples/camel-example-loan-broker/src/test/resources/log4j.properties
    camel/branches/camel-1.x/examples/camel-example-loan-broker/src/test/resources/logging.properties
      - copied unchanged from r802307, camel/trunk/examples/camel-example-loan-broker/src/test/resources/logging.properties
Modified:
    camel/branches/camel-1.x/   (props changed)
    camel/branches/camel-1.x/examples/camel-example-loan-broker/pom.xml
    camel/branches/camel-1.x/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/queue/version/Bank.java
    camel/branches/camel-1.x/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/queue/version/CreditAgency.java

Propchange: camel/branches/camel-1.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Aug  8 07:25:34 2009
@@ -1 +1 @@
-/camel/trunk:736980,739733,739904,740251,740295,740306,740596,740663,741848,742231,742705,742739,742854,742856,742898,742906,743613,743762,743773,743920,743959-743960,744123,745105,745367,745541,745751,745826,745978,746269,746872,746895,746962,747258,747678-747704,748392,748436,748821,749563-749564,749574,749628-749629,749936,749956,750017,750334,750396,750761,750796,752068,752117,752418,752751-752755,752764-752773,752956,753087,753101,753175,755136,755487,756313,756348,756870,756939,757636,757693,757743,757865,758539,758563,758600,758617,758692,758990,759362,759453,759887,759931,760003,760890,760909,760937,761194,761536,761583,761607,762047,762633,762650,762935,763095,763484,763551,765154,765686,765729,765743,765824,766016,766289,766584,766588,766590,766602,766673,767403,767824,768342,769239,769346,769368,769434,770172,770906,771303,773193,773446,773781,774192,774383,774658-774659,776198,776289,776504,776975,778102,778689-778701,779121,779143,779489,781314-781349,781775,781
 923,781974,781993,782557,782594,782681,782886,782918-782923,783204,783248,783363,783639,783704,785564,785584,785599,787206,787581,787598,787605,787928,788393,789121,789703,790560,790936,791379,791476,791767,792038,792381,792398,792899,793359,793518,793547-793555,793862,793935,794237,794368,794550,794967,795790,798027,798052,798063,798489,798864,799252,800340,800785,800797,801960
+/camel/trunk:736980,739733,739904,740251,740295,740306,740596,740663,741848,742231,742705,742739,742854,742856,742898,742906,743613,743762,743773,743920,743959-743960,744123,745105,745367,745541,745751,745826,745978,746269,746872,746895,746962,747258,747678-747704,748392,748436,748821,749563-749564,749574,749628-749629,749936,749956,750017,750334,750396,750761,750796,752068,752117,752418,752751-752755,752764-752773,752956,753087,753101,753175,755136,755487,756313,756348,756870,756939,757636,757693,757743,757865,758539,758563,758600,758617,758692,758990,759362,759453,759887,759931,760003,760890,760909,760937,761194,761536,761583,761607,762047,762633,762650,762935,763095,763484,763551,765154,765686,765729,765743,765824,766016,766289,766584,766588,766590,766602,766673,767403,767824,768342,769239,769346,769368,769434,770172,770906,771303,773193,773446,773781,774192,774383,774658-774659,776198,776289,776504,776975,778102,778689-778701,779121,779143,779489,781314-781349,781775,781
 923,781974,781993,782557,782594,782681,782886,782918-782923,783204,783248,783363,783639,783704,785564,785584,785599,787206,787581,787598,787605,787928,788393,789121,789703,790560,790936,791379,791476,791767,792038,792381,792398,792899,793359,793518,793547-793555,793862,793935,794237,794368,794550,794967,795790,798027,798052,798063,798489,798864,799252,800340,800785,800797,801960,802307

Propchange: camel/branches/camel-1.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-1.x/examples/camel-example-loan-broker/pom.xml
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/examples/camel-example-loan-broker/pom.xml?rev=802309&r1=802308&r2=802309&view=diff
==============================================================================
--- camel/branches/camel-1.x/examples/camel-example-loan-broker/pom.xml (original)
+++ camel/branches/camel-1.x/examples/camel-example-loan-broker/pom.xml Sat Aug  8 07:25:34
2009
@@ -55,6 +55,12 @@
       <groupId>log4j</groupId>
       <artifactId>log4j</artifactId>
     </dependency>
+    <!-- testing -->
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
   <build>
@@ -67,6 +73,23 @@
           <target>1.5</target>
         </configuration>
       </plugin>
+      <plugin>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <forkMode>pertest</forkMode>
+          <childDelegation>false</childDelegation>
+          <useFile>true</useFile>
+          <includes>
+            <include>**/*Test.*</include>
+          </includes>
+          <systemProperties>
+               <property>
+                    <name>java.util.logging.config.file</name>
+                    <value>${basedir}/target/test-classes/logging.properties</value>
+               </property>
+          </systemProperties>
+        </configuration>
+      </plugin>
       <!-- Allows the example to be run via 'mvn compile exec:java' -->
       <plugin>
         <groupId>org.codehaus.mojo</groupId>

Modified: camel/branches/camel-1.x/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/queue/version/Bank.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/queue/version/Bank.java?rev=802309&r1=802308&r2=802309&view=diff
==============================================================================
--- camel/branches/camel-1.x/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/queue/version/Bank.java
(original)
+++ camel/branches/camel-1.x/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/queue/version/Bank.java
Sat Aug  8 07:25:34 2009
@@ -41,6 +41,7 @@
         exchange.getOut().setHeader(Constants.PROPERTY_RATE, new Double(rate));
         exchange.getOut().setHeader(Constants.PROPERTY_BANK, bankName);
         exchange.getOut().setHeader(Constants.PROPERTY_SSN, ssn);
+        exchange.getOut().setBody("Bank processed the request.");
         // Sleep some time
         try {
             Thread.sleep((int) (Math.random() * 10) * 100);

Modified: camel/branches/camel-1.x/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/queue/version/CreditAgency.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/queue/version/CreditAgency.java?rev=802309&r1=802308&r2=802309&view=diff
==============================================================================
--- camel/branches/camel-1.x/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/queue/version/CreditAgency.java
(original)
+++ camel/branches/camel-1.x/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/queue/version/CreditAgency.java
Sat Aug  8 07:25:34 2009
@@ -33,6 +33,7 @@
         exchange.getOut().setHeader(Constants.PROPERTY_SCORE, new Integer(score));
         exchange.getOut().setHeader(Constants.PROPERTY_HISTORYLENGTH, new Integer(hlength));
         exchange.getOut().setHeader(Constants.PROPERTY_SSN, ssn);
+        exchange.getOut().setBody("CreditAgency processed the request.");
     }
 
 }

Copied: camel/branches/camel-1.x/examples/camel-example-loan-broker/src/test/java/org/apache/camel/loanbroker/queue/version/LoanBrokerTest.java
(from r802307, camel/trunk/examples/camel-example-loan-broker/src/test/java/org/apache/camel/loanbroker/queue/version/LoanBrokerTest.java)
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/examples/camel-example-loan-broker/src/test/java/org/apache/camel/loanbroker/queue/version/LoanBrokerTest.java?p2=camel/branches/camel-1.x/examples/camel-example-loan-broker/src/test/java/org/apache/camel/loanbroker/queue/version/LoanBrokerTest.java&p1=camel/trunk/examples/camel-example-loan-broker/src/test/java/org/apache/camel/loanbroker/queue/version/LoanBrokerTest.java&r1=802307&r2=802309&rev=802309&view=diff
==============================================================================
--- camel/trunk/examples/camel-example-loan-broker/src/test/java/org/apache/camel/loanbroker/queue/version/LoanBrokerTest.java
(original)
+++ camel/branches/camel-1.x/examples/camel-example-loan-broker/src/test/java/org/apache/camel/loanbroker/queue/version/LoanBrokerTest.java
Sat Aug  8 07:25:34 2009
@@ -20,6 +20,8 @@
 
 import javax.jms.ConnectionFactory;
 
+import junit.framework.TestCase;
+
 import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.camel.CamelContext;
 import org.apache.camel.Exchange;
@@ -31,18 +33,12 @@
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.impl.DefaultCamelContext;
 
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-public class LoanBrokerTest extends Assert {
+public class LoanBrokerTest extends TestCase {
     CamelContext camelContext;
     JmsBroker broker;
     ProducerTemplate template;
- 
-    @Before
-    public void startServices() throws Exception {
+    
+    public void setUp() throws Exception {
         camelContext = new DefaultCamelContext();
         broker = new JmsBroker("vm://localhost");
         broker.start();
@@ -64,9 +60,8 @@
         template = camelContext.createProducerTemplate();
         camelContext.start();
     }
-    
-    @After
-    public void stopServices() throws Exception {
+   
+    public void tearDown() throws Exception {
         
         if (camelContext != null) {
             camelContext.stop();
@@ -79,7 +74,7 @@
         
     }
     
-    @Test
+    
     public void testClientInvocation() throws Exception {
         MockEndpoint endpoint = (MockEndpoint) camelContext.getEndpoint("mock:endpoint");
         endpoint.expectedMessageCount(2);

Copied: camel/branches/camel-1.x/examples/camel-example-loan-broker/src/test/java/org/apache/camel/loanbroker/webservice/version/LoadBrokerTest.java
(from r802307, camel/trunk/examples/camel-example-loan-broker/src/test/java/org/apache/camel/loanbroker/webservice/version/LoadBrokerTest.java)
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/examples/camel-example-loan-broker/src/test/java/org/apache/camel/loanbroker/webservice/version/LoadBrokerTest.java?p2=camel/branches/camel-1.x/examples/camel-example-loan-broker/src/test/java/org/apache/camel/loanbroker/webservice/version/LoadBrokerTest.java&p1=camel/trunk/examples/camel-example-loan-broker/src/test/java/org/apache/camel/loanbroker/webservice/version/LoadBrokerTest.java&r1=802307&r2=802309&rev=802309&view=diff
==============================================================================
--- camel/trunk/examples/camel-example-loan-broker/src/test/java/org/apache/camel/loanbroker/webservice/version/LoadBrokerTest.java
(original)
+++ camel/branches/camel-1.x/examples/camel-example-loan-broker/src/test/java/org/apache/camel/loanbroker/webservice/version/LoadBrokerTest.java
Sat Aug  8 07:25:34 2009
@@ -16,22 +16,19 @@
  */
 package org.apache.camel.loanbroker.webservice.version;
 
+import junit.framework.TestCase;
 import org.apache.camel.CamelContext;
 import org.apache.camel.impl.DefaultCamelContext;
 import org.apache.camel.loanbroker.webservice.version.bank.BankServer;
 import org.apache.camel.loanbroker.webservice.version.credit.CreditAgencyServer;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
 
-public class LoadBrokerTest extends Assert {
+
+public class LoadBrokerTest extends TestCase {
     CamelContext camelContext;
     CreditAgencyServer creditAgencyServer;
     BankServer bankServer;
     
-    @Before
-    public void startServices() throws Exception {
+    public void setUp() throws Exception {
         camelContext = new DefaultCamelContext();
         creditAgencyServer = new CreditAgencyServer();
         // Start the credit server
@@ -46,8 +43,7 @@
         camelContext.start();
     }
     
-    @After
-    public void stopServices() throws Exception {
+    public void tearDown() throws Exception {
         if (camelContext != null) {
             camelContext.stop();
         }
@@ -59,7 +55,6 @@
         }
     }
     
-    @Test
     public void testInvocation() {
         Client client = new Client();
         String result = null;



Mime
View raw message