You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by js...@apache.org on 2004/11/02 20:40:05 UTC

svn commit: rev 56407 - in incubator/beehive/trunk/controls/test/tools: mantis/src/org/apache/beehive/test/tools/mantis tch/src/java/org/apache/beehive/test/tools/tch/core

Author: jsong
Date: Tue Nov  2 11:40:05 2004
New Revision: 56407

Modified:
   incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/MantisTask.java
   incubator/beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/VersionGenerator.java
Log:
Submit changed made to MantisTask.java and VersionGenerator.java, which is contributed by bob mcwhirter
in JIRA BEEHIVE-53 and 54.
drt tests passed.


Modified: incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/MantisTask.java
==============================================================================
--- incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/MantisTask.java	(original)
+++ incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/MantisTask.java	Tue Nov  2 11:40:05 2004
@@ -33,7 +33,7 @@
   public void setSrcdir(String p_srcdir)
   {
     _srcdir = p_srcdir;
-    fileset.setDir(new File(_srcdir));
+    fileset.setDir(new File(getProject().getBaseDir(), _srcdir));
   }
 
   public void setSrcgen(String p_srcgen)
@@ -86,9 +86,10 @@
     // create the file of all files to process
     // this will allow processing on win32 given it's
     // limitation on command-line length
-    File fSrcgen = new File(_srcgen);
+    File baseDir = getProject().getBaseDir();
+    File fSrcgen = new File(baseDir, _srcgen);
     fSrcgen.mkdirs();
-    DirectoryScanner scanner = getDirectoryScanner(new File(_srcdir));
+    DirectoryScanner scanner = getDirectoryScanner(new File(baseDir, _srcdir));
     String[] files = scanner.getIncludedFiles();
     String filename = _srcgen+P+"files.txt";
     try
@@ -150,18 +151,20 @@
 
   private void logStreams(Process p_proc) throws IOException,InterruptedException
   {
+    File baseDir = getProject().getBaseDir();
+
     // ensure log dir exists
     if(null == _logdir)
       _logdir = _srcgen;
     else
     {
-      File fLogdir = new File(_logdir);
+      File fLogdir = new File(baseDir, _logdir);
       fLogdir.mkdirs();
     }
 
     // capture stderr and stdout to log files
-    StreamCapture stderr = new StreamCapture(p_proc.getErrorStream(),"file", _logdir+P+"mantis.err");
-    StreamCapture stdout = new StreamCapture(p_proc.getInputStream(),"file", _logdir+P+"mantis.out");
+    StreamCapture stderr = new StreamCapture(p_proc.getErrorStream(),"file", baseDir+P+_logdir+P+"mantis.err");
+    StreamCapture stdout = new StreamCapture(p_proc.getInputStream(),"file", baseDir+P+_logdir+P+"mantis.out");
     stderr.start();
     stdout.start();
 

Modified: incubator/beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/VersionGenerator.java
==============================================================================
--- incubator/beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/VersionGenerator.java	(original)
+++ incubator/beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/VersionGenerator.java	Tue Nov  2 11:40:05 2004
@@ -13,14 +13,14 @@
 
 /**
  * Generates the Version class for tch
- * 
+ *
  * @version 1.0, Sept 3, 2001
  */
 public class VersionGenerator
 {
 
-  private static final String SRC_ENV_VAR = "TCH_SRC";
-  private static final String VERSION_ENV_VAR = "TCH_VERSION";
+  private static final String SRC_PROPERTY = "beehive.tch.src";
+  private static final String VERSION_PROPERTY = "beehive.tch.version";
 
   private static String packageName = "package org.apache.beehive.test.tools.tch.core;";
   private static String fileName = "./core/version.java";
@@ -31,48 +31,27 @@
     {
       System.out.println("Entered VersionGenerator");
       String build = null;
-      String change = null;
       String info = null;
-      
-      change = "UNKNOWN CHG NO";
-      info = "UNKNOWN INFO";
-      
-      /*
-      boolean noP4 = "true".equals(System.getProperty("nop4"));
-
-      if (noP4)
-      {
-        change = "UNKNOWN CHG NO";
-        info = "UNKNOWN INFO";
-      }
-      else
-      {
-        change = word(exec("p4 changes -m1 ../../../../../../...#have"), 1);
-        info = getLocalInfo();
-      }*/
-
-      String branch = Environment.get(SRC_ENV_VAR);
-      String version = Environment.get(VERSION_ENV_VAR);
-      
+
+      String branch = System.getProperty(SRC_PROPERTY);
+      String version = System.getProperty(VERSION_PROPERTY);
+
       String javaVersion = System.getProperty("java.version");
 
       build =
         "\\n"
-          + "Tch "
+          + "Beehive Tch "
           + version
           + "\\n"
           + new Date()
           + " #"
-          + change
-          + " "
           + branch
           + " branch"
           + "\\n"
           + "java.version at build-time: "
-          + javaVersion + 
-          "\\n"
-          + info
-          + "\\n";
+          + javaVersion +
+          "\\n";
+
       File generatedf = new File(fileName);
       System.out.println("Generating file: " + generatedf.getCanonicalPath());
       generatedf.delete();