[jbpm-commits] JBoss JBPM SVN: r7063 - in jbpm3/branches/jbpm-3.2-soa/core/src/test: resources/org/jbpm/jbpm3235 and 1 other directory.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Feb 21 21:22:56 EST 2012


Author: marco.rietveld
Date: 2012-02-21 21:22:55 -0500 (Tue, 21 Feb 2012)
New Revision: 7063

Added:
   jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/jbpm3235/hibernate.hsql.properties
   jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/jbpm3235/spy.properties
Removed:
   jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/jbpm3235/spy.properties
Modified:
   jbpm3/branches/jbpm-3.2-soa/core/src/test/java/org/jbpm/jbpm3235/JBPM3235Test.java
   jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/jbpm3235/hibernate.postgresql.properties
Log:
Refactored because of JBPM-3430

Modified: jbpm3/branches/jbpm-3.2-soa/core/src/test/java/org/jbpm/jbpm3235/JBPM3235Test.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/core/src/test/java/org/jbpm/jbpm3235/JBPM3235Test.java	2012-02-22 02:17:23 UTC (rev 7062)
+++ jbpm3/branches/jbpm-3.2-soa/core/src/test/java/org/jbpm/jbpm3235/JBPM3235Test.java	2012-02-22 02:22:55 UTC (rev 7063)
@@ -21,12 +21,15 @@
  */
 package org.jbpm.jbpm3235;
 
-import java.util.ArrayList;
+import java.text.SimpleDateFormat;
 import java.util.Calendar;
-import java.util.Collection;
 import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
 
+import org.hibernate.Query;
 import org.hibernate.cfg.Configuration;
+import org.hibernate.cfg.Environment;
 import org.jbpm.db.AbstractDbTestCase;
 import org.jbpm.db.JobSession;
 import org.jbpm.db.hibernate.HibernateHelper;
@@ -36,6 +39,7 @@
 import org.jbpm.job.ExecuteActionJob;
 import org.jbpm.job.Job;
 import org.jbpm.persistence.db.DbPersistenceServiceFactory;
+import org.jbpm.svc.Services;
 
 /**
  * JobSession.getFirstDueJob was not performing due to the queries having to sort the duedate field without an index. 
@@ -49,6 +53,7 @@
   private long[] monitoredJobIds = null;
  
   private String postgresDatabaseProperties = "org/jbpm/jbpm3235/hibernate.postgresql.properties";
+  private String hsqlDatabaseProperties = "org/jbpm/jbpm3235/hibernate.hsql.properties";
   /** 
    * Feel free to make your own database properties file 
    *  and fill it appropriately: see the above file for necessary fields.
@@ -57,21 +62,26 @@
    */
 
   // Number of rows to add to the Job table
-  private int numJobsToAdd = 5000;
+  private int numJobsToAdd = 10;
 
   // Make sure this test does not run in Hudson
-  private boolean thisIsAnAutomatedTest = true;
-  private boolean startWithCleanDatabase = true;
-  private boolean cleanDatabaseAfterTest = true;
+  private boolean thisIsAnAutomatedTest = false;
+  private boolean startWithCleanDatabase = false;
+  private boolean cleanDatabaseAfterTest = false;
   
+  private boolean usingHSQLDB = false;
+  
   /**
    * Setup the test case.
    */
   protected void setUp() throws Exception {
     if( thisIsAnAutomatedTest ) return;
     
+    DbPersistenceServiceFactory persistenceServiceFactory = (DbPersistenceServiceFactory) getJbpmConfiguration().getServiceFactory(Services.SERVICENAME_PERSISTENCE);
+    String dialect = persistenceServiceFactory.getConfiguration().getProperty(Environment.DIALECT);
+    
     setUpDatabase();
-    if( startWithCleanDatabase ) { 
+    if( startWithCleanDatabase && ! usingHSQLDB ) { 
       ensureCleanDatabase();
     }
     super.setUp();
@@ -81,12 +91,18 @@
   }
 
   private void setUpDatabase() {
-    String hibernateCfgXmlResource = null;
-    String propertiesResource = postgresDatabaseProperties;
-
+    String propertiesResource = null;
+    if (usingHSQLDB) { 
+      propertiesResource = hsqlDatabaseProperties;
+    }
+    else { 
+      propertiesResource = postgresDatabaseProperties;
+    }
+    
     // Ensure that the hibernate session uses the properties we configured (see propertiesResource above)
-    DbPersistenceServiceFactory persistenceServiceFactory = (DbPersistenceServiceFactory) getJbpmConfiguration().getServiceFactory("persistence");
-    Configuration configuration = HibernateHelper.createConfiguration(hibernateCfgXmlResource, propertiesResource);
+    Configuration configuration = HibernateHelper.createConfiguration(null, propertiesResource);
+    
+    DbPersistenceServiceFactory persistenceServiceFactory = (DbPersistenceServiceFactory) getJbpmConfiguration().getServiceFactory(Services.SERVICENAME_PERSISTENCE);
     persistenceServiceFactory.setConfiguration(configuration);
   }
 
@@ -95,7 +111,8 @@
    */
   protected void tearDown() throws Exception {
     if( thisIsAnAutomatedTest ) { return; }
-    if( cleanDatabaseAfterTest ) {
+    
+    if( cleanDatabaseAfterTest && ! usingHSQLDB ) {
       ensureCleanDatabase();
       deleteProcessDefinitions(); 
     }
@@ -108,37 +125,49 @@
   // ACTUAL TESTS
   //
 
-  public void testFirstDueJobQueries() {
+  private SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss.SSS yyyy-MM-dd");
+  private boolean debug = false;
+  public void testQueries() {
     if( thisIsAnAutomatedTest ) { return; } 
-    // This test has to do with the performance on an actual DB
-    // (not that Hypersonic _isn't_, but.. you know what I mean!
-    if (getHibernateDialect().indexOf("HSQL") != -1) { return; }
 
     addJobsToDb();
 
     JobSession jobSession = jbpmContext.getJobSession();
-    Job result = null;
 
+    if( debug ) { 
+      Query query = session.createQuery("select job from org.jbpm.job.Job job");
+      List jobList = query.list();
+      assertTrue( "WTF!?!", jobList.size() > 0 );
+    
+      Iterator iter = jobList.iterator();
+      while( iter.hasNext() ) { 
+        Job job = (Job) iter.next();
+        log.info("RET: [" + job.getLockOwner() + "/" + job.getRetries() + "]: " + sdf.format(job.getDueDate()) );
+      }
+    }
+    
     // Query: JobSession.getFirstUnownedDueJob
-    result = jobSession.getFirstDueJob(null, null);
-    assertTrue(result != null);
-
-    // Query: JobSession.getFirstDueJob
-    String lockOwner = PROCESS_NAME;
-    result = jobSession.getFirstDueJob(lockOwner, null);
-    assertTrue(result != null);
-
-    // Query: JobSession.getFirstDueJobExcludingMonitoredJobs
-    Collection monitoredJobs = new ArrayList(numJobsToAdd/2);
-    for (int i = 0; i < monitoredJobIds.length / 2; ++i) {
-      monitoredJobs.add(new Long(monitoredJobIds[i]));
+    Date wakeUpDate = new Date();
+    log.trace( "Wake Up Date: " + sdf.format(wakeUpDate) );
+    Date nextDueDate = null;
+    if( ! debug ) { 
+      nextDueDate = jobSession.getNextUnownedDueJobDueDate(wakeUpDate);
     }
-    result = jobSession.getFirstDueJob(lockOwner, monitoredJobs);
-    assertTrue(result != null);
-
-    // Query: JobSession.getFirstDueJobExcludingMonitoredJobs WITH NULL LockOwner
-    result = jobSession.getFirstDueJob(null, monitoredJobs);
-    assertTrue(result != null);
+    else { 
+      Query query = session.getNamedQuery("JobSession.getNextUnownedDueJobDueDate") .setTimestamp("wakeUpDate", wakeUpDate);
+      List dateList = query.list();
+      assertTrue( "No Dates!!?!", dateList.size() > 0 );
+      assertTrue( "TOO MANY Dates!!?!", dateList.size() > 1 );
+      
+      nextDueDate = (Date) dateList.get(0);
+      Iterator iter = dateList.iterator();
+      while( iter.hasNext() ) { 
+          Date ndt = (Date) iter.next();  
+          log.info( "- ndt: " + sdf.format(ndt));
+      }
+    }
+    assertTrue("Next due date was NOT found!!", nextDueDate != null);
+    log.info( "Next Due Date: " + sdf.format(nextDueDate) );
   }
 
   protected void addJobsToDb() {
@@ -148,7 +177,7 @@
     Token rootToken = processInstance.getRootToken();
     int i = 0;
     for (; i < (numJobsToAdd/2); ++i) {
-      jobs[i] = createJob(rootToken, null, i);
+      jobs[i] = createJob(rootToken, i);
       jbpmContext.getJobSession().saveJob(jobs[i]);
     }
     for (; i < numJobsToAdd; ++i) {
@@ -164,14 +193,31 @@
     }
   }
 
+  /**
+   *  select min(job.dueDate)
+   *    from org.jbpm.job.Job job
+   *   where job.dueDate <= :wakeUpDate
+   *     and job.lockOwner is null
+   *     and job.retries > 0
+   *     and job.isSuspended = false
+   */
+  private Job createJob(Token token, int i) {
+    return  createJob(token, null, i);
+  }
+  
   private Job createJob(Token token, String lockOwner, int i) {
     Job job = new ExecuteActionJob(token);
 
     // Add information used for querying
     job.setLockOwner(lockOwner);
+    job.setRetries(i+1);
+    job.setSuspended(false);
 
     // Fields used in query for sorting
     job.setDueDate(getOneHourAgoMinus(i));
+    if( debug ) { 
+      log.info("Job [" + lockOwner + "/" + job.getRetries() + "]: " + sdf.format(job.getDueDate()) );
+    }
 
     // Other fields
     job.setException("Simulated Exception");
@@ -181,6 +227,7 @@
   }
   
   
+  
   private Date getOneHourAgoMinus(int seconds) {
     Calendar calendar = Calendar.getInstance();
     calendar.add(Calendar.HOUR, -1);

Added: jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/jbpm3235/hibernate.hsql.properties
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/jbpm3235/hibernate.hsql.properties	                        (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/jbpm3235/hibernate.hsql.properties	2012-02-22 02:22:55 UTC (rev 7063)
@@ -0,0 +1,11 @@
+# hibernate.connection.driver_class=org.hsqldb.Driver
+hibernate.connection.driver_class=com.p6spy.engine.spy.P6SpyDriver
+
+hibernate.dialect=org.hibernate.dialect.HSQLDialect
+hibernate.connection.url=jdbc\:hsqldb\:.
+hibernate.connection.username=sa
+hibernate.connection.password=
+
+hibernate.hbm2ddl.auto=create
+hibernate.show_sql=false
+


Property changes on: jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/jbpm3235/hibernate.hsql.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native

Modified: jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/jbpm3235/hibernate.postgresql.properties
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/jbpm3235/hibernate.postgresql.properties	2012-02-22 02:17:23 UTC (rev 7062)
+++ jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/jbpm3235/hibernate.postgresql.properties	2012-02-22 02:22:55 UTC (rev 7063)
@@ -1,7 +1,8 @@
-hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
 
 # hibernate.connection.driver_class=org.postgresql.Driver
 hibernate.connection.driver_class=com.p6spy.engine.spy.P6SpyDriver
+
+hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
 hibernate.connection.url=jdbc\:postgresql\://localhost\:5432/jbpm3
 hibernate.connection.username=jbpm3
 hibernate.connection.password=jbpm3

Deleted: jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/jbpm3235/spy.properties
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/jbpm3235/spy.properties	2012-02-22 02:17:23 UTC (rev 7062)
+++ jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/jbpm3235/spy.properties	2012-02-22 02:22:55 UTC (rev 7063)
@@ -1,249 +0,0 @@
-#################################################################
-# P6Spy 2.0-SNAPSHOT Options File                               #
-# See documentation for detailed instructions                   #
-#                                                               #
-# PLACE IN src/test/resources when using!!!                     #
-#                                                               #
-#################################################################
-
-#################################################################
-# MODULES                                                       #
-#                                                               #
-# Modules provide the P6Spy functionality.  If a module, such   #
-# as module_log is commented out, that functionality will not   #
-# be available.  If it is not commented out (if it is active),  #
-# the functionality will be active.                             #
-#                                                               #
-# Values set in Modules cannot be reloaded using the            #
-# reloadproperties variable.  Once they are loaded, they remain #
-# in memory until the application is restarted.                 #
-#                                                               #
-#################################################################
-
-module.log=com.p6spy.engine.logging.P6LogFactory
-#module.outage=com.p6spy.engine.outage.P6OutageFactory
-
-#################################################################
-# REALDRIVER(s)                                                 #
-#                                                               #
-# In your application server configuration file you replace the #
-# "real driver" name with com.p6spy.engine.spy.P6SpyDriver. This#
-# is where you put the name of your real driver P6Spy can find  #
-# and register your real driver to do the database work.        #
-#                                                               #
-# If your application uses several drivers specify them in      #
-# realdriver2, realdriver3.  See the documentation for more     #
-# details.                                                      #
-#                                                               #
-# Values set in REALDRIVER(s) cannot be reloaded using the      #
-# reloadproperties variable.  Once they are loaded, they remain #
-# in memory until the application is restarted.                 #
-#                                                               #
-#################################################################
-
-# oracle driver
-# realdriver=oracle.jdbc.driver.OracleDriver
-
-# mysql Connector/J driver
-# realdriver=com.mysql.jdbc.Driver
-
-# informix driver
-# realdriver=com.informix.jdbc.IfxDriver
-
-# ibm db2 driver
-# realdriver=COM.ibm.db2.jdbc.net.DB2Driver
-
-# the mysql open source driver
-realdriver=org.postgresql.Driver
-
-#specifies another driver to use
-realdriver2=
-#specifies a third driver to use
-realdriver3=
-
-
-#the DriverManager class sequentially tries every driver that is
-#registered to find the right driver.  In some instances, it's possible to
-#load up the realdriver before the p6spy driver, in which case your connections
-#will not get wrapped as the realdriver will "steal" the connection before
-#p6spy sees it.  Set the following property to "true" to cause p6spy to
-#explicitily deregister the realdrivers
-deregisterdrivers=true
-
-################################################################
-# P6LOG SPECIFIC PROPERTIES                                    #
-################################################################
-# no properties currently available
-
-################################################################
-# EXECUTION THRESHOLD PROPERTIES                               #
-################################################################
-# This feature applies to the standard logging of P6Spy.       # 
-# While the standard logging logs out every statement          #
-# regardless of its execution time, this feature puts a time   # 
-# condition on that logging.  Only statements that have taken  # 
-# longer than the time specified (in milliseconds) will be     #
-# logged.  This way it is possible to see only statements that #
-# have exceeded some high water mark.                          #
-# This time is reloadable.                                     #
-#
-# executionthreshold=integer time (milliseconds)
-#
-executionthreshold=
-
-################################################################
-# P6OUTAGE SPECIFIC PROPERTIES                                 #
-################################################################
-# Outage Detection
-#
-# This feature detects long-running statements that may be indicative of
-# a database outage problem. If this feature is turned on, it will log any
-# statement that surpasses the configurable time boundary during its execution.
-# When this feature is enabled, no other statements are logged except the long
-# running statements. The interval property is the boundary time set in seconds.
-# For example, if this is set to 2, then any statement requiring at least 2 
-# seconds will be logged. Note that the same statement will continue to be logged
-# for as long as it executes. So if the interval is set to 2, and the query takes
-# 11 seconds, it will be logged 5 times (at the 2, 4, 6, 8, 10 second intervals).
-#
-# outagedetection=true|false
-# outagedetectioninterval=integer time (seconds)
-#
-outagedetection=false
-outagedetectioninterval=
-
-################################################################
-# COMMON PROPERTIES                                            #
-################################################################
-
-# filter what is logged
-filter=false
-
-# comma separated list of tables to include when filtering
-include     = 
-# comma separated list of tables to exclude when filtering
-exclude     =
-
-# sql expression to evaluate if using regex filtering
-sqlexpression = 
-
-
-# turn on tracing
-autoflush   = true
-
-# sets the date format using Java's SimpleDateFormat routine
-dateformat=yy.MM.dd HH:mm:ss
-
-#list of categories to explicitly include 
-includecategories=
-
-#list of categories to exclude: error, info, batch, debug, statement, resultset
-#commit, rollback and result are valid values
-excludecategories=info,debug,result,batch
-
-
-#allows you to use a regex engine or your own matching engine to determine 
-#which statements to log
-#
-#stringmatcher=com.p6spy.engine.common.GnuRegexMatcher
-#stringmatcher=com.p6spy.engine.common.JakartaRegexMatcher
-stringmatcher=
-
-# prints a stack trace for every statement logged
-stacktrace=false
-# if stacktrace=true, specifies the stack trace to print
-stacktraceclass=
-
-# determines if property file should be reloaded
-reloadproperties=false
-# determines how often should be reloaded in seconds
-reloadpropertiesinterval=60
-
-#if=true then url must be prefixed with p6spy:
-useprefix=false
-
-#specifies the appender to use for logging
-#appender=com.p6spy.engine.logging.appender.Log4jLogger
-#appender=com.p6spy.engine.logging.appender.StdoutLogger
-appender=com.p6spy.engine.logging.appender.StdoutLogger
-
-# name of logfile to use, note Windows users should make sure to use forward slashes in their pathname (e:/test/spy.log) (used for file logger only)
-logfile     = spy.log
-
-# append to  the p6spy log file.  if this is set to false the
-# log file is truncated every time.  (file logger only)
-append=true
-
-#The following are for log4j logging only
-log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender
-log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout
-log4j.appender.STDOUT.layout.ConversionPattern=p6spy - %m%n
-
-#log4j.appender.CHAINSAW_CLIENT=org.apache.log4j.net.SocketAppender
-#log4j.appender.CHAINSAW_CLIENT.RemoteHost=localhost
-#log4j.appender.CHAINSAW_CLIENT.Port=4445
-#log4j.appender.CHAINSAW_CLIENT.LocationInfo=true
-
-log4j.logger.p6spy=INFO,STDOUT
-
-
-#################################################################
-# DataSource replacement                                        #
-#                                                               #
-# Replace the real DataSource class in your application server  #
-# configuration with the name com.p6spy.engine.spy.P6DataSource,#
-# then add the JNDI name and class name of the real     #
-# DataSource here                     #
-#                                                               #
-# Values set in this item cannot be reloaded using the          #
-# reloadproperties variable.  Once it is loaded, it remains     #
-# in memory until the application is restarted.                 #
-#                                                               #
-#################################################################
-#realdatasource=/RealMySqlDS
-#realdatasourceclass=com.mysql.jdbc.jdbc2.optional.MysqlDataSource
-
-#################################################################
-# DataSource properties                                         #
-#                                                               #
-# If you are using the DataSource support to intercept calls    # 
-# to a DataSource that requires properties for proper setup,    #
-# define those properties here. Use name value pairs, separate  #
-# the name and value with a semicolon, and separate the         #
-# pairs with commas.                                            #
-#                                   #
-# The example shown here is for mysql                           #
-#                                                               #
-#################################################################
-#realdatasourceproperties=port;3306,serverName;ibmhost,databaseName;mydb
-
-
-#################################################################
-# JNDI DataSource lookup                                        #
-#                                                               #
-# If you are using the DataSource support outside of an app     #
-# server, you will probably need to define the JNDI Context     #
-# environment.                                                  #
-#                                                               #
-# If the P6Spy code will be executing inside an app server then #
-# do not use these properties, and the DataSource lookup will   #
-# use the naming context defined by the app server.             #
-#                                                               #
-# The two standard elements of the naming environment are #
-# jndicontextfactory and jndicontextproviderurl. If you need    #
-# additional elements, use the jndicontextcustom property.      #
-# You can define multiple properties in jndicontextcustom,      #
-# in name value pairs. Separate the name and value with a       #
-# semicolon, and separate the pairs with commas.                #
-#                                                               #
-# The example shown here is for a standalone program running on #
-# a machine that is also running JBoss, so the JDNI context     #
-# is configured for JBoss (3.0.4).                              #
-#                                                               #
-#################################################################
-#jndicontextfactory=org.jnp.interfaces.NamingContextFactory
-#jndicontextproviderurl=localhost:1099
-#jndicontextcustom=java.naming.factory.url.pkgs;org.jboss.nameing:org.jnp.interfaces
-
-#jndicontextfactory=com.ibm.websphere.naming.WsnInitialContextFactory
-#jndicontextproviderurl=iiop://localhost:900

Added: jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/jbpm3235/spy.properties
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/jbpm3235/spy.properties	                        (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/jbpm3235/spy.properties	2012-02-22 02:22:55 UTC (rev 7063)
@@ -0,0 +1,249 @@
+#################################################################
+# P6Spy 2.0-SNAPSHOT Options File                               #
+# See documentation for detailed instructions                   #
+#                                                               #
+# PLACE IN src/test/resources when using!!!                     #
+#                                                               #
+#################################################################
+
+#################################################################
+# MODULES                                                       #
+#                                                               #
+# Modules provide the P6Spy functionality.  If a module, such   #
+# as module_log is commented out, that functionality will not   #
+# be available.  If it is not commented out (if it is active),  #
+# the functionality will be active.                             #
+#                                                               #
+# Values set in Modules cannot be reloaded using the            #
+# reloadproperties variable.  Once they are loaded, they remain #
+# in memory until the application is restarted.                 #
+#                                                               #
+#################################################################
+
+module.log=com.p6spy.engine.logging.P6LogFactory
+#module.outage=com.p6spy.engine.outage.P6OutageFactory
+
+#################################################################
+# REALDRIVER(s)                                                 #
+#                                                               #
+# In your application server configuration file you replace the #
+# "real driver" name with com.p6spy.engine.spy.P6SpyDriver. This#
+# is where you put the name of your real driver P6Spy can find  #
+# and register your real driver to do the database work.        #
+#                                                               #
+# If your application uses several drivers specify them in      #
+# realdriver2, realdriver3.  See the documentation for more     #
+# details.                                                      #
+#                                                               #
+# Values set in REALDRIVER(s) cannot be reloaded using the      #
+# reloadproperties variable.  Once they are loaded, they remain #
+# in memory until the application is restarted.                 #
+#                                                               #
+#################################################################
+
+# oracle driver
+# realdriver=oracle.jdbc.driver.OracleDriver
+
+# mysql Connector/J driver
+# realdriver=com.mysql.jdbc.Driver
+
+# informix driver
+# realdriver=com.informix.jdbc.IfxDriver
+
+# ibm db2 driver
+# realdriver=COM.ibm.db2.jdbc.net.DB2Driver
+
+# the mysql open source driver
+realdriver=org.postgresql.Driver
+
+#specifies another driver to use
+realdriver2=
+#specifies a third driver to use
+realdriver3=
+
+
+#the DriverManager class sequentially tries every driver that is
+#registered to find the right driver.  In some instances, it's possible to
+#load up the realdriver before the p6spy driver, in which case your connections
+#will not get wrapped as the realdriver will "steal" the connection before
+#p6spy sees it.  Set the following property to "true" to cause p6spy to
+#explicitily deregister the realdrivers
+deregisterdrivers=true
+
+################################################################
+# P6LOG SPECIFIC PROPERTIES                                    #
+################################################################
+# no properties currently available
+
+################################################################
+# EXECUTION THRESHOLD PROPERTIES                               #
+################################################################
+# This feature applies to the standard logging of P6Spy.       # 
+# While the standard logging logs out every statement          #
+# regardless of its execution time, this feature puts a time   # 
+# condition on that logging.  Only statements that have taken  # 
+# longer than the time specified (in milliseconds) will be     #
+# logged.  This way it is possible to see only statements that #
+# have exceeded some high water mark.                          #
+# This time is reloadable.                                     #
+#
+# executionthreshold=integer time (milliseconds)
+#
+executionthreshold=
+
+################################################################
+# P6OUTAGE SPECIFIC PROPERTIES                                 #
+################################################################
+# Outage Detection
+#
+# This feature detects long-running statements that may be indicative of
+# a database outage problem. If this feature is turned on, it will log any
+# statement that surpasses the configurable time boundary during its execution.
+# When this feature is enabled, no other statements are logged except the long
+# running statements. The interval property is the boundary time set in seconds.
+# For example, if this is set to 2, then any statement requiring at least 2 
+# seconds will be logged. Note that the same statement will continue to be logged
+# for as long as it executes. So if the interval is set to 2, and the query takes
+# 11 seconds, it will be logged 5 times (at the 2, 4, 6, 8, 10 second intervals).
+#
+# outagedetection=true|false
+# outagedetectioninterval=integer time (seconds)
+#
+outagedetection=false
+outagedetectioninterval=
+
+################################################################
+# COMMON PROPERTIES                                            #
+################################################################
+
+# filter what is logged
+filter=false
+
+# comma separated list of tables to include when filtering
+include     = 
+# comma separated list of tables to exclude when filtering
+exclude     =
+
+# sql expression to evaluate if using regex filtering
+sqlexpression = 
+
+
+# turn on tracing
+autoflush   = true
+
+# sets the date format using Java's SimpleDateFormat routine
+dateformat=yy.MM.dd HH:mm:ss
+
+#list of categories to explicitly include 
+includecategories=
+
+#list of categories to exclude: error, info, batch, debug, statement, resultset
+#commit, rollback and result are valid values
+excludecategories=info,debug,result,batch
+
+
+#allows you to use a regex engine or your own matching engine to determine 
+#which statements to log
+#
+#stringmatcher=com.p6spy.engine.common.GnuRegexMatcher
+#stringmatcher=com.p6spy.engine.common.JakartaRegexMatcher
+stringmatcher=
+
+# prints a stack trace for every statement logged
+stacktrace=false
+# if stacktrace=true, specifies the stack trace to print
+stacktraceclass=
+
+# determines if property file should be reloaded
+reloadproperties=false
+# determines how often should be reloaded in seconds
+reloadpropertiesinterval=60
+
+#if=true then url must be prefixed with p6spy:
+useprefix=false
+
+#specifies the appender to use for logging
+#appender=com.p6spy.engine.logging.appender.Log4jLogger
+#appender=com.p6spy.engine.logging.appender.StdoutLogger
+appender=com.p6spy.engine.logging.appender.StdoutLogger
+
+# name of logfile to use, note Windows users should make sure to use forward slashes in their pathname (e:/test/spy.log) (used for file logger only)
+logfile     = spy.log
+
+# append to  the p6spy log file.  if this is set to false the
+# log file is truncated every time.  (file logger only)
+append=true
+
+#The following are for log4j logging only
+log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender
+log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout
+log4j.appender.STDOUT.layout.ConversionPattern=p6spy - %m%n
+
+#log4j.appender.CHAINSAW_CLIENT=org.apache.log4j.net.SocketAppender
+#log4j.appender.CHAINSAW_CLIENT.RemoteHost=localhost
+#log4j.appender.CHAINSAW_CLIENT.Port=4445
+#log4j.appender.CHAINSAW_CLIENT.LocationInfo=true
+
+log4j.logger.p6spy=INFO,STDOUT
+
+
+#################################################################
+# DataSource replacement                                        #
+#                                                               #
+# Replace the real DataSource class in your application server  #
+# configuration with the name com.p6spy.engine.spy.P6DataSource,#
+# then add the JNDI name and class name of the real     #
+# DataSource here                     #
+#                                                               #
+# Values set in this item cannot be reloaded using the          #
+# reloadproperties variable.  Once it is loaded, it remains     #
+# in memory until the application is restarted.                 #
+#                                                               #
+#################################################################
+#realdatasource=/RealMySqlDS
+#realdatasourceclass=com.mysql.jdbc.jdbc2.optional.MysqlDataSource
+
+#################################################################
+# DataSource properties                                         #
+#                                                               #
+# If you are using the DataSource support to intercept calls    # 
+# to a DataSource that requires properties for proper setup,    #
+# define those properties here. Use name value pairs, separate  #
+# the name and value with a semicolon, and separate the         #
+# pairs with commas.                                            #
+#                                   #
+# The example shown here is for mysql                           #
+#                                                               #
+#################################################################
+#realdatasourceproperties=port;3306,serverName;ibmhost,databaseName;mydb
+
+
+#################################################################
+# JNDI DataSource lookup                                        #
+#                                                               #
+# If you are using the DataSource support outside of an app     #
+# server, you will probably need to define the JNDI Context     #
+# environment.                                                  #
+#                                                               #
+# If the P6Spy code will be executing inside an app server then #
+# do not use these properties, and the DataSource lookup will   #
+# use the naming context defined by the app server.             #
+#                                                               #
+# The two standard elements of the naming environment are #
+# jndicontextfactory and jndicontextproviderurl. If you need    #
+# additional elements, use the jndicontextcustom property.      #
+# You can define multiple properties in jndicontextcustom,      #
+# in name value pairs. Separate the name and value with a       #
+# semicolon, and separate the pairs with commas.                #
+#                                                               #
+# The example shown here is for a standalone program running on #
+# a machine that is also running JBoss, so the JDNI context     #
+# is configured for JBoss (3.0.4).                              #
+#                                                               #
+#################################################################
+#jndicontextfactory=org.jnp.interfaces.NamingContextFactory
+#jndicontextproviderurl=localhost:1099
+#jndicontextcustom=java.naming.factory.url.pkgs;org.jboss.nameing:org.jnp.interfaces
+
+#jndicontextfactory=com.ibm.websphere.naming.WsnInitialContextFactory
+#jndicontextproviderurl=iiop://localhost:900


Property changes on: jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/jbpm3235/spy.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native



More information about the jbpm-commits mailing list