[jboss-cvs] JBossAS SVN: r64068 - in projects/aop/trunk/aop/src: test/org/jboss/test/aop/stress and 6 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Jul 16 10:56:08 EDT 2007


Author: kabir.khan at jboss.com
Date: 2007-07-16 10:56:07 -0400 (Mon, 16 Jul 2007)
New Revision: 64068

Added:
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/DefaultScenarioPropertyReader.java
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/FileScenarioPropertyReader.java
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/MutableFileScenatioPropertyLoader.java
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/ScenarioPropertyReader.java
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/ScenarioPropertyReaderFactory.java
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/SystemScenarioPropertyReader.java
Modified:
   projects/aop/trunk/aop/src/resources/test/stress/config.properties
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/ScenarioRunner.java
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/ScenarioTestDelegate.java
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/batf/BeforeAfterThrowingFinallyVersusAroundTestCase.java
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/methodinvocation/MethodInvocationTestCase.java
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/perinstancemethodinvocation/PerInstanceTestCase.java
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/perinstancemethodinvocationmanybindings/PerInstanceTestCase.java
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/simple/SimpleReflectToJavassistTestCase.java
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/weavetest/GenerateClassesTestDelegate.java
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/weavetest/WeaveManyClassesTestCase.java
Log:
Improve stress test framework configuration

Modified: projects/aop/trunk/aop/src/resources/test/stress/config.properties
===================================================================
--- projects/aop/trunk/aop/src/resources/test/stress/config.properties	2007-07-16 13:35:30 UTC (rev 64067)
+++ projects/aop/trunk/aop/src/resources/test/stress/config.properties	2007-07-16 14:56:07 UTC (rev 64068)
@@ -1,5 +1,5 @@
-warmup=0
-loops=500
+warmup=1
+loops=1
 threads=1
 random_sleep_interval=false
 sleeptime_millis=0

Added: projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/DefaultScenarioPropertyReader.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/DefaultScenarioPropertyReader.java	                        (rev 0)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/DefaultScenarioPropertyReader.java	2007-07-16 14:56:07 UTC (rev 64068)
@@ -0,0 +1,48 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software 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
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.test.aop.stress;
+
+import java.util.Properties;
+
+/**
+ * Default values for Scenario Properties
+ *  
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class DefaultScenarioPropertyReader extends ScenarioPropertyReader
+{
+   @Override
+   Properties loadProperties()
+   {
+      Properties properties = new Properties();
+      properties.put(WARMUP, "100000");
+      properties.put(LOOPS, "10");
+      properties.put(THREADS, "10");
+      properties.put(RANDOM_SLEEP_INTERVAL, "false");
+      properties.put(SLEEPTIME_MILLIS, "100");
+      properties.put(LOGGING, "false");
+
+      return properties;
+   }
+
+}

Added: projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/FileScenarioPropertyReader.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/FileScenarioPropertyReader.java	                        (rev 0)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/FileScenarioPropertyReader.java	2007-07-16 14:56:07 UTC (rev 64068)
@@ -0,0 +1,95 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software 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
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.test.aop.stress;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Properties;
+
+import org.jboss.aop.AspectManager;
+import org.jboss.logging.Logger;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class FileScenarioPropertyReader extends ScenarioPropertyReader
+{
+   final static Logger log = Logger.getLogger(FileScenarioPropertyReader.class); 
+   String location;
+   boolean strict;
+   
+   FileScenarioPropertyReader(String location, boolean strict)
+   {
+      this.location = location;
+      this.strict = strict;
+   }
+   
+   @Override
+   Properties loadProperties()
+   {
+      try
+      {
+         URL url = new URL(location);
+         File file = new File(url.getFile());
+         
+         if (!file.exists())
+         {
+            if (strict)
+            {
+               throw new RuntimeException("Could not find config file " + file);
+            }
+               
+            if (AspectManager.verbose)
+            {
+               System.out.println("Could not find test/scenario config file " + file + ". Creating passthrough reader");
+            }
+            return null;
+         }
+         else
+         {
+            InputStream in = new FileInputStream(url.getFile());
+            Properties properties = new Properties();
+            properties.load(in);
+            return properties;
+         }
+      }
+      catch (MalformedURLException e)
+      {
+         throw new RuntimeException(e);
+      }
+      catch (FileNotFoundException e)
+      {
+         throw new RuntimeException(e);
+      }
+      catch (IOException e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
+}

Added: projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/MutableFileScenatioPropertyLoader.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/MutableFileScenatioPropertyLoader.java	                        (rev 0)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/MutableFileScenatioPropertyLoader.java	2007-07-16 14:56:07 UTC (rev 64068)
@@ -0,0 +1,44 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software 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
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.test.aop.stress;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class MutableFileScenatioPropertyLoader extends FileScenarioPropertyReader
+{
+
+   MutableFileScenatioPropertyLoader(String location, boolean strict)
+   {
+      // FIXME MutableFileScenatioPropertyLoader constructor
+      super(location, strict);
+   }
+   
+   public void updateProperties(String location)
+   {
+      super.location = location;
+      super.properties = super.loadProperties();
+   }
+
+}

Added: projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/ScenarioPropertyReader.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/ScenarioPropertyReader.java	                        (rev 0)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/ScenarioPropertyReader.java	2007-07-16 14:56:07 UTC (rev 64068)
@@ -0,0 +1,94 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software 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
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.test.aop.stress;
+
+import java.util.Properties;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class ScenarioPropertyReader
+{
+   public static final String WARMUP = "warmup";
+   public static final String LOOPS = "loops";
+   public static final String THREADS = "threads";
+   public static final String RANDOM_SLEEP_INTERVAL = "random_sleep_interval";
+   public static final String SLEEPTIME_MILLIS = "sleeptime_millis";
+   public static final String LOGGING = "logging";
+   
+   Properties properties;
+   ScenarioPropertyReader next;
+   
+   void setNext(ScenarioPropertyReader next)
+   {
+      this.next = next;
+   }
+   
+   ScenarioPropertyReader getNext()
+   {
+      return next;
+   }
+   
+   int getIntProperty(String key)
+   {
+      return Integer.parseInt(getProperty(key));  
+   }
+   
+   boolean getBooleanProperty(String key)
+   {
+      return "true".equals(getProperty(key));
+   }
+   
+   String getProperty(String key)
+   {
+      String val = null;
+
+      if (properties == null)
+      {
+         this.properties = loadProperties();
+      }
+      
+      if (properties != null)
+      {
+         val = (String)properties.get(key);
+      }
+      
+      if (val != null)
+      {
+         return val;
+      }
+      
+      if (next != null)
+      {
+         val = next.getProperty(key);
+         return val;
+      }
+      else
+      {
+         throw new RuntimeException("Invalid property '" + key + "' could not be found");
+      }      
+   }
+ 
+   abstract Properties loadProperties();
+}

Added: projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/ScenarioPropertyReaderFactory.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/ScenarioPropertyReaderFactory.java	                        (rev 0)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/ScenarioPropertyReaderFactory.java	2007-07-16 14:56:07 UTC (rev 64068)
@@ -0,0 +1,100 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software 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
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.test.aop.stress;
+
+import java.net.URL;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class ScenarioPropertyReaderFactory
+{
+   Class testCaseClass;
+   String packageName;
+   
+   String baseDirectory;
+   ScenarioPropertyReader reader;
+   
+   ScenarioPropertyReaderFactory(Class testCaseClass)
+   {
+      this.testCaseClass = testCaseClass;
+      packageName = testCaseClass.getName().substring("org.jboss.test.aop.stress.".length(), testCaseClass.getName().lastIndexOf(".")); 
+      packageName.replace('.', '/');
+      
+      URL url = this.getClass().getProtectionDomain().getCodeSource().getLocation();
+      System.out.println("class url: " + url);
+      String location = url.toString();
+      int index = location.indexOf("/output/");
+      location = location.substring(0, index);
+      
+      baseDirectory = location + "/src/resources/test/stress/";     
+   }
+   
+   public ScenarioPropertyReader getPropertyReader(String testName)
+   {
+      if (reader == null)
+      {
+         //System properties override everything
+         this.reader = new SystemScenarioPropertyReader();
+         ScenarioPropertyReader cur = this.reader;
+         
+         //We can have a file with the same name as the testcase
+         ScenarioPropertyReader next = new MutableFileScenatioPropertyLoader(getConfigFileForTest(testName), false);
+         cur.setNext(next);
+         cur = next;
+         
+         //We can have a file with the same name as the test case
+         next = new FileScenarioPropertyReader(baseDirectory + packageName + "/" + testCaseClass.getSimpleName() + ".properties", false);
+         cur.setNext(next);
+         cur = next;
+         
+         //A global configuration file is necessary
+         next = new FileScenarioPropertyReader(baseDirectory + "config.properties", true);
+         cur.setNext(next);
+         cur = next;
+         
+         //A global configuration file is necessary
+         next = new DefaultScenarioPropertyReader();
+         cur.setNext(next);
+      }
+      else
+      {
+         ScenarioPropertyReader cur = reader;
+         while (cur != null)
+         {
+            if (cur instanceof MutableFileScenatioPropertyLoader)
+            {
+               ((MutableFileScenatioPropertyLoader)cur).updateProperties(getConfigFileForTest(testName));
+            }
+            cur = cur.getNext();
+         }
+      }
+      return this.reader;
+   }
+   
+   private String getConfigFileForTest(String testName)
+   {
+      return baseDirectory + packageName + "/" + testCaseClass.getSimpleName() + "_" + testName + ".properties";
+   }
+}

Modified: projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/ScenarioRunner.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/ScenarioRunner.java	2007-07-16 13:35:30 UTC (rev 64067)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/ScenarioRunner.java	2007-07-16 14:56:07 UTC (rev 64068)
@@ -21,14 +21,12 @@
 */ 
 package org.jboss.test.aop.stress;
 
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.net.URL;
 import java.util.ArrayList;
 import java.util.Iterator;
-import java.util.Properties;
 import java.util.Random;
 
+import junit.framework.TestCase;
+
 /**
  * 
  * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
@@ -36,15 +34,9 @@
  */
 public class ScenarioRunner
 {
-   private static final String WARMUP = "warmup";
-   private static final String LOOPS = "loops";
-   private static final String THREADS = "threads";
-   private static final String RANDOM_SLEEP_INTERVAL = "random_sleep_interval";
-   private static final String SLEEPTIME_MILLIS = "sleeptime_millis";
-   private static final String LOGGING = "logging";
-
-   private Properties properties = new Properties();
-
+   private Class testCaseClass;
+   ScenarioPropertyReaderFactory factory;
+   
    private int warmup;
    private int loops;
    private int threads;
@@ -53,81 +45,44 @@
    Random random = new Random(10);
    boolean logging;
    
-   public ScenarioRunner()
+   public ScenarioRunner(Class testCaseClass)
    {
-      try
-      {
-         initialiseProperties();
-         
-         warmup = getIntProperty(WARMUP, "100000");
-         loops = getIntProperty(LOOPS, "10");
-         threads = getIntProperty(THREADS, "10");
-         randomSleepInterval = getBooleanProperty(RANDOM_SLEEP_INTERVAL, "false");
-         sleeptimeMillis = getIntProperty(SLEEPTIME_MILLIS, "100");
-         logging = getBooleanProperty(LOGGING, "false");
-         
-         System.out.println("============================================");
-         System.out.println("Configured ScenarioRunner");
-         System.out.println("   warmup:                  " + warmup);
-         System.out.println("   loops:                   " + loops);
-         System.out.println("   threads:                 " + threads);
-         System.out.println("   Random sleep Interval:   " + randomSleepInterval);
-         System.out.println("   Sleep time millis:       " + randomSleepInterval);
-         System.out.println("   Logging:                 " + logging);
-         System.out.println("============================================");
-      }
-      catch (Exception e)
-      {
-         throw new RuntimeException(e);
-      }
+      this.testCaseClass = testCaseClass;
+      factory = new ScenarioPropertyReaderFactory(testCaseClass);
    }
 
-   private void initialiseProperties() throws Exception
+   private void initialisePropertiesForTest(TestCase testCase)
    {
-      URL url = this.getClass().getProtectionDomain().getCodeSource().getLocation();
-      System.out.println("class url: " + url);
-      String location = url.toString();
-      int index = location.indexOf("/output/");
-      location = location.substring(0, index);
-      
-      location = location + "/src/resources/test/stress/config.properties";
-      url = new URL(location);
-      InputStream in = new FileInputStream(url.getFile());
-      properties = new Properties();
-      properties.load(in);
-      
+      String testName = (testCase == null) ? "" : testCase.getName();
+      ScenarioPropertyReader reader = factory.getPropertyReader(testName);
+
+      warmup = reader.getIntProperty(ScenarioPropertyReader.WARMUP);
+      loops = reader.getIntProperty(ScenarioPropertyReader.LOOPS);
+      threads = reader.getIntProperty(ScenarioPropertyReader.THREADS);
+      randomSleepInterval = reader.getBooleanProperty(ScenarioPropertyReader.RANDOM_SLEEP_INTERVAL);
+      sleeptimeMillis = reader.getIntProperty(ScenarioPropertyReader.SLEEPTIME_MILLIS);
+      logging = reader.getBooleanProperty(ScenarioPropertyReader.LOGGING);
+
+      System.out.println("============================================");
+      System.out.println("Configured ScenarioRunner for " + testCaseClass.getName() + "." + testName);
+      System.out.println("   warmup:                  " + warmup);
+      System.out.println("   loops:                   " + loops);
+      System.out.println("   threads:                 " + threads);
+      System.out.println("   Random sleep Interval:   " + randomSleepInterval);
+      System.out.println("   Sleep time millis:       " + randomSleepInterval);
+      System.out.println("   Logging:                 " + logging);
+      System.out.println("============================================");
    }
    
-   private int getIntProperty(String key, String defaultValue)
+   public void executeScenario(Scenario scenario, TestCase testCase) throws Exception
    {
-      return Integer.parseInt(getProperty(key, defaultValue));  
+      Scenario[] scenarios = new Scenario[] {scenario};
+      executeScenario(scenarios, testCase);
    }
    
-   private boolean getBooleanProperty(String key, String defaultValue)
+   public void executeScenario(Scenario[] scenarios, TestCase testCase) throws Exception
    {
-      return "true".equals(getProperty(key, defaultValue));
-   }
-   
-   private String getProperty(String key, String defaultValue)
-   {
-      String val = System.getProperty(key);
-      if (val != null)
-      {
-         return val;
-      }
-      
-      val = properties.getProperty(key);
-      if (val != null)
-      {
-         return val;
-      }
-      
-      return defaultValue;
-   }
-   
-   public void executeScenario(Scenario scenario) throws Exception
-   {
-      Scenario[] scenarios = new Scenario[] {scenario};
+      initialisePropertiesForTest(testCase);
       warmupScenario(scenarios);
       executeScenarios(scenarios);
    }
@@ -139,7 +94,7 @@
       loader.join();
    }
    
-   public void executeScenarios(Scenario[] scenarios) throws Exception
+   private void executeScenarios(Scenario[] scenarios) throws Exception
    {
       System.out.println("Starting run with Scenarios " + getScenarioNames(scenarios));
       long start = System.currentTimeMillis();

Modified: projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/ScenarioTestDelegate.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/ScenarioTestDelegate.java	2007-07-16 13:35:30 UTC (rev 64067)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/ScenarioTestDelegate.java	2007-07-16 14:56:07 UTC (rev 64068)
@@ -30,10 +30,11 @@
  */
 public class ScenarioTestDelegate extends AbstractTestDelegate
 {
-   ScenarioRunner runner = new ScenarioRunner(); 
+   ScenarioRunner runner; 
    public ScenarioTestDelegate(Class clazz)
    {
       super(clazz);
+      runner = new ScenarioRunner(super.clazz); 
    }
 
    public ScenarioRunner getRunner()

Added: projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/SystemScenarioPropertyReader.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/SystemScenarioPropertyReader.java	                        (rev 0)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/SystemScenarioPropertyReader.java	2007-07-16 14:56:07 UTC (rev 64068)
@@ -0,0 +1,38 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software 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
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.test.aop.stress;
+
+import java.util.Properties;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class SystemScenarioPropertyReader extends ScenarioPropertyReader
+{
+   @Override
+   Properties loadProperties()
+   {
+      return System.getProperties();
+   }
+}

Modified: projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/batf/BeforeAfterThrowingFinallyVersusAroundTestCase.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/batf/BeforeAfterThrowingFinallyVersusAroundTestCase.java	2007-07-16 13:35:30 UTC (rev 64067)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/batf/BeforeAfterThrowingFinallyVersusAroundTestCase.java	2007-07-16 14:56:07 UTC (rev 64068)
@@ -53,7 +53,7 @@
       assertTrue(SimpleAspect.after);
       assertFalse(SimpleAspect.throwing);
       assertFalse(SimpleAspect.finaly);
-      getRunner().executeScenario(new AroundWithNoExceptionsScenario());
+      getRunner().executeScenario(new AroundWithNoExceptionsScenario(), this);
    }
    
    private class AroundWithNoExceptionsScenario extends AbstractScenario
@@ -75,7 +75,7 @@
       assertTrue(SimpleAspect.after);
       assertFalse(SimpleAspect.throwing);
       assertFalse(SimpleAspect.finaly);
-      getRunner().executeScenario(new BeforeAfterThrowingFinallyWithNoExceptionsScenario());
+      getRunner().executeScenario(new BeforeAfterThrowingFinallyWithNoExceptionsScenario(), this);
    }
    
    private class BeforeAfterThrowingFinallyWithNoExceptionsScenario extends AbstractScenario
@@ -107,7 +107,7 @@
       assertTrue(SimpleAspect.throwing);
       assertTrue(SimpleAspect.finaly);
 
-      getRunner().executeScenario(new AroundWithExceptionsScenario());
+      getRunner().executeScenario(new AroundWithExceptionsScenario(), this);
    }
    
    private class AroundWithExceptionsScenario extends AbstractScenario
@@ -147,7 +147,7 @@
       assertTrue(SimpleAspect.throwing);
       assertTrue(SimpleAspect.finaly);
 
-      getRunner().executeScenario(new BeforeAfterThrowingFinallyWithExceptionScenario());
+      getRunner().executeScenario(new BeforeAfterThrowingFinallyWithExceptionScenario(), this);
    }
    
    private class BeforeAfterThrowingFinallyWithExceptionScenario extends AbstractScenario
@@ -175,7 +175,7 @@
       assertFalse(SimpleAspect.throwing);
       assertFalse(SimpleAspect.finaly);
 
-      getRunner().executeScenario(new AroundSimulatedBeforeScenario());
+      getRunner().executeScenario(new AroundSimulatedBeforeScenario(), this);
    }
    
    private class AroundSimulatedBeforeScenario extends AbstractScenario
@@ -197,7 +197,7 @@
       assertFalse(SimpleAspect.throwing);
       assertFalse(SimpleAspect.finaly);
 
-      getRunner().executeScenario(new BeforeOnlyScenario());
+      getRunner().executeScenario(new BeforeOnlyScenario(), this);
    }
    
    private class BeforeOnlyScenario extends AbstractScenario
@@ -216,7 +216,7 @@
       pojo.methodWithAroundArguments("HELLO");
       assertEquals("HELLO", SimpleAspect.string);
       
-      getRunner().executeScenario(new AroundAccessArgumentsScenario());
+      getRunner().executeScenario(new AroundAccessArgumentsScenario(), this);
    }
    
    private class AroundAccessArgumentsScenario extends AbstractScenario
@@ -236,7 +236,7 @@
       pojo.methodWithTypedArguments("HEY");
       assertEquals("HEY", SimpleAspect.string);
       
-      getRunner().executeScenario(new BeforeAccessTypedArgumentScenario());
+      getRunner().executeScenario(new BeforeAccessTypedArgumentScenario(), this);
    }
    
    private class BeforeAccessTypedArgumentScenario extends AbstractScenario
@@ -251,7 +251,7 @@
    
    public void testNotWovenNoCtorScenario() throws Exception
    {
-      getRunner().executeScenario(new NotWovenNoCtorScenario());
+      getRunner().executeScenario(new NotWovenNoCtorScenario(), this);
    }
    
    private class NotWovenNoCtorScenario extends AbstractScenario
@@ -265,7 +265,7 @@
 
    public void testNotWovenWithCtorScenario() throws Exception
    {
-      getRunner().executeScenario(new NotWovenWithCtorScenario());
+      getRunner().executeScenario(new NotWovenWithCtorScenario(), this);
    }
    
    private class NotWovenWithCtorScenario extends AbstractScenario

Modified: projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/methodinvocation/MethodInvocationTestCase.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/methodinvocation/MethodInvocationTestCase.java	2007-07-16 13:35:30 UTC (rev 64067)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/methodinvocation/MethodInvocationTestCase.java	2007-07-16 14:56:07 UTC (rev 64068)
@@ -46,7 +46,7 @@
    
    public void testStaticWovenNoAdvice() throws Exception
    {
-      getRunner().executeScenario(new StaticWovenNoAdviceScenario());
+      getRunner().executeScenario(new StaticWovenNoAdviceScenario(), this);
    }
    
    private class StaticWovenNoAdviceScenario extends AbstractScenario
@@ -60,7 +60,7 @@
    
    public void testNonStaticWovenNoAdvice() throws Exception
    {
-      getRunner().executeScenario(new NonStaticWovenNoAdviceScenario());
+      getRunner().executeScenario(new NonStaticWovenNoAdviceScenario(), this);
    }
 
    private class NonStaticWovenNoAdviceScenario extends AbstractScenario
@@ -78,7 +78,7 @@
       PlainInterceptor.called = 0;
       pojo.oneInterceptor();
       assertEquals(1, PlainInterceptor.called);
-      getRunner().executeScenario(new NonStaticWithOneInterceptorScenario());
+      getRunner().executeScenario(new NonStaticWithOneInterceptorScenario(), this);
    }
    
    private class NonStaticWithOneInterceptorScenario extends AbstractScenario
@@ -96,7 +96,7 @@
       PlainInterceptor.called = 0;
       pojo.fiveInterceptors();
       assertEquals(5, PlainInterceptor.called);
-      getRunner().executeScenario(new NonStaticWithFiveInterceptorsScenario());
+      getRunner().executeScenario(new NonStaticWithFiveInterceptorsScenario(), this);
    }
    
    private class NonStaticWithFiveInterceptorsScenario extends AbstractScenario
@@ -114,7 +114,7 @@
       PlainAspect.called = 0;
       pojo.oneAdvice();
       assertEquals(1, PlainAspect.called);
-      getRunner().executeScenario(new NonStaticWithOneAdviceScenario());
+      getRunner().executeScenario(new NonStaticWithOneAdviceScenario(), this);
    }
    
    private class NonStaticWithOneAdviceScenario extends AbstractScenario
@@ -132,7 +132,7 @@
       PlainAspect.called = 0;
       pojo.fiveAdvices();
       assertEquals(5, PlainAspect.called);
-      getRunner().executeScenario(new NonStaticWithFiveAdvicesScenario());
+      getRunner().executeScenario(new NonStaticWithFiveAdvicesScenario(), this);
    }
    
    private class NonStaticWithFiveAdvicesScenario extends AbstractScenario

Modified: projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/perinstancemethodinvocation/PerInstanceTestCase.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/perinstancemethodinvocation/PerInstanceTestCase.java	2007-07-16 13:35:30 UTC (rev 64067)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/perinstancemethodinvocation/PerInstanceTestCase.java	2007-07-16 14:56:07 UTC (rev 64068)
@@ -48,7 +48,7 @@
       PerInstanceInterceptor.called = 0;
       pojo.method1();
       assertEquals(1, PerInstanceInterceptor.called);
-      getRunner().executeScenario(new PerInstanceInterceptorScenario());
+      getRunner().executeScenario(new PerInstanceInterceptorScenario(), this);
    }
    
    private class PerInstanceInterceptorScenario extends AbstractScenario
@@ -66,7 +66,7 @@
       PerInstanceAspect.called = 0;
       pojo.method2();
       assertEquals(1, PerInstanceAspect.called);
-      getRunner().executeScenario(new PerInstanceAspectScenario());
+      getRunner().executeScenario(new PerInstanceAspectScenario(), this);
    }
    
    private class PerInstanceAspectScenario extends AbstractScenario
@@ -85,7 +85,7 @@
       pojo.method1();
       pojo.method1();
       assertEquals(2, PerInstanceInterceptor.called);
-      getRunner().executeScenario(new PerInstanceInterceptorRepeatInstantiationScenario());
+      getRunner().executeScenario(new PerInstanceInterceptorRepeatInstantiationScenario(), this);
    }
    
    private class PerInstanceInterceptorRepeatInstantiationScenario extends AbstractScenario
@@ -103,7 +103,7 @@
       PerInstanceAspect.called = 0;
       pojo.method2();
       assertEquals(1, PerInstanceAspect.called);
-      getRunner().executeScenario(new PerInstanceAspectRepeatInstantiationScenario());
+      getRunner().executeScenario(new PerInstanceAspectRepeatInstantiationScenario(), this);
    }
    
    private class PerInstanceAspectRepeatInstantiationScenario extends AbstractScenario

Modified: projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/perinstancemethodinvocationmanybindings/PerInstanceTestCase.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/perinstancemethodinvocationmanybindings/PerInstanceTestCase.java	2007-07-16 13:35:30 UTC (rev 64067)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/perinstancemethodinvocationmanybindings/PerInstanceTestCase.java	2007-07-16 14:56:07 UTC (rev 64068)
@@ -151,7 +151,7 @@
       assertEquals(0, PerVmInterceptor.called);
       assertEquals(24, PerInstanceInterceptor.called);
       
-      getRunner().executeScenario(new PerInstanceInterceptorRepeatInstantiationScenario());
+      getRunner().executeScenario(new PerInstanceInterceptorRepeatInstantiationScenario(), this);
    }
    
    private class PerInstanceInterceptorRepeatInstantiationScenario extends AbstractScenario

Modified: projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/simple/SimpleReflectToJavassistTestCase.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/simple/SimpleReflectToJavassistTestCase.java	2007-07-16 13:35:30 UTC (rev 64067)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/simple/SimpleReflectToJavassistTestCase.java	2007-07-16 14:56:07 UTC (rev 64068)
@@ -53,7 +53,7 @@
       boolean exception = false;
       try
       {
-         getRunner().executeScenario(new ExceptionScenario());
+         getRunner().executeScenario(new ExceptionScenario(), this);
       }
       catch (Exception e)
       {
@@ -70,7 +70,7 @@
         new SimpleFieldToJavassistScenario(),
         new SimpleMethodToJavassistScenario()};
       
-      getRunner().executeScenarios(scenarios);
+      getRunner().executeScenario(scenarios, this);
    }
 
    private class ExceptionScenario extends AbstractScenario
@@ -119,10 +119,10 @@
     */
    public void testExceptionOverhead() throws Throwable
    {
-      getRunner().executeScenario(new InstantiateObjectScenario());
-      getRunner().executeScenario(new CreateExceptionScenario());
-      getRunner().executeScenario(new CreateExceptionGetStackTraceScenario());
-      getRunner().executeScenario(new CallMethodWithExceptionScenario());
+      getRunner().executeScenario(new InstantiateObjectScenario(), this);
+      getRunner().executeScenario(new CreateExceptionScenario(), this);
+      getRunner().executeScenario(new CreateExceptionGetStackTraceScenario(), this);
+      getRunner().executeScenario(new CallMethodWithExceptionScenario(), this);
    }
    
    private class InstantiateObjectScenario extends AbstractScenario

Modified: projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/weavetest/GenerateClassesTestDelegate.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/weavetest/GenerateClassesTestDelegate.java	2007-07-16 13:35:30 UTC (rev 64067)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/weavetest/GenerateClassesTestDelegate.java	2007-07-16 14:56:07 UTC (rev 64068)
@@ -47,7 +47,7 @@
       super.setUp();
       System.out.println("Seeing up delegate");
       setupScenario = new GenerateClassesScenario();
-      super.getRunner().executeScenario(setupScenario);
+      super.getRunner().executeScenario(setupScenario, null);
    }
    
    public Factory[] getWovenFactories()

Modified: projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/weavetest/WeaveManyClassesTestCase.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/weavetest/WeaveManyClassesTestCase.java	2007-07-16 13:35:30 UTC (rev 64067)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/stress/weavetest/WeaveManyClassesTestCase.java	2007-07-16 14:56:07 UTC (rev 64068)
@@ -49,12 +49,12 @@
 
    public void testVanilla() throws Exception
    {
-      getRunner().executeScenario(new VanillaScenario());
+      getRunner().executeScenario(new VanillaScenario(), this);
    }
    
    public void testWeave() throws Exception
    {
-      getRunner().executeScenario(new WeaveScenario());
+      getRunner().executeScenario(new WeaveScenario(), this);
    }
    
    @SkipWarmup
@@ -113,7 +113,7 @@
    
    public void testInitAdvisor() throws Exception
    {
-      getRunner().executeScenario(new InitAdvisorScenario());
+      getRunner().executeScenario(new InitAdvisorScenario(), this);
    }
 
    @SkipWarmup




More information about the jboss-cvs-commits mailing list