2 REM ********************************************************
3 REM This batch file receives the follwing parameters:
4 REM build/rebuild (optional): should the solution file be rebuilded
5 REM or just builded before test run (default is rebuild)
6 REM example run-tests build
7 REM will cause to build (and not rebuild) test solutions,
8 REM ********************************************************
10 IF "%VMW_HOME%"=="" GOTO ENVIRONMENT_EXCEPTION
15 set BUILD_OPTION=build
20 REM ********************************************************
22 REM ********************************************************
24 set OUTPUT_FILE_PREFIX=System_Web
25 set RUNNING_FIXTURE=System.Web
26 set TEST_SOLUTION=Test\TestMonoWeb.J2EE20.sln
27 set DEPLOY_PROJECT=Test\mainsoft\MainsoftWebApp20\MainsoftWebApp20.csproj
28 set TEST_ASSEMBLY=TestMonoWeb.jar
29 set PROJECT_CONFIGURATION=Debug_Java20
34 set sdy=%startDate:~10%
35 set /a sdm=1%startDate:~4,2% - 100
36 set /a sdd=1%startDate:~7,2% - 100
37 set /a sth=%startTime:~0,2%
38 set /a stm=1%startTime:~3,2% - 100
39 set /a sts=1%startTime:~6,2% - 100
40 set TIMESTAMP=%sdy%_%sdm%_%sdd%_%sth%_%stm%
43 REM ********************************************************
44 REM @echo Set environment
45 REM ********************************************************
47 set JGAC_PATH=%VMW_HOME%\java_refs\framework\
48 set TOMCAT_PATH=%VMW_HOME%\jakarta-tomcat\common\lib\
49 set JAVA_HOME=%VMW_HOME%\jre
51 set RUNTIME_CLASSPATH=%JGAC_PATH%mscorlib.jar
52 set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;%JGAC_PATH%System.jar
53 set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;%JGAC_PATH%System.Xml.jar
54 set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;%JGAC_PATH%System.Web.jar
55 set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;%JGAC_PATH%System.Runtime.Serialization.Formatters.Soap.jar
56 set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;%JGAC_PATH%Mainsoft.Web.jar
57 rem set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;%JGAC_PATH%System.Drawing.jar
58 set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;%JGAC_PATH%J2SE.Helpers.jar
60 set FACES_PATH=%JGAC_PATH%myfaces\
61 set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;%FACES_PATH%commons-beanutils-1.7.0.jar
62 set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;%FACES_PATH%commons-codec-1.3.jar
63 set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;%FACES_PATH%commons-collections-3.1.jar
64 set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;%FACES_PATH%commons-digester-1.6.jar
65 set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;%FACES_PATH%commons-el-1.0.jar
66 set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;%FACES_PATH%commons-lang-2.1.jar
67 set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;%FACES_PATH%commons-logging-1.0.4.jar
68 set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;%FACES_PATH%jstl-1.1.0.jar
69 set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;%FACES_PATH%myfaces-api-1.1.5.jar
70 set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;%FACES_PATH%myfaces-impl-1.1.5.jar
72 set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;%VMW_HOME%\java_refs\jdbc\derby.jar
74 rem ./Test/mainsoft/MainsoftWebTest/bin/Debug_Java20/HtmlCompare.jar
76 set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;Test\mainsoft\NunitWeb\NunitWeb\bin\Debug_Java20\NunitWeb.jar
77 set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;Test\mainsoft\MainsoftWebTest\bin\Debug_Java20\HtmlCompare.jar
79 set TOMCAT_CLASSPATH=%TOMCAT_PATH%servlet-api.jar
80 set NUNIT_OPTIONS=/exclude=NotWorking
82 if "%GH_VERSION%"=="" (
83 set GH_VERSION=0_0_0_0
86 set COMMON_PREFIX=%TIMESTAMP%_%OUTPUT_FILE_PREFIX%.GH_%GH_VERSION%.1.%USERNAME%
87 set GH_OUTPUT_XML=%COMMON_PREFIX%.xml
88 set BUILD_LOG=%COMMON_PREFIX%.build.log
89 set RUN_LOG=%COMMON_PREFIX%.run.log
91 set NUNIT_PATH=..\..\nunit20\
92 set NUNIT_CLASSPATH=%NUNIT_PATH%nunit-console\bin\%PROJECT_CONFIGURATION%\nunit.framework.jar
93 set NUNIT_CLASSPATH=%NUNIT_CLASSPATH%;%NUNIT_PATH%nunit-console\bin\%PROJECT_CONFIGURATION%\nunit.util.jar
94 set NUNIT_CLASSPATH=%NUNIT_CLASSPATH%;%NUNIT_PATH%nunit-console\bin\%PROJECT_CONFIGURATION%\nunit.core.jar
95 set NUNIT_CLASSPATH=%NUNIT_CLASSPATH%;%NUNIT_PATH%nunit-console\bin\%PROJECT_CONFIGURATION%\nunit-console.jar
96 set NUNIT_CLASSPATH=%NUNIT_CLASSPATH%;.
97 set NUNIT_CLASSPATH=%NUNIT_CLASSPATH%;%TEST_ASSEMBLY%
99 set CLASSPATH="%RUNTIME_CLASSPATH%;%NUNIT_CLASSPATH%;%TOMCAT_CLASSPATH%"
101 IF "%BUILD_OPTION%"=="nobuild" GOTO RUN
103 REM ********************************************************
104 @echo Building GH solution...
105 REM ********************************************************
106 xcopy /y Test\mainsoft\NunitWeb\NunitWeb\Resources\*.as* Test\mainsoft\MainsoftWebApp20\
107 xcopy /y Test\mainsoft\NunitWeb\NunitWeb\Resources\*.master Test\mainsoft\MainsoftWebApp20\
108 xcopy /y Test\mainsoft\NunitWebResources\*.* Test\mainsoft\MainsoftWebApp20\
109 pushd Test\mainsoft\MainsoftWebApp20\
110 xcopy /y WizardTest.skin App_Themes\Theme1\
111 xcopy /y Theme1.skin App_Themes\Theme1\
112 xcopy /y Theme2.skin App_Themes\Theme2\
113 xcopy /y ResolveUrl.ascx Folder\
115 for %%i in (*.as*) DO sed "s/CodeFile=/CodeBehind=/" %%i > XXX\%%i
120 msbuild %TEST_SOLUTION% /t:%BUILD_OPTION% /p:Configuration=%PROJECT_CONFIGURATION% >>%BUILD_LOG% 2<&1
121 IF %ERRORLEVEL% NEQ 0 GOTO BUILD_EXCEPTION
123 REM ********************************************************
124 @echo Deploying GH solution to tomcat...
125 REM ********************************************************
126 IF NOT DEFINED VMW_BUILDER GOTO MSBUILD_DEPLOY
127 set CATALINA_HOME=%VMW_HOME%\jakarta-tomcat
128 call "%VMW_HOME%\jakarta-tomcat\bin\shutdown.bat"
129 echo Waiting 5 sec for tomcat to stop....
130 @ping 127.0.0.1 -n 5 -w 1000 > nul
131 del /q "%VMW_HOME%\jakarta-tomcat\webapps\MainsoftWebApp20.war"
132 rmdir /s /q "%VMW_HOME%\jakarta-tomcat\webapps\MainsoftWebApp20"
133 xcopy /Y Test\mainsoft\MainsoftWebApp20\bin\%PROJECT_CONFIGURATION%\MainsoftWebApp20.war "%VMW_HOME%\jakarta-tomcat\webapps"
134 call "%VMW_HOME%\jakarta-tomcat\bin\startup.bat"
135 echo Waiting 5 sec for tomcat to start....
136 @ping 127.0.0.1 -n 5 -w 1000 > nul
139 echo msbuild %DEPLOY_PROJECT% /t:Deploy /p:Configuration=%PROJECT_CONFIGURATION% /p:Platform=AnyCPU >>%BUILD_LOG%
140 msbuild %DEPLOY_PROJECT% /t:Deploy /p:Configuration=%PROJECT_CONFIGURATION% /p:Platform=AnyCPU >>%BUILD_LOG% 2<&1
143 IF %ERRORLEVEL% NEQ 0 GOTO BUILD_EXCEPTION
145 IF "%BUILD_OPTION%"=="nobuild" GOTO RUN
147 REM ********************************************************
148 @echo Building NUnit solution...
149 REM ********************************************************
151 if "%NUNIT_BUILD%" == "DONE" goto NUNITSKIP
152 msbuild %NUNIT_PATH%\nunit20.java.sln /t:%BUILD_OPTION% /p:configuration=%PROJECT_CONFIGURATION% >>%BUILD_LOG% 2<&1
157 echo Skipping NUnit Build...
162 IF %ERRORLEVEL% NEQ 0 GOTO BUILD_EXCEPTION
165 REM ********************************************************
166 @echo Running GH tests...
167 REM ********************************************************
169 REM ********************************************************
170 @echo Running fixture "%RUNNING_FIXTURE%"
171 REM ********************************************************
173 copy Test\bin\%PROJECT_CONFIGURATION%\%TEST_ASSEMBLY% .
176 "%JAVA_HOME%\bin\java" -Xmx1024M -XX:MaxPermSize=128m -cp %CLASSPATH% NUnit.Console.ConsoleUi %TEST_ASSEMBLY% %NUNIT_OPTIONS% /xml=%GH_OUTPUT_XML% >>%RUN_LOG% 2<&1
179 IF NOT DEFINED VMW_BUILDER GOTO DONT_SHUTDOWN_TOMCAT
180 set CATALINA_HOME=%VMW_HOME%\jakarta-tomcat
181 call "%VMW_HOME%\jakarta-tomcat\bin\shutdown.bat"
182 :DONT_SHUTDOWN_TOMCAT
184 REM ********************************************************
186 REM ********************************************************
187 set XML_TOOL_PATH=..\..\tools\mono-xmltool
189 if "%XMLTOOL_BUILD%" == "DONE" goto XMLTOOLSKIP
191 msbuild %XML_TOOL_PATH%\XmlTool20.csproj /t:%BUILD_OPTION% /p:Configuration=%PROJECT_CONFIGURATION% >>%BUILD_LOG% 2<&1
193 IF %ERRORLEVEL% NEQ 0 GOTO BUILD_EXCEPTION
198 echo Skipping XmlToll build...
201 set XMLTOOL_BUILD=DONE
203 copy %XML_TOOL_PATH%\bin\%PROJECT_CONFIGURATION%\xmltool.exe .
204 copy %XML_TOOL_PATH%\nunit_transform.xslt .
206 REM ********************************************************
207 @echo Analyze and print results
208 REM ********************************************************
210 xmltool.exe --transform nunit_transform.xslt %GH_OUTPUT_XML%
216 :ENVIRONMENT_EXCEPTION
217 @echo This test requires environment variable VMW_HOME to be defined
221 @echo Error in building solutions. See %BUILD_LOG% for details...
226 @echo Error in running fixture %RUNNING_FIXTURE%. See %RUN_LOG% for details...
231 @echo Parameters: "[build|rebuild] <output_file_name_prefix> <test_fixture> <relative_Working_directory> <back_path (..\..\.....) >"
237 copy %GH_OUTPUT_XML% ..\