Revision: 196
http://polepos.svn.sourceforge.net/polepos/?rev=196&view=rev
Author: carlrosenberger
Date: 2011-03-07 14:07:04 +0000 (Mon, 07 Mar 2011)
Log Message:
-----------
cr + pr: Added functionality to set Settings.isDebug() and Settings.isConcurrency in a
system property.
Modified Paths:
--------------
trunk/polepos/build.xml
trunk/polepos/src/org/polepos/RunSeason.java
trunk/polepos/src/org/polepos/Settings.java
trunk/polepos/src/org/polepos/framework/DriverBase.java
trunk/polepos/src/org/polepos/teams/jdbc/JdbcDriver.java
Added Paths:
-----------
trunk/polepos/src/org/polepos/framework/ArraysP.java
Modified: trunk/polepos/build.xml
===================================================================
--- trunk/polepos/build.xml 2011-03-03 14:54:59 UTC (rev 195)
+++ trunk/polepos/build.xml 2011-03-07 14:07:04 UTC (rev 196)
@@ -49,7 +49,8 @@
<!-- <target name="race" depends="clean,compile,jdoenhance,jvienhance,jpaenhance" description="runs with all circuits and all teams "> -->
<target name="race" depends="clean,compile,jdoenhance" description="runs with all circuits and all teams ">
- <java classname="org.polepos.RunSeason" fork="true" >
+ <echo message="${polepos.debug}" />
+ <java classname="org.polepos.RunSeason" fork="true" >
<classpath>
<pathelement location="bin" />
<fileset dir="lib">
@@ -57,6 +58,9 @@
</fileset>
</classpath>
<jvmarg value="-Xmx1g"/>
+ <sysproperty key="polepos.debug" value="${polepos.debug}" />
+ <sysproperty key="polepos.concurrency" value="${polepos.concurrency}" />
+
</java>
</target>
Modified: trunk/polepos/src/org/polepos/RunSeason.java
===================================================================
--- trunk/polepos/src/org/polepos/RunSeason.java 2011-03-03 14:54:59 UTC (rev 195)
+++ trunk/polepos/src/org/polepos/RunSeason.java 2011-03-07 14:07:04 UTC (rev 196)
@@ -42,6 +42,8 @@
import org.polepos.teams.jpa.*;
import org.polepos.teams.jvi.*;
+import com.db4o.foundation.*;
+
/**
* This is the Main class to run PolePosition. If JDO, JPA and JVI are
* to be tested also, persistent classes have to be enhanced first.
@@ -59,17 +61,15 @@
@Override
public Circuit[] circuits() {
+ return ArraysP.concat(defaultCircuits(), concurrencyCircuits());
+ }
+
+ private Circuit[] defaultCircuits(){
return new Circuit[] {
-
new ReflectiveCircuitBase(Complex.class),
new ReflectiveCircuitBase(NestedLists.class),
new ReflectiveCircuitBase(InheritanceHierarchy.class),
new ReflectiveCircuitBase(FlatObject.class),
-
-// new ComplexConcurrency(),
-// new QueryCentricConcurrency(),
-// new InsertCentricConcurrency(),
-
// new Trees(),
// new NativeIds(),
// new Commits(),
@@ -78,12 +78,20 @@
};
}
-
+ private Circuit[] concurrencyCircuits() {
+ if(! Settings.isConcurrency()){
+ return new Circuit[] {};
+ }
+ return new Circuit[] {
+ new ComplexConcurrency(),
+ new QueryCentricConcurrency(),
+ new InsertCentricConcurrency(),
+ };
+ }
@Override
public Team[] teams() {
return new Team[] {
-
new Db4oTeam(),
new JdoTeam(),
// new Db4oClientServerTeam(),
@@ -91,9 +99,8 @@
new HibernateTeam(),
// new JpaTeam(),
-
- // new JviTeam(),
- // new CobraTeam(),
+// new JviTeam(),
+// new CobraTeam(),
};
}
Modified: trunk/polepos/src/org/polepos/Settings.java
===================================================================
--- trunk/polepos/src/org/polepos/Settings.java 2011-03-03 14:54:59 UTC (rev 195)
+++ trunk/polepos/src/org/polepos/Settings.java 2011-03-07 14:07:04 UTC (rev 196)
@@ -22,22 +22,34 @@
public class Settings {
- public static boolean DEBUG = false;
+ private static boolean DEBUG = false;
- public static final String CIRCUIT = DEBUG ? "settings/DebugCircuits.properties" : "settings/Circuits.properties" ;
+ private static boolean CONCURRENCY = false;
+ public static final String CIRCUIT = isDebug() ? "settings/DebugCircuits.properties" : "settings/Circuits.properties" ;
+
public static final String JDBC = "settings/Jdbc.properties";
public static final String JDO = "settings/Jdo.properties";
- static{
-
+ public static boolean isDebug(){
+ String debug = System.getProperty("polepos.debug");
+ if(debug != null){
+ return Boolean.parseBoolean(debug);
+ }
String className = Settings.class.getName() ;
-
if(DEBUG){
System.out.println(className + ".DEBUG is set to true.\n");
}
-
+ return DEBUG;
}
+
+ public static boolean isConcurrency(){
+ String concurrency = System.getProperty("polepos.concurrency");
+ if(concurrency != null){
+ return Boolean.parseBoolean(concurrency);
+ }
+ return CONCURRENCY;
+ }
}
Added: trunk/polepos/src/org/polepos/framework/ArraysP.java
===================================================================
--- trunk/polepos/src/org/polepos/framework/ArraysP.java (rev 0)
+++ trunk/polepos/src/org/polepos/framework/ArraysP.java 2011-03-07 14:07:04 UTC (rev 196)
@@ -0,0 +1,32 @@
+/*
+This file is part of the PolePosition database benchmark
+http://www.polepos.org
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public
+License along with this program; if not, write to the Free
+Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+MA 02111-1307, USA. */
+
+
+package org.polepos.framework;
+
+public class ArraysP {
+
+ public static Circuit[] concat(Circuit[] a, Circuit[] b){
+ Circuit [] result = new Circuit[a.length + b.length];
+ System.arraycopy(a, 0, result, 0, a.length);
+ System.arraycopy(b, 0, result, a.length, b.length);
+ return result;
+ }
+
+}
Property changes on: trunk/polepos/src/org/polepos/framework/ArraysP.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/polepos/src/org/polepos/framework/DriverBase.java
===================================================================
--- trunk/polepos/src/org/polepos/framework/DriverBase.java 2011-03-03 14:54:59 UTC (rev 195)
+++ trunk/polepos/src/org/polepos/framework/DriverBase.java 2011-03-07 14:07:04 UTC (rev 196)
@@ -120,7 +120,7 @@
try {
method.invoke(DriverBase.this, (Object[]) null);
} catch (Exception e) {
- if(Settings.DEBUG){
+ if(Settings.isDebug()){
throw new RuntimeException(e);
}
e.printStackTrace();
@@ -131,7 +131,7 @@
try{
return DriverBase.this.getClass().getDeclaredMethod(lap.name(), (Class[])null);
} catch (Exception e) {
- if(Settings.DEBUG){
+ if(Settings.isDebug()){
throw new RuntimeException(e);
}
e.printStackTrace();
Modified: trunk/polepos/src/org/polepos/teams/jdbc/JdbcDriver.java
===================================================================
--- trunk/polepos/src/org/polepos/teams/jdbc/JdbcDriver.java 2011-03-03 14:54:59 UTC (rev 195)
+++ trunk/polepos/src/org/polepos/teams/jdbc/JdbcDriver.java 2011-03-07 14:07:04 UTC (rev 196)
@@ -132,7 +132,7 @@
}
private void handleException(Exception e) {
- if(Settings.DEBUG){
+ if(Settings.isDebug()){
throw new RuntimeException(e);
}
e.printStackTrace();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|