[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jboss-cvs-commits
Subject:    [jboss-cvs] jrunit/src/main/org/jboss/jrunit/controller/ant  ...
From:       Clebert Suconic <csuconic () jboss ! com>
Date:       2005-05-31 21:35:34
Message-ID: E1DdEOc-0004Rh-T9 () committer01 ! frg ! pub ! inap ! atl ! jboss ! com
[Download RAW message or body]

  User: csuconic
  Date: 05/05/31 17:35:34

  Modified:    src/main/org/jboss/jrunit/controller/ant 
                        AntBenchmarkReceiver.java
  Log:
  Refactoring into DatabaseBenchmarkReceiver
  
  Revision  Changes    Path
  1.2       +14 -41    \
jrunit/src/main/org/jboss/jrunit/controller/ant/AntBenchmarkReceiver.java  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: AntBenchmarkReceiver.java
  ===================================================================
  RCS file: /cvsroot/jboss/jrunit/src/main/org/jboss/jrunit/controller/ant/AntBenchmarkReceiver.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- AntBenchmarkReceiver.java	31 May 2005 19:10:11 -0000	1.1
  +++ AntBenchmarkReceiver.java	31 May 2005 21:35:34 -0000	1.2
  @@ -10,6 +10,8 @@
   import org.apache.tools.ant.Task;
   import org.apache.tools.ant.BuildException;
   import org.jboss.jrunit.controller.BenchmarkReceiver;
  +import org.jboss.jrunit.controller.persistence.DatabaseBenchmarkReceiver;
  +import org.jboss.jrunit.controller.persistence.DatabaseBenchmarkListener;
   import org.jboss.jrunit.communication.message.QuitMessage;
   import org.jboss.jrunit.communication.message.AntQuitMessage;
   import org.jboss.jrunit.data.Benchmark;
  @@ -19,53 +21,15 @@
   /**
    * @author clebert.suconic@jboss.com
    */
  -public class AntBenchmarkReceiver extends Task
  +public class AntBenchmarkReceiver extends Task implements \
DatabaseBenchmarkListener  {
   
       private String jdbcClass;
       private String jdbcURL;
       private String jdbcUserName;
       private String jdbcPassword;
  +    private boolean running = true;
   
  -    public static boolean running = true;
  -    class DatabaseBenchmarkReceiver extends BenchmarkReceiver
  -    {
  -        public DatabaseBenchmarkReceiver() throws Exception
  -        {
  -            super();
  -        }
  -
  -        public void onQuit(QuitMessage message)
  -        {
  -            System.out.println("AntBenchmarkReceiver:");
  -            getRoot().print(System.out);
  -
  -            if (message instanceof AntQuitMessage)
  -            {
  -                bus.stop();
  -                running=false;
  -                save(getRoot());
  -            }
  -        }
  -    }
  -
  -    public void save(Benchmark benchmark)
  -    {
  -        try
  -        {
  -            Class.forName(jdbcClass);
  -            Connection conn=null;
  -
  -            if (jdbcUserName!=null)
  -            {
  -                 
  -            }
  -        }
  -        catch (Exception e)
  -        {
  -            e.printStackTrace();
  -        }
  -    }
   
       public void init() throws BuildException
       {
  @@ -76,7 +40,7 @@
           try
           {
               running=true;
  -            DatabaseBenchmarkReceiver receiver = new DatabaseBenchmarkReceiver();
  +            DatabaseBenchmarkReceiver receiver = new \
DatabaseBenchmarkReceiver(this,jdbcClass,jdbcUserName,jdbcPassword);  }
           catch (Exception e)
           {
  @@ -125,4 +89,13 @@
           this.jdbcPassword = jdbcPassword;
       }
   
  +    public void onQuit()
  +    {
  +        running=false;
  +    }
  +
  +    public boolean isRunning()
  +    {
  +        return running;
  +    }
   }
  
  
  


-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
jboss-cvs-commits mailing list
jboss-cvs-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-cvs-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic