incubator-graffito-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clomb...@apache.org
Subject svn commit: r365474 - /incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/persistence/impl/DatasourceEnabledSpringTestCase.java
Date Mon, 02 Jan 2006 23:44:11 GMT
Author: clombart
Date: Mon Jan  2 15:44:08 2006
New Revision: 365474

URL: http://svn.apache.org/viewcvs?rev=365474&view=rev
Log:
test the user & password value

Modified:
    incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/persistence/impl/DatasourceEnabledSpringTestCase.java

Modified: incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/persistence/impl/DatasourceEnabledSpringTestCase.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/persistence/impl/DatasourceEnabledSpringTestCase.java?rev=365474&r1=365473&r2=365474&view=diff
==============================================================================
--- incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/persistence/impl/DatasourceEnabledSpringTestCase.java
(original)
+++ incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/persistence/impl/DatasourceEnabledSpringTestCase.java
Mon Jan  2 15:44:08 2006
@@ -41,26 +41,47 @@
      * @see junit.framework.TestCase#setUp()
      */
     protected void setUp() throws Exception
-    {                
-        jndi = new TyrexJNDIComponent();
-        String url = System.getProperty("org.apache.portals.graffito.database.url");
-        String driver = System.getProperty("org.apache.portals.graffito.database.driver");
-        String user = System.getProperty("org.apache.portals.graffito.database.user");
-        String password = System.getProperty("org.apache.portals.graffito.database.password");
-        if (password == null)
-        {
-        	password = "";
-        }
-        datasourceComponent = new BoundDBCPDatasourceComponent(user, password, driver, url,
20, 5000,
-                GenericObjectPool.WHEN_EXHAUSTED_GROW, true, "graffitotest", jndi);
-        datasourceComponent.start();
-        super.setUp();
-            
+    {    
+    	try
+		{    		
+			jndi = new TyrexJNDIComponent();
+			String url = System.getProperty("org.apache.portals.graffito.database.url");
+			
+			
+			String driver = System.getProperty("org.apache.portals.graffito.database.driver");
+			
+			
+			String user = System.getProperty("org.apache.portals.graffito.database.user");
+			if (user == null)
+			{	
+			
+        		user = "";
+			}			
+
+			String password = System.getProperty("org.apache.portals.graffito.database.password");
+			if (password == null)
+			{				
+			
+  			    password = "";
+			}
+			
+			datasourceComponent = new BoundDBCPDatasourceComponent(user,
+					password, driver, url, 20, 5000,
+					GenericObjectPool.WHEN_EXHAUSTED_GROW, true,
+					"graffitotest", jndi);
+			datasourceComponent.start();
+			super.setUp();
+		}
+		catch (Exception e)
+		{
+			System.out.println("exception :" + e);
+			e.printStackTrace();
+		}            
     }
 
     /**
-     * @see junit.framework.TestCase#tearDown()
-     */
+	 * @see junit.framework.TestCase#tearDown()
+	 */
     protected void tearDown() throws Exception
     {
         jndi.unbindFromCurrentThread();



Mime
View raw message