roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r909967 - in /roller/trunk: planet-business/ planet-business/src/test/resources/ roller-core/src/main/java/org/apache/roller/util/ roller-core/src/test/java/org/apache/roller/util/ test-utils/ test-utils/src/main/java/org/apache/roller/webl...
Date Sun, 14 Feb 2010 04:01:12 GMT
Author: snoopdave
Date: Sun Feb 14 04:01:11 2010
New Revision: 909967

URL: http://svn.apache.org/viewvc?rev=909967&view=rev
Log:
Fixes to Derby startup and shutdown process in build/test process and also in the jetty:run-war setup. Also, returned database scripts to WEB-INF/classes/dbscripts as we did before in 4.0

Added:
    roller/trunk/roller-core/src/main/java/org/apache/roller/util/SQLScriptRunner.java
      - copied, changed from r895620, roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/startup/SQLScriptRunner.java
Removed:
    roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/startup/SQLScriptRunner.java
    roller/trunk/weblogger-web/src/test/resources/realm.properties
Modified:
    roller/trunk/planet-business/pom.xml
    roller/trunk/planet-business/src/test/resources/planet-custom.properties
    roller/trunk/roller-core/src/test/java/org/apache/roller/util/RegexUtilTest.java
    roller/trunk/test-utils/pom.xml
    roller/trunk/test-utils/src/main/java/org/apache/roller/weblogger/ant/StartDerbyTask.java
    roller/trunk/test-utils/src/main/java/org/apache/roller/weblogger/ant/StopDerbyTask.java
    roller/trunk/test-utils/src/main/java/org/apache/roller/weblogger/jetty/DerbyLifeCycle.java
    roller/trunk/weblogger-business/pom.xml
    roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/startup/ClasspathDatabaseScriptProvider.java
    roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/startup/DatabaseInstaller.java
    roller/trunk/weblogger-business/src/main/resources/sql/droptables.sql
    roller/trunk/weblogger-business/src/test/java/org/apache/roller/weblogger/business/SQLScriptRunnerTest.java
    roller/trunk/weblogger-business/src/test/resources/planet-custom.properties
    roller/trunk/weblogger-business/src/test/resources/roller-custom.properties
    roller/trunk/weblogger-web/pom.xml
    roller/trunk/weblogger-web/src/test/resources/jetty.xml
    roller/trunk/weblogger-web/src/test/resources/planet-custom.properties
    roller/trunk/weblogger-web/src/test/resources/roller-custom.properties

Modified: roller/trunk/planet-business/pom.xml
URL: http://svn.apache.org/viewvc/roller/trunk/planet-business/pom.xml?rev=909967&r1=909966&r2=909967&view=diff
==============================================================================
--- roller/trunk/planet-business/pom.xml (original)
+++ roller/trunk/planet-business/pom.xml Sun Feb 14 04:01:11 2010
@@ -1,25 +1,25 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0"
-     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
     <modelVersion>4.0.0</modelVersion>
-    
+
     <parent>
         <groupId>org.apache.roller</groupId>
         <artifactId>roller-project</artifactId>
         <version>5.0-BETA2-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
-    
+
     <name>Apache Roller Planet Business Module</name>
     <description>
-       Business logic and persistence for Roller Planet RSS/Atom aggregator, 
-       also used in Roller Weblogger.
+        Business logic and persistence for Roller Planet RSS/Atom aggregator,
+        also used in Roller Weblogger.
     </description>
-    <groupId>org.apache.roller</groupId> 
-    <artifactId>roller-planet-business</artifactId> 
+    <groupId>org.apache.roller</groupId>
+    <artifactId>roller-planet-business</artifactId>
     <version>5.0-BETA2-SNAPSHOT</version>
-    
+
     <dependencies>
 
         <dependency>
@@ -92,7 +92,7 @@
         <dependency>
             <groupId>org.apache.texen</groupId>
             <artifactId>texen</artifactId>
-         </dependency>
+        </dependency>
 
         <!-- test deps -->
 
@@ -125,19 +125,35 @@
             <artifactId>derbyclient</artifactId>
             <scope>test</scope>
         </dependency>
-            
-        </dependencies>
+
+    </dependencies>
 
     <build>
         <plugins>
-    
+
             <plugin>
                 <artifactId>maven-resources-plugin</artifactId>
-                <configuration>
-                    <includeEmptyDirs>true</includeEmptyDirs>
-                </configuration>
+                <executions>
+                    <execution>
+                        <id>copy-resources</id>
+                        <phase>process-resources</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <includeEmptyDirs>true</includeEmptyDirs>
+                            <outputDirectory>${project.build.directory}/dbscripts</outputDirectory>
+                            <resources>
+                                <resource>
+                                    <directory>${basedir}/src/main/resources/sql</directory>
+                                    <filtering>false</filtering>                                    
+                                </resource>
+                            </resources>
+                        </configuration>
+                    </execution>
+                </executions>
             </plugin>
-    
+
             <plugin>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
@@ -150,17 +166,17 @@
                             <name>context.realpath</name>
                             <value>${project.basedir}/src/main/webapp</value>
                         </property>
-						<property>
-							<name>project.build.directory</name>
-							<value>${project.build.directory}</value>
-						</property>
+                        <property>
+                            <name>project.build.directory</name>
+                            <value>${project.build.directory}</value>
+                        </property>
                     </systemProperties>
                     <excludes>
                         <exclude>**/TestUtils.java</exclude>
                     </excludes>
                 </configuration>
             </plugin>
-    
+
             <plugin>
                 <artifactId>maven-antrun-plugin</artifactId>
                 <dependencies>
@@ -173,15 +189,38 @@
                         <groupId>org.apache.roller</groupId>
                         <artifactId>test-utils</artifactId>
                         <version>5.0-BETA2-SNAPSHOT</version>
+                    </dependency>
+                    <dependency>
+                        <groupId>org.apache.derby</groupId>
+                        <artifactId>derby</artifactId>
+                        <version>10.5.3.0_1</version>
+                        <scope>test</scope>
+                    </dependency>
+                    <dependency>
+                        <groupId>org.apache.derby</groupId>
+                        <artifactId>derbynet</artifactId>
+                        <version>10.5.3.0_1</version>
+                        <scope>test</scope>
+                    </dependency>
+                    <dependency>
+                        <groupId>org.apache.derby</groupId>
+                        <artifactId>derbyclient</artifactId>
+                        <version>10.5.3.0_1</version>
+                        <scope>test</scope>
+                    </dependency>
+                    <dependency>
+                        <groupId>org.apache.derby</groupId>
+                        <artifactId>derbytools</artifactId>
+                        <version>10.5.3.0_1</version>
                         <scope>test</scope>
                     </dependency>
                 </dependencies>
-    
+
                 <executions>
-                    
+
                     <execution>
                         <id>gen-db-scripts</id>
-                        <phase>process-classes</phase>
+                        <phase>compile</phase>
                         <goals>
                             <goal>run</goal>
                         </goals>
@@ -189,17 +228,17 @@
                             <tasks>
                                 <taskdef name="texen"
                                          classname="org.apache.velocity.texen.ant.TexenTask"
-                                         classpathref="maven.compile.classpath"/>    
+                                         classpathref="maven.compile.classpath"/>
                                 <texen
-                                        controlTemplate  ="control.vm"
-                                        contextProperties="${project.build.outputDirectory}/sql/dbscripts.properties"
-                                        templatePath     ="${project.build.outputDirectory}/sql"
-                                        outputDirectory  ="${project.build.outputDirectory}/sql"
-                                        outputFile="README.txt"/>    
+                                    controlTemplate  ="control.vm"
+                                    contextProperties="${project.build.directory}/dbscripts/dbscripts.properties"
+                                    templatePath     ="${project.build.directory}/dbscripts"
+                                    outputDirectory  ="${project.build.directory}/dbscripts"
+                                    outputFile="README.txt"/>
                             </tasks>
                         </configuration>
                     </execution>
-    
+
                     <execution>
                         <id>startdb</id>
                         <phase>process-test-resources</phase>
@@ -208,14 +247,18 @@
                         </goals>
                         <configuration>
                             <tasks>
+                                <!-- Derby only for unit testing: skip when maven.text.skip is set -->
+                                <delete dir="${project.build.directory}/derby-system" verbose="true" failonerror="false" />
                                 <taskdef name="startdb" classname="org.apache.roller.weblogger.ant.StartDerbyTask"
-                                         classpathref="maven.compile.classpath"/>
-                                <startdb database="${project.build.testOutputDirectory}/derby-system/planet_business"
-                                         port="3219"></startdb>
+                                         classpathref="maven.test.classpath"/>
+                                <startdb databaseDir="${project.build.directory}/derby-system"
+                                         port="3221"
+                                         databaseScriptsDir="${project.build.directory}/dbscripts"
+                                         skip="${maven.test.skip}" ></startdb>
                             </tasks>
                         </configuration>
                     </execution>
-    
+
                     <execution>
                         <id>stopdb</id>
                         <phase>package</phase>
@@ -224,57 +267,21 @@
                         </goals>
                         <configuration>
                             <tasks>
+                                <!-- Derby only for unit testing: skip when maven.text.skip is set -->
                                 <taskdef name="stopdb" classname="org.apache.roller.weblogger.ant.StopDerbyTask"
-                                         classpathref="maven.compile.classpath"/>
-                                <stopdb port="3219"></stopdb>
-                                <delete dir="${project.build.testOutputDirectory}/derby-system"/>
+                                         classpathref="maven.test.classpath"/>
+                                <stopdb databaseDir="${project.build.directory}/derby-system"
+                                        port="3221"
+                                        databaseScriptsDir="${project.build.directory}/dbscripts"
+                                        skip="${maven.test.skip}" ></stopdb>
+                                <delete dir="${project.build.directory}/derby-system" verbose="true" failonerror="false" />
                             </tasks>
                         </configuration>
                     </execution>
-                    
-                </executions>
-            </plugin>
-        
-            <plugin>
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>sql-maven-plugin</artifactId>
-                <dependencies>
-                    <dependency>
-                        <groupId>org.apache.derby</groupId>
-                        <artifactId>derby</artifactId>
-                        <version>10.5.3.0_1</version>
-                    </dependency>
-                    <dependency>
-                        <groupId>org.apache.derby</groupId>
-                        <artifactId>derbyclient</artifactId>
-                        <version>10.5.3.0_1</version>
-                    </dependency>
-                </dependencies>
-                <executions>
-                
-                    <execution>
-                        <id>initdb</id>
-                        <phase>process-test-resources</phase>
-                        <goals>
-                            <goal>execute</goal>
-                        </goals>
-                        <configuration>
-                            <driver>${jdbcDriverClass}</driver>
-                            <url>jdbc:derby://localhost:3219/planet;create=true</url>
-                            <username>app</username>
-                            <password>app</password>
-                            <autocommit>true</autocommit>
-                            <onError>continue</onError>
-                            <srcFiles>
-                               <srcFile>${project.build.outputDirectory}/sql/droptables.sql</srcFile>
-                               <srcFile>${project.build.outputDirectory}/sql/derby/createdb.sql</srcFile>
-                            </srcFiles>
-                        </configuration>
-                    </execution>
-                    
+
                 </executions>
             </plugin>
-    
+
         </plugins>
 
         <testResources>
@@ -291,11 +298,14 @@
                 <includes>
                     <include>**/**</include>
                 </includes>
+                <excludes>
+                    <exclude>**/sql/**</exclude>
+                </excludes>
             </resource>
         </resources>
-        
+
     </build>
-    
+
     <profiles>
         <profile>
             <id>openjpa</id>
@@ -338,21 +348,7 @@
             </build>
         </profile>
 
-        <profile>
-            <id>derby-db</id>
-            <activation>
-                <activeByDefault>true</activeByDefault>
-            </activation>
-            <dependencies>
-                <dependency>
-                    <groupId>org.apache.derby</groupId>
-                    <artifactId>derby</artifactId>
-                </dependency>
-            </dependencies>
-            <properties>
-                <jdbcDriverClass>org.apache.derby.jdbc.ClientDriver</jdbcDriverClass>
-            </properties>
-        </profile>
     </profiles>
-    
+
 </project>
+

Modified: roller/trunk/planet-business/src/test/resources/planet-custom.properties
URL: http://svn.apache.org/viewvc/roller/trunk/planet-business/src/test/resources/planet-custom.properties?rev=909967&r1=909966&r2=909967&view=diff
==============================================================================
--- roller/trunk/planet-business/src/test/resources/planet-custom.properties (original)
+++ roller/trunk/planet-business/src/test/resources/planet-custom.properties Sun Feb 14 04:01:11 2010
@@ -5,17 +5,14 @@
 database.configurationType=jdbc
 
 database.jdbc.driverClass=org.apache.derby.jdbc.ClientDriver
-database.jdbc.connectionURL=jdbc:derby://localhost:3219/planet
-database.jdbc.username=app
-database.jdbc.password=app
-
-hibernate.dialect=org.hibernate.dialect.DerbyDialect
+database.jdbc.connectionURL=jdbc:derby://localhost:3221/rollerdb
+database.jdbc.username=APP
+database.jdbc.password=APP
 
 #jdbc.driverClass=com.mysql.jdbc.Driver
 #jdbc.connectionURL=jdbc:mysql://localhost:3306/rollertest
 #jdbc.username=scott
 #jdbc.password=tiger
-#hibernate.dialect=org.hibernate.dialect.MySQLDialect
 #openjpa.jdbc.DBDictionary=mysql(SupportsSubselect=false, UseClobs=true, SearchStringEscape=\\\\)
 
 #openjpa.Log=DefaultLevel=WARN, Runtime=INFO, Tool=INFO, SQL=TRACE

Copied: roller/trunk/roller-core/src/main/java/org/apache/roller/util/SQLScriptRunner.java (from r895620, roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/startup/SQLScriptRunner.java)
URL: http://svn.apache.org/viewvc/roller/trunk/roller-core/src/main/java/org/apache/roller/util/SQLScriptRunner.java?p2=roller/trunk/roller-core/src/main/java/org/apache/roller/util/SQLScriptRunner.java&p1=roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/startup/SQLScriptRunner.java&r1=895620&r2=909967&rev=909967&view=diff
==============================================================================
--- roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/startup/SQLScriptRunner.java (original)
+++ roller/trunk/roller-core/src/main/java/org/apache/roller/util/SQLScriptRunner.java Sun Feb 14 04:01:11 2010
@@ -16,7 +16,7 @@
  * directory of this distribution.
  */
 
-package org.apache.roller.weblogger.business.startup;
+package org.apache.roller.util;
 
 import java.io.BufferedReader;
 import java.io.FileInputStream;
@@ -30,8 +30,6 @@
 import java.sql.Statement;
 import java.util.ArrayList;
 import java.util.List;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 
 
 /**
@@ -41,8 +39,6 @@
  */
 public class SQLScriptRunner {
     
-    private static Log   log = LogFactory.getLog(SQLScriptRunner.class);
-    
     private List<String> commands = new ArrayList<String>();
     private List<String> messages = new ArrayList<String>();
     private boolean      failed = false;
@@ -52,14 +48,11 @@
     /** Creates a new instance of SQLScriptRunner */
     public SQLScriptRunner(InputStream is) throws IOException {
         
-        log.debug("instantiated");
-        
         BufferedReader in = new BufferedReader(new InputStreamReader(is));
         String command = ""; 
         String line;
         while ((line = in.readLine()) != null) {
             line = line.trim();
-            log.debug(line);
             
             if (!line.startsWith("--")) { // ignore lines starting with "--"    
                 

Modified: roller/trunk/roller-core/src/test/java/org/apache/roller/util/RegexUtilTest.java
URL: http://svn.apache.org/viewvc/roller/trunk/roller-core/src/test/java/org/apache/roller/util/RegexUtilTest.java?rev=909967&r1=909966&r2=909967&view=diff
==============================================================================
--- roller/trunk/roller-core/src/test/java/org/apache/roller/util/RegexUtilTest.java (original)
+++ roller/trunk/roller-core/src/test/java/org/apache/roller/util/RegexUtilTest.java Sun Feb 14 04:01:11 2010
@@ -21,7 +21,6 @@
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
-import org.apache.roller.util.RegexUtil;
 
 
 /**

Modified: roller/trunk/test-utils/pom.xml
URL: http://svn.apache.org/viewvc/roller/trunk/test-utils/pom.xml?rev=909967&r1=909966&r2=909967&view=diff
==============================================================================
--- roller/trunk/test-utils/pom.xml (original)
+++ roller/trunk/test-utils/pom.xml Sun Feb 14 04:01:11 2010
@@ -19,6 +19,12 @@
     <dependencies>
 
         <dependency>
+            <groupId>org.apache.roller</groupId>
+            <artifactId>roller-core</artifactId>
+            <version>5.0-BETA2-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <scope>compile</scope>

Modified: roller/trunk/test-utils/src/main/java/org/apache/roller/weblogger/ant/StartDerbyTask.java
URL: http://svn.apache.org/viewvc/roller/trunk/test-utils/src/main/java/org/apache/roller/weblogger/ant/StartDerbyTask.java?rev=909967&r1=909966&r2=909967&view=diff
==============================================================================
--- roller/trunk/test-utils/src/main/java/org/apache/roller/weblogger/ant/StartDerbyTask.java (original)
+++ roller/trunk/test-utils/src/main/java/org/apache/roller/weblogger/ant/StartDerbyTask.java Sun Feb 14 04:01:11 2010
@@ -17,8 +17,12 @@
  */
 package org.apache.roller.weblogger.ant;
 
+import java.io.File;
 import java.io.PrintWriter;
+import java.sql.Connection;
+import java.sql.DriverManager;
 import org.apache.derby.drda.NetworkServerControl;
+import org.apache.roller.util.SQLScriptRunner;
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Task;
 
@@ -27,34 +31,80 @@
  * @author Dave Johnson
  */
 public class StartDerbyTask extends Task {
-    private String database = null;
+    private String databaseDir = null;
+    private String databaseScriptsDir = null;
     private String port = null;
+    private boolean skip = false;
     
     public void execute() throws BuildException {
         try {
-            System.out.println("Starting Derby");
-            System.setProperty("derby.system.home", database);
-            System.setProperty("derby.drda.portNumber", port);
-            System.setProperty("derby.drda.host", "localhost");
-            NetworkServerControl server = new NetworkServerControl();
-            server.start(new PrintWriter(System.out));
-            try {Thread.sleep(2000);} catch (Exception ignored) {}
+            if (!isSkip()) {
+
+                System.out.println("==============");
+                System.out.println("Starting Derby");
+                System.out.println("==============");
+
+                System.setProperty("derby.system.home", databaseDir);
+
+                System.setProperty("derby.drda.portNumber", port);
+                System.setProperty("derby.drda.host", "localhost");
+                System.setProperty("derby.drda.maxThreads","10");
+                //System.setProperty("derby.drda.logConnections","true");
+                NetworkServerControl server = new NetworkServerControl();
+                server.start(new PrintWriter(System.out));
+                try {Thread.sleep(2000);} catch (Exception ignored) {}
+                System.out.println("Runtime Info: " + server.getRuntimeInfo());
+                System.out.println("System Info:  " + server.getSysinfo());
+
+                Class.forName("org.apache.derby.jdbc.ClientDriver");
+                Connection conn = DriverManager.getConnection(
+                    "jdbc:derby://localhost:" + port + "/rollerdb;create=true","APP", "APP");
+
+                //Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
+                //Connection conn = DriverManager.getConnection(
+                    //"jdbc:derby:rollerdb;create=true","APP", "APP");
+
+                // create roller tables
+
+                SQLScriptRunner runner1 = new SQLScriptRunner(
+                        databaseScriptsDir
+                        + File.separator + "droptables.sql");
+                runner1.runScript(conn, false);
+
+                SQLScriptRunner runner = new SQLScriptRunner(
+                        databaseScriptsDir
+                        + File.separator + "derby"
+                        + File.separator + "createdb.sql");
+                try {
+                    runner.runScript(conn, true);
+                } catch (Exception ignored) {
+                    for (String message : runner.getMessages()) {
+                        System.out.println(message);
+                    }
+                    ignored.printStackTrace();
+                }               
+
+                
+            } else {
+                System.out.println("Skipping Derby startup");
+            }
         } catch (Exception e) {
-            throw new BuildException("Unable to load Derby driver");
+            e.printStackTrace();
+            throw new BuildException("ERROR starting Derby");
         }
         
     }
     /**
-     * @return Returns the database.
+     * @return Returns the databaseDir.
      */
-    public String getDatabase() {
-        return database;
+    public String getDatabaseDir() {
+        return databaseDir;
     }
     /**
-     * @param database The database to set.
+     * @param databaseDir The databaseDir to set.
      */
-    public void setDatabase(String database) {
-        this.database = database;
+    public void setDatabaseDir(String databaseDir) {
+        this.databaseDir = databaseDir;
     }
     /**
      * @return Returns the port.
@@ -68,4 +118,46 @@
     public void setPort(String port) {
         this.port = port;
     }
+
+    /**
+     * @return the skip
+     */
+    public boolean isSkip() {
+        return skip;
+    }
+
+    /**
+     * @param skip the skip to set
+     */
+    public void setSkip(boolean skip) {
+        this.skip = skip;
+    }
+
+    /**
+     * @return the databaseScriptsDir
+     */
+    public String getDatabaseScriptsDir() {
+        return databaseScriptsDir;
+    }
+
+    /**
+     * @param databaseScriptsDir the databaseScriptsDir to set
+     */
+    public void setDatabaseScriptsDir(String databaseScriptsDir) {
+        this.databaseScriptsDir = databaseScriptsDir;
+    }
+
+    public void main(String[] args) {
+        try {
+            System.setProperty("derby.system.home", args[0]);
+            System.setProperty("derby.drda.portNumber", args[1]);
+            System.setProperty("derby.drda.host", "localhost");
+            System.setProperty("derby.drda.maxThreads", "10");
+            System.setProperty("derby.drda.logConnections", "true");
+            NetworkServerControl server = new NetworkServerControl();
+            server.start(new PrintWriter(System.out));
+        } catch (Exception ex) {
+            ex.printStackTrace();
+        }
+    }
 }

Modified: roller/trunk/test-utils/src/main/java/org/apache/roller/weblogger/ant/StopDerbyTask.java
URL: http://svn.apache.org/viewvc/roller/trunk/test-utils/src/main/java/org/apache/roller/weblogger/ant/StopDerbyTask.java?rev=909967&r1=909966&r2=909967&view=diff
==============================================================================
--- roller/trunk/test-utils/src/main/java/org/apache/roller/weblogger/ant/StopDerbyTask.java (original)
+++ roller/trunk/test-utils/src/main/java/org/apache/roller/weblogger/ant/StopDerbyTask.java Sun Feb 14 04:01:11 2010
@@ -17,7 +17,12 @@
  */
 package org.apache.roller.weblogger.ant;
 
+import java.io.File;
+import java.io.PrintWriter;
+import java.sql.Connection;
+import java.sql.DriverManager;
 import org.apache.derby.drda.NetworkServerControl;
+import org.apache.roller.util.SQLScriptRunner;
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Task;
 
@@ -26,17 +31,66 @@
  * @author Dave Johnson
  */
 public class StopDerbyTask extends Task {
+    private String databaseDir = null;
+    private String databaseScriptsDir = null;
     private String port = null;
+    private boolean skip = false;
+
     public void execute() throws BuildException {
         try {
-            System.out.println("Stopping Derby");
-            System.setProperty("derby.drda.portNumber", port);
-            System.setProperty("derby.drda.host", "localhost");
-            NetworkServerControl server = new NetworkServerControl();
-            server.shutdown();
-            try {Thread.sleep(2000);} catch (Exception ignored) {}
+            if (!isSkip()) {
+
+                Class.forName("org.apache.derby.jdbc.ClientDriver");
+                
+                String driverURL =
+                    "jdbc:derby://localhost:" + port + "/rollerdb";
+                Connection conn =
+                    DriverManager.getConnection(driverURL,"APP", "APP");
+
+                //Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
+                //Connection conn = DriverManager.getConnection(
+                    //"jdbc:derby:rollerdb;create=true","APP", "APP");
+
+                // drop Roller tables
+                SQLScriptRunner runner = new SQLScriptRunner(
+                        databaseScriptsDir
+                        + File.separator + "droptables.sql");
+                runner.runScript(conn, false);
+
+                System.out.println("==============");
+                System.out.println("Stopping Derby");
+                System.out.println("==============");
+                
+                try {
+                    DriverManager.getConnection(driverURL + ";shutdown=true");
+                } catch (Exception ignored) {}
+
+                System.setProperty("derby.system.home", databaseDir);
+
+                // Network Derby
+                System.setProperty("derby.drda.portNumber", port);
+                System.setProperty("derby.drda.host", "localhost");
+                System.setProperty("derby.drda.maxThreads","10");
+                //System.setProperty("derby.drda.logConnections","true");
+                NetworkServerControl server = new NetworkServerControl();
+                server.shutdown();
+
+                //try {
+                //    while (true) {
+                //       server.ping();
+                //    }
+                //} catch (Exception expected) {}
+
+                // Embedded Derby
+                //DriverManager.getConnection("jdbc:derby:;shutdown=true");
 
+                //try {Thread.sleep(2000);} catch (Exception ignored) {}
+
+            } else {
+                System.out.println("Skipping Derby shutdown");
+            }
         } catch (Exception e) {
+            e.printStackTrace();
             throw new BuildException(e.getMessage());
         }
     }
@@ -52,4 +106,46 @@
     public void setPort(String port) {
         this.port = port;
     }
+
+    /**
+     * @return the skip
+     */
+    public boolean isSkip() {
+        return skip;
+    }
+
+    /**
+     * @param skip the skip to set
+     */
+    public void setSkip(boolean skip) {
+        this.skip = skip;
+    }
+
+    /**
+     * @return the databaseDir
+     */
+    public String getDatabaseDir() {
+        return databaseDir;
+    }
+
+    /**
+     * @param databaseDir the databaseDir to set
+     */
+    public void setDatabaseDir(String databaseDir) {
+        this.databaseDir = databaseDir;
+    }
+
+    /**
+     * @return the databaseScriptsDir
+     */
+    public String getDatabaseScriptsDir() {
+        return databaseScriptsDir;
+    }
+
+    /**
+     * @param databaseScriptsDir the databaseScriptsDir to set
+     */
+    public void setDatabaseScriptsDir(String databaseScriptsDir) {
+        this.databaseScriptsDir = databaseScriptsDir;
+    }
 }

Modified: roller/trunk/test-utils/src/main/java/org/apache/roller/weblogger/jetty/DerbyLifeCycle.java
URL: http://svn.apache.org/viewvc/roller/trunk/test-utils/src/main/java/org/apache/roller/weblogger/jetty/DerbyLifeCycle.java?rev=909967&r1=909966&r2=909967&view=diff
==============================================================================
--- roller/trunk/test-utils/src/main/java/org/apache/roller/weblogger/jetty/DerbyLifeCycle.java (original)
+++ roller/trunk/test-utils/src/main/java/org/apache/roller/weblogger/jetty/DerbyLifeCycle.java Sun Feb 14 04:01:11 2010
@@ -40,7 +40,9 @@
     private String port = null;
 
     public void start() throws Exception {
+        log.info("**************");
         log.info("Starting Derby");
+        log.info("**************");
         try {
             System.setProperty("derby.system.home", database);
             System.setProperty("derby.drda.portNumber", port);
@@ -61,7 +63,9 @@
     }
 
     public void stop() throws Exception {
-        log.info("Starting Derby");
+        log.info("**************");
+        log.info("Stopping Derby");
+        log.info("**************");
         stopping = true;
         try {
             System.out.println("Stopping Derby");

Modified: roller/trunk/weblogger-business/pom.xml
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-business/pom.xml?rev=909967&r1=909966&r2=909967&view=diff
==============================================================================
--- roller/trunk/weblogger-business/pom.xml (original)
+++ roller/trunk/weblogger-business/pom.xml Sun Feb 14 04:01:11 2010
@@ -181,9 +181,25 @@
 
             <plugin>
                 <artifactId>maven-resources-plugin</artifactId>
-                <configuration>
-                    <includeEmptyDirs>true</includeEmptyDirs>
-                </configuration>
+                <executions>
+                    <execution>
+                        <id>copy-resources</id>
+                        <phase>process-resources</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <includeEmptyDirs>true</includeEmptyDirs>
+                            <outputDirectory>${project.build.directory}/dbscripts</outputDirectory>
+                            <resources>
+                                <resource>
+                                    <directory>${basedir}/src/main/resources/sql</directory>
+                                    <filtering>false</filtering>                                   
+                                </resource>
+                            </resources>
+                        </configuration>
+                    </execution>
+                </executions>
             </plugin>
 
             <plugin>
@@ -229,13 +245,31 @@
                         <version>5.0-BETA2-SNAPSHOT</version>
                         <scope>test</scope>
                     </dependency>
+                    <dependency>
+                        <groupId>org.apache.derby</groupId>
+                        <artifactId>derby</artifactId>
+                        <version>10.5.3.0_1</version>
+                        <scope>test</scope>
+                    </dependency>
+                    <dependency>
+                        <groupId>org.apache.derby</groupId>
+                        <artifactId>derbynet</artifactId>
+                        <version>10.5.3.0_1</version>
+                        <scope>test</scope>
+                    </dependency>
+                    <dependency>
+                        <groupId>org.apache.derby</groupId>
+                        <artifactId>derbyclient</artifactId>
+                        <version>10.5.3.0_1</version>
+                        <scope>test</scope>
+                    </dependency>
                 </dependencies>
 
                 <executions>
 
                     <execution>
                         <id>gen-db-scripts</id>
-                        <phase>process-classes</phase>
+                        <phase>compile</phase>
                         <goals>
                             <goal>run</goal>
                         </goals>
@@ -246,9 +280,9 @@
                                          classpathref="maven.compile.classpath"/>
                                 <texen
                                     controlTemplate  ="control.vm"
-                                    contextProperties="${project.build.outputDirectory}/sql/dbscripts.properties"
-                                    templatePath     ="${project.build.outputDirectory}/sql"
-                                    outputDirectory  ="${project.build.outputDirectory}/sql"
+                                    contextProperties="${project.build.directory}/dbscripts/dbscripts.properties"
+                                    templatePath     ="${project.build.directory}/dbscripts"
+                                    outputDirectory  ="${project.build.directory}/dbscripts"
                                     outputFile="README.txt"/>
                             </tasks>
                         </configuration>
@@ -262,10 +296,14 @@
                         </goals>
                         <configuration>
                             <tasks>
+                                <!-- Derby only for unit testing: skip when maven.text.skip is set -->
+                                <delete dir="${project.build.directory}/derby-system1" verbose="true" failonerror="false" />
                                 <taskdef name="startdb" classname="org.apache.roller.weblogger.ant.StartDerbyTask"
-                                         classpathref="maven.compile.classpath"/>
-                                <startdb database="${project.build.testOutputDirectory}/derby-system/planet_business"
-                                         port="3219"></startdb>
+                                         classpathref="maven.test.classpath"/>
+                                <startdb databaseDir="${project.build.directory}/derby-system"
+                                         port="3219"
+                                         databaseScriptsDir="${project.build.directory}/dbscripts"
+                                         skip="${maven.test.skip}" ></startdb>
                             </tasks>
                         </configuration>
                     </execution>
@@ -278,11 +316,14 @@
                         </goals>
                         <configuration>
                             <tasks>
+                                <!-- Derby only for unit testing: skip when maven.text.skip is set -->
                                 <taskdef name="stopdb" classname="org.apache.roller.weblogger.ant.StopDerbyTask"
-                                         classpathref="maven.compile.classpath"/>
-                                <stopdb port="3219"></stopdb>
-                                <delete dir="${project.build.testOutputDirectory}/derby-system"/>
-                                <delete dir="${project.build.testOutputDirectory}/mediafiles"/>
+                                         classpathref="maven.test.classpath"/>
+                                <stopdb databaseDir="${project.build.directory}/derby-system"
+                                        port="3219"
+                                        databaseScriptsDir="${project.build.directory}/dbscripts"
+                                        skip="${maven.test.skip}" ></stopdb>
+                                <delete dir="${project.build.directory}/derby-system" verbose="true" failonerror="false" />
                             </tasks>
                         </configuration>
                     </execution>
@@ -292,46 +333,6 @@
 
             <plugin>
                 <groupId>org.codehaus.mojo</groupId>
-                <artifactId>sql-maven-plugin</artifactId>
-                <dependencies>
-                    <dependency>
-                        <groupId>org.apache.derby</groupId>
-                        <artifactId>derby</artifactId>
-                        <version>10.5.3.0_1</version>
-                    </dependency>
-                    <dependency>
-                        <groupId>org.apache.derby</groupId>
-                        <artifactId>derbyclient</artifactId>
-                        <version>10.5.3.0_1</version>
-                    </dependency>
-                </dependencies>
-                <executions>
-
-                    <execution>
-                        <id>initdb</id>
-                        <phase>process-test-resources</phase>
-                        <goals>
-                            <goal>execute</goal>
-                        </goals>
-                        <configuration>
-                            <driver>${jdbcDriverClass}</driver>
-                            <url>jdbc:derby://localhost:3219/roller;create=true</url>
-                            <username>app</username>
-                            <password>app</password>
-                            <autocommit>true</autocommit>
-                            <onError>continue</onError>
-                            <srcFiles>
-                                <srcFile>${project.build.outputDirectory}/sql/droptables.sql</srcFile>
-                                <srcFile>${project.build.outputDirectory}/sql/derby/createdb.sql</srcFile>
-                            </srcFiles>
-                        </configuration>
-                    </execution>
-
-                </executions>
-            </plugin>
-
-            <plugin>
-                <groupId>org.codehaus.mojo</groupId>
                 <artifactId>buildnumber-maven-plugin</artifactId>
                 <version>1.0-beta-3</version>
                 <executions>
@@ -418,21 +419,6 @@
             </build>
         </profile>
 
-        <profile>
-            <id>derby-db</id>
-            <activation>
-                <activeByDefault>true</activeByDefault>
-            </activation>
-            <dependencies>
-                <dependency>
-                    <groupId>org.apache.derby</groupId>
-                    <artifactId>derby</artifactId>
-                </dependency>
-            </dependencies>
-            <properties>
-                <jdbcDriverClass>org.apache.derby.jdbc.ClientDriver</jdbcDriverClass>
-            </properties>
-        </profile>
     </profiles>
 
 </project>

Modified: roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/startup/ClasspathDatabaseScriptProvider.java
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/startup/ClasspathDatabaseScriptProvider.java?rev=909967&r1=909966&r2=909967&view=diff
==============================================================================
--- roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/startup/ClasspathDatabaseScriptProvider.java (original)
+++ roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/startup/ClasspathDatabaseScriptProvider.java Sun Feb 14 04:01:11 2010
@@ -27,7 +27,7 @@
 public class ClasspathDatabaseScriptProvider implements DatabaseScriptProvider {
     
     public InputStream getDatabaseScript(String path) {
-        String resourcePath = "/sql/" + path;
+        String resourcePath = "/dbscripts/" + path;
         return this.getClass().getResourceAsStream(resourcePath);
     }
     

Modified: roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/startup/DatabaseInstaller.java
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/startup/DatabaseInstaller.java?rev=909967&r1=909966&r2=909967&view=diff
==============================================================================
--- roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/startup/DatabaseInstaller.java (original)
+++ roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/startup/DatabaseInstaller.java Sun Feb 14 04:01:11 2010
@@ -18,6 +18,7 @@
 
 package org.apache.roller.weblogger.business.startup;
 
+import org.apache.roller.util.SQLScriptRunner;
 import java.io.IOException;
 import java.sql.Connection;
 import java.sql.PreparedStatement;

Modified: roller/trunk/weblogger-business/src/main/resources/sql/droptables.sql
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-business/src/main/resources/sql/droptables.sql?rev=909967&r1=909966&r2=909967&view=diff
==============================================================================
--- roller/trunk/weblogger-business/src/main/resources/sql/droptables.sql (original)
+++ roller/trunk/weblogger-business/src/main/resources/sql/droptables.sql Sun Feb 14 04:01:11 2010
@@ -62,3 +62,6 @@
 drop table userrole;
 drop table rolleruser;
 
+-- oauth tables
+drop table roller_oauthconsumer;
+drop table roller_oauthaccessor;

Modified: roller/trunk/weblogger-business/src/test/java/org/apache/roller/weblogger/business/SQLScriptRunnerTest.java
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-business/src/test/java/org/apache/roller/weblogger/business/SQLScriptRunnerTest.java?rev=909967&r1=909966&r2=909967&view=diff
==============================================================================
--- roller/trunk/weblogger-business/src/test/java/org/apache/roller/weblogger/business/SQLScriptRunnerTest.java (original)
+++ roller/trunk/weblogger-business/src/test/java/org/apache/roller/weblogger/business/SQLScriptRunnerTest.java Sun Feb 14 04:01:11 2010
@@ -23,7 +23,7 @@
 import java.sql.SQLException;
 import junit.framework.TestCase;
 import org.apache.roller.weblogger.business.startup.WebloggerStartup;
-import org.apache.roller.weblogger.business.startup.SQLScriptRunner;
+import org.apache.roller.util.SQLScriptRunner;
 import org.apache.roller.weblogger.TestUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;

Modified: roller/trunk/weblogger-business/src/test/resources/planet-custom.properties
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-business/src/test/resources/planet-custom.properties?rev=909967&r1=909966&r2=909967&view=diff
==============================================================================
--- roller/trunk/weblogger-business/src/test/resources/planet-custom.properties (original)
+++ roller/trunk/weblogger-business/src/test/resources/planet-custom.properties Sun Feb 14 04:01:11 2010
@@ -5,7 +5,7 @@
 database.configurationType=jdbc
 
 database.jdbc.driverClass=org.apache.derby.jdbc.ClientDriver
-database.jdbc.connectionURL=jdbc:derby://localhost:3219/roller
+database.jdbc.connectionURL=jdbc:derby://localhost:3219/rollerdb
 database.jdbc.username=app
 database.jdbc.password=app
 

Modified: roller/trunk/weblogger-business/src/test/resources/roller-custom.properties
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-business/src/test/resources/roller-custom.properties?rev=909967&r1=909966&r2=909967&view=diff
==============================================================================
--- roller/trunk/weblogger-business/src/test/resources/roller-custom.properties (original)
+++ roller/trunk/weblogger-business/src/test/resources/roller-custom.properties Sun Feb 14 04:01:11 2010
@@ -1,9 +1,9 @@
 
 database.configurationType=jdbc
 database.jdbc.driverClass=org.apache.derby.jdbc.ClientDriver
-database.jdbc.connectionURL=jdbc:derby://localhost:3219/roller
-database.jdbc.username=app
-database.jdbc.password=app
+database.jdbc.connectionURL=jdbc:derby://localhost:3219/rollerdb
+database.jdbc.username=APP
+database.jdbc.password=APP
 #openjpa.Log=DefaultLevel=WARN, Runtime=INFO, Tool=INFO, SQL=INFO
 
 # use CMA authentication to work around Spring init issues in UI tests

Modified: roller/trunk/weblogger-web/pom.xml
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-web/pom.xml?rev=909967&r1=909966&r2=909967&view=diff
==============================================================================
--- roller/trunk/weblogger-web/pom.xml (original)
+++ roller/trunk/weblogger-web/pom.xml Sun Feb 14 04:01:11 2010
@@ -75,11 +75,6 @@
             </exclusions>
         </dependency>
 
-        <!-- <dependency>
-                <groupId>com.google.inject.integration</groupId>
-                <artifactId>guice-struts2-plugin</artifactId>
-            </dependency> -->
-
         <dependency>
             <groupId>org.apache.struts</groupId>
             <artifactId>struts2-tiles-plugin</artifactId>
@@ -99,12 +94,6 @@
         <dependency>
             <groupId>org.apache.tiles</groupId>
             <artifactId>tiles-jsp</artifactId>
-            <!-- <exclusions>
-                 <exclusion>
-                    <groupId>org.apache.tiles</groupId>
-                    <artifactId>tiles-servlet</artifactId>
-                </exclusion>
-             </exclusions> -->
         </dependency>
 
         <dependency>
@@ -231,34 +220,6 @@
             <version>0.9.5</version>
         </dependency>
 
-        <!-- <dependency>
-            <groupId>org.openid4java</groupId>
-            <artifactId>openid4java</artifactId>
-            <version>0.9.5</version>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.openid4java</groupId>
-                    <artifactId>openid4java-nodeps</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>org.openid4java</groupId>
-                    <artifactId>openid4java-consumer</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>org.openid4java</groupId>
-                    <artifactId>openid4java-server-SampleServer</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>org.openid4java</groupId>
-                    <artifactId>openid4java-consumer-SampleConsumer</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>org.openid4java</groupId>
-                    <artifactId>openid4java-server-JdbcServerAssociationStore</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency> -->
-
         <dependency>
             <groupId>net.sf.ehcache</groupId>
             <artifactId>ehcache</artifactId>
@@ -376,15 +337,12 @@
                 <groupId>org.mortbay.jetty</groupId>
                 <artifactId>maven-jetty-plugin</artifactId>
                 <configuration>
-                    <!--
                     <jettyConfig>${project.build.directory}/jetty.xml</jettyConfig>
-                    <jettyEnvXml>${project.build.directory}/jetty-env.xml</jettyEnvXml>
-                    -->
                     <systemProperties>
 
                         <systemProperty>
                             <name>derby.dir</name>
-                            <value>${project.build.directory}/work</value>
+                            <value>${project.build.directory}/work/derby-system</value>
                         </systemProperty>
 
                         <systemProperty>
@@ -404,7 +362,7 @@
 
                         <systemProperty>
                             <name>derby.port</name>
-                            <value>3219</value>
+                            <value>3223</value>
                         </systemProperty>
 
                         <systemProperty>
@@ -511,6 +469,24 @@
                         <version>5.0-BETA2-SNAPSHOT</version>
                         <scope>test</scope>
                     </dependency>
+                    <dependency>
+                        <groupId>org.apache.derby</groupId>
+                        <artifactId>derby</artifactId>
+                        <version>10.5.3.0_1</version>
+                        <scope>test</scope>
+                    </dependency>
+                    <dependency>
+                        <groupId>org.apache.derby</groupId>
+                        <artifactId>derbynet</artifactId>
+                        <version>10.5.3.0_1</version>
+                        <scope>test</scope>
+                    </dependency>
+                    <dependency>
+                        <groupId>org.apache.derby</groupId>
+                        <artifactId>derbyclient</artifactId>
+                        <version>10.5.3.0_1</version>
+                        <scope>test</scope>
+                    </dependency>
                 </dependencies>
 
                 <executions>
@@ -523,28 +499,34 @@
                         </goals>
                         <configuration>
                             <tasks>
+                                <!-- Derby only for unit testing: skip when maven.text.skip is set -->
+                                <delete dir="${project.build.directory}/derby-system" verbose="true" failonerror="false" />
                                 <taskdef name="startdb" classname="org.apache.roller.weblogger.ant.StartDerbyTask"
-                                         classpathref="maven.compile.classpath"/>
-                                <startdb database="${project.build.testOutputDirectory}/derby-system/weblogger-web"
-                                         port="3219"></startdb>
+                                         classpathref="maven.test.classpath"/>
+                                <startdb databaseDir="${project.build.directory}/derby-system"
+                                         port="3223"
+                                         databaseScriptsDir="${project.build.directory}/roller/WEB-INF/classes/dbscripts"
+                                         skip="${maven.test.skip}" ></startdb>
                             </tasks>
                         </configuration>
                     </execution>
 
                     <execution>
                         <id>stopdb</id>
-                        <phase>prepare-package</phase>
+                        <phase>package</phase>
                         <goals>
                             <goal>run</goal>
                         </goals>
                         <configuration>
                             <tasks>
-                                <!--
+                                <!-- Derby only for unit testing: skip when maven.text.skip is set -->
                                 <taskdef name="stopdb" classname="org.apache.roller.weblogger.ant.StopDerbyTask"
-                                         classpathref="maven.compile.classpath"/>
-                                <stopdb port="3219"></stopdb>
-                                <delete dir="${project.build.testOutputDirectory}/derby-system"/>
--->
+                                         classpathref="maven.test.classpath"/>
+                                <stopdb databaseDir="${project.build.directory}/derby-system"
+                                        port="3223"
+                                        databaseScriptsDir="${project.build.directory}/roller/WEB-INF/classes/dbscripts"
+                                        skip="${maven.test.skip}" ></stopdb>
+                                <delete dir="${project.build.directory}/derby-system" verbose="true" failonerror="false" />
                             </tasks>
                         </configuration>
                     </execution>
@@ -553,42 +535,28 @@
             </plugin>
 
             <plugin>
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>sql-maven-plugin</artifactId>
-                <dependencies>
-                    <dependency>
-                        <groupId>org.apache.derby</groupId>
-                        <artifactId>derby</artifactId>
-                        <version>10.5.3.0_1</version>
-                    </dependency>
-                    <dependency>
-                        <groupId>org.apache.derby</groupId>
-                        <artifactId>derbyclient</artifactId>
-                        <version>10.5.3.0_1</version>
-                    </dependency>
-                </dependencies>
+                <artifactId>maven-resources-plugin</artifactId>
+                <version>2.4.1</version>
                 <executions>
-
                     <execution>
-                        <id>initdb</id>
-                        <phase>process-test-resources</phase>
+                        <id>copy-resources</id>
+                        <phase>process-resources</phase>
                         <goals>
-                            <goal>execute</goal>
+                            <goal>copy-resources</goal>
                         </goals>
                         <configuration>
-                            <driver>${jdbcDriverClass}</driver>
-                            <url>jdbc:derby://localhost:3219/rollerdb;create=true</url>
-                            <username>app</username>
-                            <password>app</password>
-                            <autocommit>true</autocommit>
-                            <onError>continue</onError>
-                            <srcFiles>
-                                <srcFile>${project.build.outputDirectory}/../../../weblogger-business/target/classes/sql/droptables.sql</srcFile>
-                                <srcFile>${project.build.outputDirectory}/../../../weblogger-business/target/classes/sql/derby/createdb.sql</srcFile>
-                            </srcFiles>
+                            <outputDirectory>${project.build.directory}/roller/WEB-INF/classes/dbscripts</outputDirectory>
+                            <resources>
+                                <resource>
+                                    <directory>../weblogger-business/target/dbscripts</directory>
+                                    <filtering>false</filtering>
+                                    <includes>
+                                        <include>**/*.sql</include>
+                                    </includes>
+                                </resource>
+                            </resources>
                         </configuration>
                     </execution>
-
                 </executions>
             </plugin>
 
@@ -607,28 +575,7 @@
                 <filtering>true</filtering>
             </resource>
         </resources>
-    </build>
 
-    <profiles>
-
-        <profile>
-            <id>derby-db</id>
-            <activation>
-                <activeByDefault>true</activeByDefault>
-            </activation>
-            <dependencies>
-                <dependency>
-                    <groupId>org.apache.derby</groupId>
-                    <artifactId>derby</artifactId>
-                </dependency>
-            </dependencies>
-            <properties>
-                <jdbcDriverClass>org.apache.derby.jdbc.ClientDriver</jdbcDriverClass>
-            </properties>
-        </profile>
-
-    </profiles>
+    </build>
 
 </project>
-
-

Modified: roller/trunk/weblogger-web/src/test/resources/jetty.xml
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-web/src/test/resources/jetty.xml?rev=909967&r1=909966&r2=909967&view=diff
==============================================================================
--- roller/trunk/weblogger-web/src/test/resources/jetty.xml (original)
+++ roller/trunk/weblogger-web/src/test/resources/jetty.xml Sun Feb 14 04:01:11 2010
@@ -9,17 +9,17 @@
       <Arg>
         <New class="org.apache.roller.weblogger.jetty.DerbyLifeCycle">
             <Set name="database"><SystemProperty name="derby.dir" default="." /></Set>
-            <Set name="port"><SystemProperty name="derby.port" default="3219" /></Set>
+            <Set name="port"><SystemProperty name="derby.port" default="3223" /></Set>
         </New>
       </Arg>
     </Call>
 
-<!-- Configure a log
+<!-- Configure a log -->
 
     <New id="ServerLog" class="java.io.PrintStream">
       <Arg>
         <New class="org.mortbay.util.RolloverFileOutputStream">
-          <Arg><SystemProperty name="jetty.home" default="."/>/yyyy_mm_dd.stderrout.log</Arg>
+          <Arg>${project.build.directory}/work/yyyy_mm_dd.stderrout.log</Arg>
           <Arg type="boolean">false</Arg>
           <Arg type="int">90</Arg>
           <Arg><Call class="java.util.TimeZone" name="getTimeZone"><Arg>GMT</Arg></Call></Arg>
@@ -31,7 +31,6 @@
     <Call class="org.mortbay.log.Log" name="info"><Arg>Redirecting stderr/stdout to <Ref id="ServerLogName"/></Arg></Call>
     <Call class="java.lang.System" name="setErr"><Arg><Ref id="ServerLog"/></Arg></Call>
     <Call class="java.lang.System" name="setOut"><Arg><Ref id="ServerLog"/></Arg></Call>
- -->
 
 </Configure>
 

Modified: roller/trunk/weblogger-web/src/test/resources/planet-custom.properties
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-web/src/test/resources/planet-custom.properties?rev=909967&r1=909966&r2=909967&view=diff
==============================================================================
--- roller/trunk/weblogger-web/src/test/resources/planet-custom.properties (original)
+++ roller/trunk/weblogger-web/src/test/resources/planet-custom.properties Sun Feb 14 04:01:11 2010
@@ -3,6 +3,6 @@
 
 database.configurationType=jdbc
 database.jdbc.driverClass=org.apache.derby.jdbc.ClientDriver
-database.jdbc.connectionURL=jdbc:derby://localhost:3219/rollerdb
+database.jdbc.connectionURL=jdbc:derby://localhost:3223/rollerdb;create=true
 database.jdbc.username=app
 database.jdbc.password=app

Modified: roller/trunk/weblogger-web/src/test/resources/roller-custom.properties
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-web/src/test/resources/roller-custom.properties?rev=909967&r1=909966&r2=909967&view=diff
==============================================================================
--- roller/trunk/weblogger-web/src/test/resources/roller-custom.properties (original)
+++ roller/trunk/weblogger-web/src/test/resources/roller-custom.properties Sun Feb 14 04:01:11 2010
@@ -1,14 +1,11 @@
+installation.type=auto
 
 database.configurationType=jdbc
 database.jdbc.driverClass=org.apache.derby.jdbc.ClientDriver
-database.jdbc.connectionURL=jdbc:derby://localhost:3219/rollerdb
+database.jdbc.connectionURL=jdbc:derby://localhost:3223/rollerdb;create=true
 database.jdbc.username=app
 database.jdbc.password=app
 
-
-# use CMA authentication to work around Spring init issues in UI tests
-authentication.cma.enabled=true
-
 # use plain text passwords in testing
 passwds.encryption.enabled=false
 
@@ -40,18 +37,19 @@
 tasks.TestTask.leaseTime=300
 
 # logging
-log4j.rootCategory=DEBUG, roller
-#log4j.category.org.apache.roller=ERROR
+log4j.rootCategory=ERROR, roller
+log4j.category.org.apache.roller=INFO
 #log4j.category.net.java.roller=ERROR
 
-#log4j.category.org.apache.roller.planet.business.jpa.JPAPropertiesManagerImpl=DEBUG
-#log4j.category.org.apache.roller.weblogger.business.jpa.JPAPropertiesManagerImpl=DEBUG
+log4j.category.org.apache.roller.planet.config.PlanetConfig=DEBUG
+log4j.category.org.apache.roller.weblogger.config.WebloggerConfig=DEBUG
 
-#log4j.category.org.apache.roller.planet.config.PlanetConfig=DEBUG
-#log4j.category.org.apache.roller.weblogger.config.WebloggerConfig=DEBUG
+log4j.category.org.apache.roller.weblogger.planet.tasks=DEBUG
+log4j.category.org.apache.roller.weblogger.business.runnable=DEBUG
 
-#log4j.category.org.apache.roller.weblogger.planet.tasks=DEBUG
 #log4j.category.org.apache.roller.planet.business=DEBUG
 #log4j.category.org.apache.roller.weblogger.planet.business=DEBUG
+#log4j.category.org.apache.roller.planet.business.jpa.JPAPropertiesManagerImpl=DEBUG
+#log4j.category.org.apache.roller.weblogger.business.jpa.JPAPropertiesManagerImpl=DEBUG
 
 



Mime
View raw message