You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2011/12/05 11:03:48 UTC
svn commit: r1210391 -
/camel/trunk/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcOptionsTest.java
Author: davsclaus
Date: Mon Dec 5 10:03:48 2011
New Revision: 1210391
URL: http://svn.apache.org/viewvc?rev=1210391&view=rev
Log:
Fixed test in camel-jdbc
Modified:
camel/trunk/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcOptionsTest.java
Modified: camel/trunk/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcOptionsTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcOptionsTest.java?rev=1210391&r1=1210390&r2=1210391&view=diff
==============================================================================
--- camel/trunk/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcOptionsTest.java (original)
+++ camel/trunk/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcOptionsTest.java Mon Dec 5 10:03:48 2011
@@ -83,32 +83,6 @@ public class JdbcOptionsTest extends Cam
assertEquals(4, list.size());
}
- @SuppressWarnings("rawtypes")
- @Test
- public void testInsertRollback() throws Exception {
- // insert 2 records
- try {
- template.sendBody("direct:startTx", "insert into customer values ('cust3', 'johnsmith');insert into customer values ('cust3', 'hkesler')");
- fail("Should have thrown a CamelExecutionException");
- } catch (CamelExecutionException e) {
- if (!e.getCause().getMessage().contains("Violation of unique constraint")) {
- fail("Test did not throw the expected Constraint Violation Exception");
- }
- }
-
- // check to see that they failed by getting a rec count from table
- MockEndpoint mockTest = getMockEndpoint("mock:retrieve");
- mockTest.expectedMessageCount(1);
-
- template.sendBody("direct:retrieve", "select * from customer");
-
- mockTest.assertIsSatisfied();
-
- List list = mockTest.getExchanges().get(0).getIn().getBody(ArrayList.class);
- // all recs failed to insert
- assertEquals(2, list.size());
- }
-
@Test
public void testNoDataSourceInRegistry() throws Exception {
try {
@@ -151,12 +125,8 @@ public class JdbcOptionsTest extends Cam
@Before
public void setUp() throws Exception {
- Properties connectionProperties = new Properties();
- connectionProperties.put("autoCommit", Boolean.TRUE);
-
DriverManagerDataSource dataSource = new SingleConnectionDataSource(url, user, password, true);
dataSource.setDriverClassName(driverClass);
- dataSource.setConnectionProperties(connectionProperties);
ds = dataSource;
JdbcTemplate jdbc = new JdbcTemplate(ds);