incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vin...@apache.org
Subject cvs commit: incubator-altrmi/integrationtests/src/test/org/apache/altrmi/test/bcel BcelTestCase.java
Date Sun, 31 Aug 2003 11:07:54 GMT
vinayc      2003/08/31 04:07:54

  Modified:    integrationtests/src/test/org/apache/altrmi/test/bcel
                        BcelTestCase.java
  Log:
  Testcases now externally fetches the output directories to push dynamically generated classes
  
  Revision  Changes    Path
  1.2       +34 -3     incubator-altrmi/integrationtests/src/test/org/apache/altrmi/test/bcel/BcelTestCase.java
  
  Index: BcelTestCase.java
  ===================================================================
  RCS file: /home/cvs/incubator-altrmi/integrationtests/src/test/org/apache/altrmi/test/bcel/BcelTestCase.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BcelTestCase.java	28 Aug 2003 18:19:05 -0000	1.1
  +++ BcelTestCase.java	31 Aug 2003 11:07:54 -0000	1.2
  @@ -54,6 +54,8 @@
    */
   package org.apache.altrmi.test.bcel;
   
  +import java.io.File;
  +
   import org.apache.altrmi.client.impl.ServerSideClassFactory;
   import org.apache.altrmi.client.impl.socket.SocketCustomStreamHostContext;
   import org.apache.altrmi.common.DefaultThreadPool;
  @@ -80,6 +82,33 @@
       {
           super(name);
       }
  +    
  +    /**
  +     * Fetch the directory to store the classes and java source generated by the dynamic
class retrievers
  +     */
  +    private String getClassGenDir()
  +    {
  +        String class_gen_dir = System.getProperty("CLASS_GEN_DIR");
  +        if( class_gen_dir == null  )
  +        {
  +            // (if not set, it defaults to current directory)
  +            class_gen_dir=".";
  +        }
  +        else
  +        {
  +            //if the directory doesnt exist and it cannot be created then use the default
  +            File fileClassGenDir= new File(class_gen_dir);
  +            if( !fileClassGenDir.exists() )
  +            {
  +                boolean bDirCreated= fileClassGenDir.mkdirs();
  +                if(!bDirCreated)
  +                {
  +                    class_gen_dir=".";
  +                }
  +            }
  +        }
  +        return class_gen_dir;
  +    }
   
       protected void setUp() throws Exception
       {
  @@ -87,9 +116,11 @@
   
           // server side setup.
   		BcelDynamicGeneratorClassRetriever cr=new BcelDynamicGeneratorClassRetriever(this.getClass().getClassLoader());
  -        cr.setClassGenDir(".");
  -        cr.setClasspath("..\\build\\classes;%JAVA_HOME%\\lib\\tools.jar");
  -        cr.setSrcGenDir(".");
  +
  +        String class_gen_dir=getClassGenDir();
  +        cr.setClassGenDir(class_gen_dir);
  +        //cr.setClasspath("..\\build\\classes;%JAVA_HOME%\\lib\\tools.jar");
  +        cr.setSrcGenDir(class_gen_dir);
           server = new CompleteSocketCustomStreamServer(cr,new DefaultAuthenticator(),new
ConsoleServerMonitor(),new DefaultThreadPool(),new DefaultServerSideClientContextFactory(),10001);
   
           testServer = new TestInterfaceImpl();
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@incubator.apache.org
For additional commands, e-mail: cvs-help@incubator.apache.org


Mime
View raw message