From d9503245efd0e0daa5d87d41eef5aaacc14fe8b6 Mon Sep 17 00:00:00 2001
From: el_kaboing <el_kaboing@localhost>
Date: Mon, 21 Aug 2006 19:40:56 +0000
Subject: [PATCH] First commits for the the Windows version of the Integration Tests.

---
 opendj-sdk/opends/tests/integration-tests-testng/test.bat                                                                    |   41 ++++++++++++++++++++
 opendj-sdk/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/quickstart/checklogdir.bat         |   31 +++++++++++++++
 opendj-sdk/opends/tests/integration-tests-testng/build.bat                                                                   |    6 +-
 opendj-sdk/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/quickstart/QuickstartAddTests.java |   25 ++++++++++--
 opendj-sdk/opends/tests/integration-tests-testng/build.sh                                                                    |    2 
 5 files changed, 97 insertions(+), 8 deletions(-)

diff --git a/opendj-sdk/opends/tests/integration-tests-testng/build.bat b/opendj-sdk/opends/tests/integration-tests-testng/build.bat
index 04a8f27..f771095 100644
--- a/opendj-sdk/opends/tests/integration-tests-testng/build.bat
+++ b/opendj-sdk/opends/tests/integration-tests-testng/build.bat
@@ -44,9 +44,9 @@
 
 :runAnt
 rem Append the testng jar file to the existing classpath
-set SEMICOLON=
-if not "%CLASSPATH%" == "" set SEMICOLON=";"
-set CLASSPATH=%CLASSPATH%%SEMICOLON%%TESTNG_HOME%\lib\testng-4.7-jdk15.jar
+rem set SEMICOLON=
+rem if not "%CLASSPATH%" == "" set SEMICOLON=";"
+rem set CLASSPATH=%CLASSPATH%%SEMICOLON%%TESTNG_HOME%\lib\testng-4.7-jdk15.jar
 rem echo a quick summary of what this script did
 echo using the following variables:
 echo   ANT_HOME=%ANT_HOME%
diff --git a/opendj-sdk/opends/tests/integration-tests-testng/build.sh b/opendj-sdk/opends/tests/integration-tests-testng/build.sh
index eb32a1e..a5e050a 100755
--- a/opendj-sdk/opends/tests/integration-tests-testng/build.sh
+++ b/opendj-sdk/opends/tests/integration-tests-testng/build.sh
@@ -100,7 +100,7 @@
 
 echo "Starting the build for the integration test suites"
 # Execute the ant script and pass it any additional command-line arguments.
-${ANT_HOME}/bin/ant --noconfig ${*}
+${ANT_HOME}/bin/ant -verbose --noconfig ${*}
 
 if [ $? -eq 0 ]; then
     echo "Successfully built the integration test suite"
diff --git a/opendj-sdk/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/quickstart/QuickstartAddTests.java b/opendj-sdk/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/quickstart/QuickstartAddTests.java
index c452a05..1d8f462 100644
--- a/opendj-sdk/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/quickstart/QuickstartAddTests.java
+++ b/opendj-sdk/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/quickstart/QuickstartAddTests.java
@@ -46,11 +46,28 @@
     System.out.println("*********************************************");
     System.out.println("QuickstartAdd test 1");
 
-    String exec_cmd = integration_test_home + "/quickstart/checklogdir.sh " + logDir;
-    Runtime rtime = Runtime.getRuntime();
-    Process child = rtime.exec(exec_cmd);
-    child.waitFor();
+    String osName = new String(System.getProperty("os.name"));
+    
+    if (osName.indexOf("Windows") >= 0)  // For Windows
+    {
+      String exec_cmd = "CMD /C " + integration_test_home + "\\quickstart\\checklogdir " + logDir;
+      Runtime rtime = Runtime.getRuntime();
+      Process child = rtime.exec(exec_cmd);
+      child.waitFor();
+    }
+    else  // all other unix systems
+    {
+      String exec_cmd = integration_test_home + "/quickstart/checklogdir.sh " + logDir;
+      Runtime rtime = Runtime.getRuntime();
+      Process child = rtime.exec(exec_cmd);
+      child.waitFor();   
+    }
 
+    ds_output.redirectOutput(logDir, "QuickstartAdd1.txt");
+    System.out.println("Operating system is " + osName.toString());   
+    System.out.println(logDir + " exists and is ready to receive log files.");
+    ds_output.resetOutput();
+    
     compareExitCode(0, 0);
   }
 
diff --git a/opendj-sdk/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/quickstart/checklogdir.bat b/opendj-sdk/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/quickstart/checklogdir.bat
new file mode 100644
index 0000000..79b9ea1
--- /dev/null
+++ b/opendj-sdk/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/quickstart/checklogdir.bat
@@ -0,0 +1,31 @@
+@echo off
+
+rem CDDL HEADER START
+rem
+rem The contents of this file are subject to the terms of the
+rem Common Development and Distribution License, Version 1.0 only
+rem (the "License").  You may not use this file except in compliance
+rem with the License.
+rem
+rem You can obtain a copy of the license at
+rem trunk/opends/resource/legal-notices/OpenDS.LICENSE
+rem or https://OpenDS.dev.java.net/OpenDS.LICENSE.
+rem See the License for the specific language governing permissions
+rem and limitations under the License.
+rem
+rem When distributing Covered Code, include this CDDL HEADER in each
+rem file and include the License file at
+rem trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
+rem add the following below this CDDL HEADER, with the fields enclosed
+rem information:
+rem      Portions Copyright [yyyy] [name of copyright owner]
+rem
+rem CDDL HEADER END
+rem
+rem
+rem      Portions Copyright 2006 Sun Microsystems, Inc.
+
+set LOGDIR=%1
+
+IF NOT EXIST %LOGDIR% mkdir %LOGDIR%
+
diff --git a/opendj-sdk/opends/tests/integration-tests-testng/test.bat b/opendj-sdk/opends/tests/integration-tests-testng/test.bat
new file mode 100644
index 0000000..a2261f6
--- /dev/null
+++ b/opendj-sdk/opends/tests/integration-tests-testng/test.bat
@@ -0,0 +1,41 @@
+@echo off
+
+rem CDDL HEADER START
+rem
+rem The contents of this file are subject to the terms of the
+rem Common Development and Distribution License, Version 1.0 only
+rem (the "License").  You may not use this file except in compliance
+rem with the License.
+rem
+rem You can obtain a copy of the license at
+rem trunk/opends/resource/legal-notices/OpenDS.LICENSE
+rem or https://OpenDS.dev.java.net/OpenDS.LICENSE.
+rem See the License for the specific language governing permissions
+rem and limitations under the License.
+rem
+rem When distributing Covered Code, include this CDDL HEADER in each
+rem file and include the License file at
+rem trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
+rem add the following below this CDDL HEADER, with the fields enclosed
+rem information:
+rem      Portions Copyright [yyyy] [name of copyright owner]
+rem
+rem CDDL HEADER END
+rem
+rem
+rem      Portions Copyright 2006 Sun Microsystems, Inc.
+
+set INTEG_TEST_HOME=%1
+if "%INTEG_TEST_HOME%" == "" goto usage
+
+rem echo INTEG_TEST_HOME is %INTEG_TEST_HOME%
+echo OpenDS Integration Tests have started.........
+java -ea org.testng.TestNG -d /tmp/testng -listener org.opends.server.OpenDSTestListener %INTEG_TEST_HOME%/ext/testng/testng.xml
+goto end
+
+
+:usage
+echo usage:
+echo test [Integration Test Suite HOME Directory]
+
+:end

--
Gitblit v1.10.0