cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r408131 - in /incubator/cayenne/main/branches/STABLE-1-1/cayene-regression-profiler-1.1: ./ src/main/java/org/apache/cayenne/profile/cases/ src/main/java/org/apache/cayenne/profile/servlet/ src/main/resources/
Date Sun, 21 May 2006 04:16:34 GMT
Author: aadamchik
Date: Sat May 20 21:16:34 2006
New Revision: 408131

URL: http://svn.apache.org/viewvc?rev=408131&view=rev
Log:
fixing varios bugs in profiler code

Modified:
    incubator/cayenne/main/branches/STABLE-1-1/cayene-regression-profiler-1.1/pom.xml
    incubator/cayenne/main/branches/STABLE-1-1/cayene-regression-profiler-1.1/src/main/java/org/apache/cayenne/profile/cases/SelectCase.java
    incubator/cayenne/main/branches/STABLE-1-1/cayene-regression-profiler-1.1/src/main/java/org/apache/cayenne/profile/servlet/AbstractCase.java
    incubator/cayenne/main/branches/STABLE-1-1/cayene-regression-profiler-1.1/src/main/java/org/apache/cayenne/profile/servlet/ProfileFilter.java
    incubator/cayenne/main/branches/STABLE-1-1/cayene-regression-profiler-1.1/src/main/resources/cayenne.xml

Modified: incubator/cayenne/main/branches/STABLE-1-1/cayene-regression-profiler-1.1/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/branches/STABLE-1-1/cayene-regression-profiler-1.1/pom.xml?rev=408131&r1=408130&r2=408131&view=diff
==============================================================================
--- incubator/cayenne/main/branches/STABLE-1-1/cayene-regression-profiler-1.1/pom.xml (original)
+++ incubator/cayenne/main/branches/STABLE-1-1/cayene-regression-profiler-1.1/pom.xml Sat
May 20 21:16:34 2006
@@ -70,6 +70,11 @@
       <scope>provided</scope>
     </dependency>
     <dependency>
+		<groupId>junit</groupId>
+		<artifactId>junit</artifactId>
+		<version>3.8.1</version>
+	</dependency>
+    <dependency>
       <groupId>hsqldb</groupId>
       <artifactId>hsqldb</artifactId>
       <version>1.8.0.1</version>

Modified: incubator/cayenne/main/branches/STABLE-1-1/cayene-regression-profiler-1.1/src/main/java/org/apache/cayenne/profile/cases/SelectCase.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/branches/STABLE-1-1/cayene-regression-profiler-1.1/src/main/java/org/apache/cayenne/profile/cases/SelectCase.java?rev=408131&r1=408130&r2=408131&view=diff
==============================================================================
--- incubator/cayenne/main/branches/STABLE-1-1/cayene-regression-profiler-1.1/src/main/java/org/apache/cayenne/profile/cases/SelectCase.java
(original)
+++ incubator/cayenne/main/branches/STABLE-1-1/cayene-regression-profiler-1.1/src/main/java/org/apache/cayenne/profile/cases/SelectCase.java
Sat May 20 21:16:34 2006
@@ -33,6 +33,6 @@
 
         SelectQuery q = new SelectQuery(Entity1.class, Expression
                 .fromString("name like 'Name_11%'"));
-        context.performQuery(q);
+        assertEquals(1100, context.performQuery(q).size());
     }
 }

Modified: incubator/cayenne/main/branches/STABLE-1-1/cayene-regression-profiler-1.1/src/main/java/org/apache/cayenne/profile/servlet/AbstractCase.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/branches/STABLE-1-1/cayene-regression-profiler-1.1/src/main/java/org/apache/cayenne/profile/servlet/AbstractCase.java?rev=408131&r1=408130&r2=408131&view=diff
==============================================================================
--- incubator/cayenne/main/branches/STABLE-1-1/cayene-regression-profiler-1.1/src/main/java/org/apache/cayenne/profile/servlet/AbstractCase.java
(original)
+++ incubator/cayenne/main/branches/STABLE-1-1/cayene-regression-profiler-1.1/src/main/java/org/apache/cayenne/profile/servlet/AbstractCase.java
Sat May 20 21:16:34 2006
@@ -18,6 +18,8 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import junit.framework.TestCase;
+
 import org.objectstyle.cayenne.access.DataContext;
 
 /**
@@ -25,7 +27,7 @@
  * 
  * @author Andrus Adamchik
  */
-public class AbstractCase {
+public class AbstractCase extends TestCase {
 
     public void doGet(
             DataContext context,

Modified: incubator/cayenne/main/branches/STABLE-1-1/cayene-regression-profiler-1.1/src/main/java/org/apache/cayenne/profile/servlet/ProfileFilter.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/branches/STABLE-1-1/cayene-regression-profiler-1.1/src/main/java/org/apache/cayenne/profile/servlet/ProfileFilter.java?rev=408131&r1=408130&r2=408131&view=diff
==============================================================================
--- incubator/cayenne/main/branches/STABLE-1-1/cayene-regression-profiler-1.1/src/main/java/org/apache/cayenne/profile/servlet/ProfileFilter.java
(original)
+++ incubator/cayenne/main/branches/STABLE-1-1/cayene-regression-profiler-1.1/src/main/java/org/apache/cayenne/profile/servlet/ProfileFilter.java
Sat May 20 21:16:34 2006
@@ -39,9 +39,17 @@
     public synchronized void init(FilterConfig config) throws ServletException {
 
         // remove old database
+        // store this value and log it after Cayenne logging is initialized.
+        boolean deletedOldDb = false;
         File dbDir = new File("target/regression-db");
         if (dbDir.isDirectory()) {
-            Util.delete(dbDir.getAbsolutePath(), true);
+            if (Util.delete(dbDir.getAbsolutePath(), true)) {
+                deletedOldDb = true;
+            }
+            
+            if (dbDir.isDirectory()) {
+                throw new ServletException("Can't delete the old database");
+            }
         }
 
         // start Cayenne stack
@@ -52,6 +60,9 @@
             cayenneVersion = "unknown";
         }
         logger.info("Started Cayenne version - '" + cayenneVersion + "'");
+        if(deletedOldDb) {
+            logger.info("deleted old database");
+        }
 
         // create fresh database
         DataDomain domain = Configuration.getSharedConfiguration().getDomain();

Modified: incubator/cayenne/main/branches/STABLE-1-1/cayene-regression-profiler-1.1/src/main/resources/cayenne.xml
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/branches/STABLE-1-1/cayene-regression-profiler-1.1/src/main/resources/cayenne.xml?rev=408131&r1=408130&r2=408131&view=diff
==============================================================================
--- incubator/cayenne/main/branches/STABLE-1-1/cayene-regression-profiler-1.1/src/main/resources/cayenne.xml
(original)
+++ incubator/cayenne/main/branches/STABLE-1-1/cayene-regression-profiler-1.1/src/main/resources/cayenne.xml
Sat May 20 21:16:34 2006
@@ -5,6 +5,7 @@
 
 	<node name="regression-profile"
 		 datasource="regression-profile.driver.xml"
+		 adapter="org.objectstyle.cayenne.dba.hsqldb.HSQLDBAdapter"
 		 factory="org.objectstyle.cayenne.conf.DriverDataSourceFactory">
 			<map-ref name="regression-profile"/>
 	 </node>



Mime
View raw message