Author: sgoeschl
Date: Tue Jan 26 14:41:07 2010
New Revision: 903242

URL: http://svn.apache.org/viewvc?rev=903242&view=rev
Log:
Removing the "Startable" interface since this should be handled by the service 
container

Modified:
    
turbine/fulcrum/trunk/hsqldb/src/java/org/apache/fulcrum/hsqldb/HSQLService.java
    
turbine/fulcrum/trunk/hsqldb/src/test/org/apache/fulcrum/hsqldb/HSQLServiceTest.java
    turbine/fulcrum/trunk/hsqldb/src/test/test.properties

Modified: 
turbine/fulcrum/trunk/hsqldb/src/java/org/apache/fulcrum/hsqldb/HSQLService.java
URL: 
http://svn.apache.org/viewvc/turbine/fulcrum/trunk/hsqldb/src/java/org/apache/fulcrum/hsqldb/HSQLService.java?rev=903242&r1=903241&r2=903242&view=diff
==============================================================================
--- 
turbine/fulcrum/trunk/hsqldb/src/java/org/apache/fulcrum/hsqldb/HSQLService.java
 (original)
+++ 
turbine/fulcrum/trunk/hsqldb/src/java/org/apache/fulcrum/hsqldb/HSQLService.java
 Tue Jan 26 14:41:07 2010
@@ -1,7 +1,5 @@
 package org.apache.fulcrum.hsqldb;
 
-import org.apache.avalon.framework.activity.Startable;
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -21,6 +19,8 @@
  * under the License.
  */
 
+import org.apache.avalon.framework.activity.Startable;
+
 /**
  * A definition for a HSQLService component which configures a single hsqldb
  * database.
@@ -28,31 +28,6 @@
  * @author <a href="mailto:[email protected]";>Peter Tillemans</a>
  * @author <a href="mailto:[email protected]";>Siegfried Goeschl</a>
  */
-public interface HSQLService extends Startable
+public interface HSQLService
 {
-    /**
-     * Starts the HSQLDB server. The implementation polls to ensure
-     * that the HSQLDB server is fully initialized otherwise we get
-     * spurious connection exceptions. If the HSQLDB server is not
-     * upand running within 10 seconds we throw an exception.
-     *
-     * @see org.apache.avalon.framework.activity.Startable#start()
-     */
-    public void start() throws Exception;
-
-    /**
-     * Stop the HSQLDB server. The implementation polls to ensure
-     * that the HSQLDB server has terminated otherwise someone
-     * could call System.exit() and break the database.
-     *
-     * @see org.apache.avalon.framework.activity.Startable#stop()
-     */
-    public void stop() throws Exception;
-
-    /**
-     * Check if the database server is running.
-     *
-     * @return the state of the hsqldb server
-     */
-    public boolean isRunning();
 }

Modified: 
turbine/fulcrum/trunk/hsqldb/src/test/org/apache/fulcrum/hsqldb/HSQLServiceTest.java
URL: 
http://svn.apache.org/viewvc/turbine/fulcrum/trunk/hsqldb/src/test/org/apache/fulcrum/hsqldb/HSQLServiceTest.java?rev=903242&r1=903241&r2=903242&view=diff
==============================================================================
--- 
turbine/fulcrum/trunk/hsqldb/src/test/org/apache/fulcrum/hsqldb/HSQLServiceTest.java
 (original)
+++ 
turbine/fulcrum/trunk/hsqldb/src/test/org/apache/fulcrum/hsqldb/HSQLServiceTest.java
 Tue Jan 26 14:41:07 2010
@@ -91,6 +91,7 @@
             while( rs.next() )
             {
                 String loginName = rs.getString("LOGIN_NAME");
+                System.out.println(loginName);
                 assertTrue( loginName.length() > 0 );
             }
         }
@@ -108,18 +109,23 @@
         }
     }
 
-    public void testIsRunning() throws Exception {
-
-        assertTrue("Server was not started", service.isRunning());
-        service.stop();
-        assertFalse("Server is still running", service.isRunning());
+    public void testIsRunning() throws Exception
+    {
+        assertTrue("Server was not started", ((HSQLServiceImpl) 
service).isRunning());
+        ((HSQLServiceImpl) service).stop();
+        assertFalse("Server is still running", ((HSQLServiceImpl) 
service).isRunning());
     }
 
-    public void testShutdown() throws Exception {
-
+    /**
+     * Terminate the embedded HSQLDB server using the "SHUTDOWN" command.
+     *
+     * @throws Exception the test failed
+     */
+    public void testShutdown() throws Exception
+    {
         Connection conn = this.getConnection("test");
         Statement stmt = conn.createStatement();
         stmt.execute("SHUTDOWN;");
-        assertFalse("Server is still running", service.isRunning());
+        assertFalse("Server is still running", ((HSQLServiceImpl) 
service).isRunning());
     }
 }

Modified: turbine/fulcrum/trunk/hsqldb/src/test/test.properties
URL: 
http://svn.apache.org/viewvc/turbine/fulcrum/trunk/hsqldb/src/test/test.properties?rev=903242&r1=903241&r2=903242&view=diff
==============================================================================
--- turbine/fulcrum/trunk/hsqldb/src/test/test.properties (original)
+++ turbine/fulcrum/trunk/hsqldb/src/test/test.properties Tue Jan 26 14:41:07 
2010
@@ -1,5 +1,5 @@
 #HSQL Database Engine 1.8.0.10
-#Tue Dec 01 23:35:58 CET 2009
+#Tue Jan 26 15:12:35 CET 2010
 hsqldb.script_format=0
 runtime.gc_interval=0
 sql.enforce_strict_size=false


Reply via email to