[jboss-svn-commits] JBL Code SVN: r5514 - labs/jbossesb/branches/refactor/product/core/common/tests/src/org/jboss/soa/esb/connection
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Sun Aug 6 11:46:06 EDT 2006
Author: arvinder
Date: 2006-08-06 11:46:01 -0400 (Sun, 06 Aug 2006)
New Revision: 5514
Added:
labs/jbossesb/branches/refactor/product/core/common/tests/src/org/jboss/soa/esb/connection/AbandonedConnectionFuncTest.java
labs/jbossesb/branches/refactor/product/core/common/tests/src/org/jboss/soa/esb/connection/ConnectionPoolFuncTest.java
labs/jbossesb/branches/refactor/product/core/common/tests/src/org/jboss/soa/esb/connection/PasswordDecoderFuncTest.java
labs/jbossesb/branches/refactor/product/core/common/tests/src/org/jboss/soa/esb/connection/PasswordDecoderTestImpl.java
Removed:
labs/jbossesb/branches/refactor/product/core/common/tests/src/org/jboss/soa/esb/connection/HashPasswordDecoder.java
labs/jbossesb/branches/refactor/product/core/common/tests/src/org/jboss/soa/esb/connection/TestConnectionPool.java
labs/jbossesb/branches/refactor/product/core/common/tests/src/org/jboss/soa/esb/connection/TestPasswordDecoder.java
Log:
merge connection package from trunk
Copied: labs/jbossesb/branches/refactor/product/core/common/tests/src/org/jboss/soa/esb/connection/AbandonedConnectionFuncTest.java (from rev 5513, labs/jbossesb/trunk/product/core/common/tests/src/org/jboss/soa/esb/connection/AbandonedConnectionFuncTest.java)
Copied: labs/jbossesb/branches/refactor/product/core/common/tests/src/org/jboss/soa/esb/connection/ConnectionPoolFuncTest.java (from rev 5513, labs/jbossesb/trunk/product/core/common/tests/src/org/jboss/soa/esb/connection/ConnectionPoolFuncTest.java)
Deleted: labs/jbossesb/branches/refactor/product/core/common/tests/src/org/jboss/soa/esb/connection/HashPasswordDecoder.java
===================================================================
--- labs/jbossesb/branches/refactor/product/core/common/tests/src/org/jboss/soa/esb/connection/HashPasswordDecoder.java 2006-08-06 15:35:34 UTC (rev 5513)
+++ labs/jbossesb/branches/refactor/product/core/common/tests/src/org/jboss/soa/esb/connection/HashPasswordDecoder.java 2006-08-06 15:46:01 UTC (rev 5514)
@@ -1,36 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.soa.esb.connection;
-
-import org.jboss.soa.esb.connection.PasswordDecoder;
-
-/**
- * TODO
- * User: MohitK
- * Date: Aug 1, 2006
- */
-public class HashPasswordDecoder implements PasswordDecoder {
-
- public String decode(String encodedPassword) {
- return "password";
- }
-}
Copied: labs/jbossesb/branches/refactor/product/core/common/tests/src/org/jboss/soa/esb/connection/PasswordDecoderFuncTest.java (from rev 5513, labs/jbossesb/trunk/product/core/common/tests/src/org/jboss/soa/esb/connection/PasswordDecoderFuncTest.java)
Copied: labs/jbossesb/branches/refactor/product/core/common/tests/src/org/jboss/soa/esb/connection/PasswordDecoderTestImpl.java (from rev 5513, labs/jbossesb/trunk/product/core/common/tests/src/org/jboss/soa/esb/connection/PasswordDecoderTestImpl.java)
Deleted: labs/jbossesb/branches/refactor/product/core/common/tests/src/org/jboss/soa/esb/connection/TestConnectionPool.java
===================================================================
--- labs/jbossesb/branches/refactor/product/core/common/tests/src/org/jboss/soa/esb/connection/TestConnectionPool.java 2006-08-06 15:35:34 UTC (rev 5513)
+++ labs/jbossesb/branches/refactor/product/core/common/tests/src/org/jboss/soa/esb/connection/TestConnectionPool.java 2006-08-06 15:46:01 UTC (rev 5514)
@@ -1,104 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.soa.esb.connection;
-
-import junit.framework.TestCase;
-import org.jboss.soa.esb.connection.ConnectionProperties;
-import org.jboss.soa.esb.connection.PoolDataSource;
-
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.Properties;
-
-/**
- * TODO
- * User: MohitK
- * Date: Jul 22, 2006
- */
-public class TestConnectionPool extends TestCase {
-
- Properties properties = new Properties();
-
- protected void setUp() throws Exception {
- properties.put(ConnectionProperties.DRIVER_CLASSNAME, "oracle.jdbc.driver.OracleDriver");
- properties.put(ConnectionProperties.CONNECTION_URL, "jdbc:oracle:thin:@localhost:1521:EMS");
- properties.put(ConnectionProperties.USERNAME, "CLEARSTORY");
- properties.put(ConnectionProperties.PASSWORD, "password");
- properties.put(ConnectionProperties.ABANDONED_CONNECTION_CHECK_INTERVAL, "30000");
- }
-
-
- public void testConnectionPool() {
- PoolDataSource ds = new PoolDataSource();
- ds.setConnectionProperties(properties);
- Connection con1 = null;
- Connection con2 = null;
- Connection con3 = null;
- Connection con4 = null;
- Connection con5 = null;
- Connection con6 = null;
- Connection con7 = null;
- Connection con8 = null;
- Connection con9 = null;
- Connection con10 = null;
- Statement stat = null;
- try {
- con1 = ds.getConnection();
- con2 = ds.getConnection();
- stat = con1.createStatement();
- ResultSet rs = stat.executeQuery("select count(*) from WM_SERVER");
- while (rs.next()) {
- int count = rs.getInt(1);
- System.out.println("count = " + count);
- }
- try {
- if (stat != null) {
- stat.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- con3 = ds.getConnection();
- con4 = ds.getConnection();
- con5 = ds.getConnection();
- con6 = ds.getConnection();
- con7 = ds.getConnection();
- con8 = ds.getConnection();
- con9 = ds.getConnection();
- try {
- Thread.sleep(35000);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- stat = con3.createStatement();
- stat.executeQuery("select count(*) from WM_SERVER");
- } catch (SQLException e) {
- e.printStackTrace();
- fail();
- }
- }
-
-
-
-}
Deleted: labs/jbossesb/branches/refactor/product/core/common/tests/src/org/jboss/soa/esb/connection/TestPasswordDecoder.java
===================================================================
--- labs/jbossesb/branches/refactor/product/core/common/tests/src/org/jboss/soa/esb/connection/TestPasswordDecoder.java 2006-08-06 15:35:34 UTC (rev 5513)
+++ labs/jbossesb/branches/refactor/product/core/common/tests/src/org/jboss/soa/esb/connection/TestPasswordDecoder.java 2006-08-06 15:46:01 UTC (rev 5514)
@@ -1,90 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.soa.esb.connection;
-
-import junit.framework.TestCase;
-import org.jboss.soa.esb.connection.ConnectionProperties;
-import org.jboss.soa.esb.connection.PoolDataSource;
-import org.jboss.soa.esb.connection.HashPasswordDecoder;
-
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.Properties;
-
-/**
- * TODO
- * User: MohitK
- * Date: Aug 1, 2006
- */
-public class TestPasswordDecoder extends TestCase {
-
- Properties properties = new Properties();
-
- protected void setUp() throws Exception {
- properties.put(ConnectionProperties.DRIVER_CLASSNAME, "oracle.jdbc.driver.OracleDriver");
- properties.put(ConnectionProperties.CONNECTION_URL, "jdbc:oracle:thin:@localhost:1521:EMS");
- properties.put(ConnectionProperties.USERNAME, "CLEARSTORY");
- properties.put(ConnectionProperties.PASSWORD, "password");
- properties.setProperty(ConnectionProperties.PASSWORD_DECODER, HashPasswordDecoder.class.getName());
- }
-
- public void testPasswordDecoder() {
-
- PoolDataSource ds = new PoolDataSource();
- ds.setConnectionProperties(properties);
- Connection con1 = null;
- Statement stat = null;
- try {
- con1 = ds.getConnection();
- stat = con1.createStatement();
- ResultSet rs = stat.executeQuery("select count(*) from WM_SERVER");
- while (rs.next()) {
- int count = rs.getInt(1);
- System.out.println("count = " + count);
- }
-
-
- } catch (SQLException e) {
- e.printStackTrace();
- fail();
- } finally {
- if (stat != null) {
- try {
- stat.close();
- } catch (SQLException e) {
- e.printStackTrace();
- fail();
- }
- }
- if (con1 != null) {
- try {
- con1.close();
- } catch (SQLException e) {
- e.printStackTrace();
- fail();
- }
- }
- }
- }
-}
More information about the jboss-svn-commits
mailing list