cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r408130 - in /incubator/cayenne/main/trunk/cayenne-regression-profiler: ./ src/main/java/org/apache/cayenne/profile/cases/ src/main/java/org/apache/cayenne/profile/servlet/
Date Sun, 21 May 2006 04:16:29 GMT
Author: aadamchik
Date: Sat May 20 21:16:27 2006
New Revision: 408130

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

Modified:
    incubator/cayenne/main/trunk/cayenne-regression-profiler/.classpath
    incubator/cayenne/main/trunk/cayenne-regression-profiler/pom.xml
    incubator/cayenne/main/trunk/cayenne-regression-profiler/src/main/java/org/apache/cayenne/profile/cases/DeleteCase.java
    incubator/cayenne/main/trunk/cayenne-regression-profiler/src/main/java/org/apache/cayenne/profile/cases/SelectCase.java
    incubator/cayenne/main/trunk/cayenne-regression-profiler/src/main/java/org/apache/cayenne/profile/servlet/AbstractCase.java
    incubator/cayenne/main/trunk/cayenne-regression-profiler/src/main/java/org/apache/cayenne/profile/servlet/ProfileFilter.java

Modified: incubator/cayenne/main/trunk/cayenne-regression-profiler/.classpath
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/cayenne-regression-profiler/.classpath?rev=408130&r1=408129&r2=408130&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne-regression-profiler/.classpath (original)
+++ incubator/cayenne/main/trunk/cayenne-regression-profiler/.classpath Sat May 20 21:16:27
2006
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
 	<classpathentry kind="src" path="src/main/java"/>
-	<classpathentry kind="src" path="src/main/resources"/>
+	<classpathentry output="src/main/resources" kind="src" path="src/main/resources"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 	<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
 	<classpathentry kind="output" path="target/classes"/>

Modified: incubator/cayenne/main/trunk/cayenne-regression-profiler/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/cayenne-regression-profiler/pom.xml?rev=408130&r1=408129&r2=408130&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne-regression-profiler/pom.xml (original)
+++ incubator/cayenne/main/trunk/cayenne-regression-profiler/pom.xml Sat May 20 21:16:27 2006
@@ -77,15 +77,15 @@
   		 </dependencies>
 	</profile>
 	<profile>
-  		<id>1.2M11</id>
+  		<id>1.2M12</id>
   		 <dependencies>
   		 	<dependency>
 				<groupId>org.objectstyle.cayenne</groupId>
 				<artifactId>cayenne</artifactId>
-				<version>1.2M11</version>
+				<version>1.2M12</version>
 			</dependency>
   		 </dependencies>
-	</profile> 
+	</profile>
   </profiles>
   
   <dependencies>
@@ -95,6 +95,11 @@
       <version>2.4</version>
       <scope>provided</scope>
     </dependency>
+    <dependency>
+		<groupId>junit</groupId>
+		<artifactId>junit</artifactId>
+		<version>3.8.1</version>
+	</dependency>
     <dependency>
       <groupId>hsqldb</groupId>
       <artifactId>hsqldb</artifactId>

Modified: incubator/cayenne/main/trunk/cayenne-regression-profiler/src/main/java/org/apache/cayenne/profile/cases/DeleteCase.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/cayenne-regression-profiler/src/main/java/org/apache/cayenne/profile/cases/DeleteCase.java?rev=408130&r1=408129&r2=408130&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne-regression-profiler/src/main/java/org/apache/cayenne/profile/cases/DeleteCase.java
(original)
+++ incubator/cayenne/main/trunk/cayenne-regression-profiler/src/main/java/org/apache/cayenne/profile/cases/DeleteCase.java
Sat May 20 21:16:27 2006
@@ -29,7 +29,6 @@
             DataContext context,
             HttpServletRequest request,
             HttpServletResponse response) {
-
         context
                 .performGenericQuery(new SQLTemplate(Entity1.class, "delete from ENTITY1"));
     }

Modified: incubator/cayenne/main/trunk/cayenne-regression-profiler/src/main/java/org/apache/cayenne/profile/cases/SelectCase.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/cayenne-regression-profiler/src/main/java/org/apache/cayenne/profile/cases/SelectCase.java?rev=408130&r1=408129&r2=408130&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne-regression-profiler/src/main/java/org/apache/cayenne/profile/cases/SelectCase.java
(original)
+++ incubator/cayenne/main/trunk/cayenne-regression-profiler/src/main/java/org/apache/cayenne/profile/cases/SelectCase.java
Sat May 20 21:16:27 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/trunk/cayenne-regression-profiler/src/main/java/org/apache/cayenne/profile/servlet/AbstractCase.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/cayenne-regression-profiler/src/main/java/org/apache/cayenne/profile/servlet/AbstractCase.java?rev=408130&r1=408129&r2=408130&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne-regression-profiler/src/main/java/org/apache/cayenne/profile/servlet/AbstractCase.java
(original)
+++ incubator/cayenne/main/trunk/cayenne-regression-profiler/src/main/java/org/apache/cayenne/profile/servlet/AbstractCase.java
Sat May 20 21:16:27 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/trunk/cayenne-regression-profiler/src/main/java/org/apache/cayenne/profile/servlet/ProfileFilter.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/cayenne-regression-profiler/src/main/java/org/apache/cayenne/profile/servlet/ProfileFilter.java?rev=408130&r1=408129&r2=408130&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne-regression-profiler/src/main/java/org/apache/cayenne/profile/servlet/ProfileFilter.java
(original)
+++ incubator/cayenne/main/trunk/cayenne-regression-profiler/src/main/java/org/apache/cayenne/profile/servlet/ProfileFilter.java
Sat May 20 21:16:27 2006
@@ -40,9 +40,18 @@
     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
@@ -53,6 +62,9 @@
             cayenneVersion = "unknown";
         }
         logger.info("Started Cayenne version - '" + cayenneVersion + "'");
+        if(deletedOldDb) {
+            logger.info("deleted old database");
+        }
 
         // create fresh database
         DataDomain domain = Configuration.getSharedConfiguration().getDomain();



Mime
View raw message