Testing environment
Last update: Jan-06-2006
Test environment is quite simple:
- Download sources and unpack them into a directory of your choice, please note that subdirectory hb-beyond-hw will be created automatically.
- We need a JDK ;
- We need Ant;
- We need to add ant dependencies task library to $ANT_HOME/lib directory. That is pathed version of Maven dependencies task for Ant. More about using artifacts repositories in Ant please read here
- Start Postgres RDBMS and create database.
Then we also need to start Postgres database server and create bhw database there that will belong to user 'dbuser' with password 'dbuser', also we will need additional 'dbuser2' with password 'dbuser2' to be able to run Hibernate session virtualization case. This can be done manually from command line, or from admin UI. If your system is Windows then DB creation looks like this:
That is is all we need to do manually DB wise. Creation DB objects and populating them with necessary data is handled by individual test cases.
- We need to setup runtime environment. For MSWin batch file (setenv.bat ) might look like this:
set JAVA_HOME=C:\jdk1.5.0_06
rem we can use JDK 1.4
rem JAVA_HOME=C:\j2sdk1.4.2_06
set ANT_HOME=C:\app\java\app\apache-ant-1.6.5
set PATH=%JAVA_HOME%\bin;%ANT_HOME%\bin;%PATH%
start
Double click on the file will launch a new command window, which have proper environment. There we will navigate to hb-beyond-hw directory and type ant this will cause all the necessary files being downloaded to you computer and cached in the $HOME/.m2/repository directory. Note: duration of this initial invocation can be lengthy, and it depends on connection speed.
C:\dev\sl\hb-beyond-hw>ant
Buildfile: build.xml
Downloading: postgresql/postgresql/8.1-404.jdbc3/postgresql-8.1-404.jdbc3.pom
[WARNING] Unable to get resource from repository sourcelabs (http://dist.sourcelabs.com/sash/repo/)
Downloading: postgresql/postgresql/8.1-404.jdbc3/postgresql-8.1-404.jdbc3.pom
Transferring 0K
Downloading: org/hibernate/hibernate/3.0.5-2/hibernate-3.0.5-2.pom
Transferring 1K
[INFO] artifact org.apache.commons:commons-collections: checking for updates from sourcelabs
[INFO] artifact org.apache.commons:commons-collections: checking for updates from default-remote
Downloading: org/apache/commons/commons-collections/3.1-1/commons-collections-3.1-1.pom
Transferring 0K
[INFO] artifact org.apache.commons:commons-logging: checking for updates from sourcelabs
[INFO] artifact org.apache.commons:commons-logging: checking for updates from default-remote
Downloading: org/apache/commons/commons-logging/1.0.4-1/commons-logging-1.0.4-1.pom
Transferring 0K
[INFO] artifact org.apache.log4j:log4j: checking for updates from sourcelabs
[INFO] artifact org.apache.log4j:log4j: checking for updates from default-remote
Downloading: org/apache/log4j/log4j/1.2.12-1/log4j-1.2.12-1.pom
Transferring 0K
[......
.......
.......
.......
Transferring 275K
Downloading: org/springframework/spring/1.2.6-1/spring-1.2.6-1.jar
Transferring 1842K
clean:
[delete] Deleting 119 files from C:\dev\sl\hb-beyond-hw\build
[delete] Deleted 22 directories from C:\dev\sl\hb-beyond-hw\build
build:
[mkdir] Created dir: C:\dev\sl\hb-beyond-hw\build\classes
[javac] Compiling 43 source files to C:\dev\sl\hb-beyond-hw\build\classes
[copy] Copying 38 files to C:\dev\sl\hb-beyond-hw\build\classes
all:
[copy] Copying 32 files to C:\dev\sl\hb-beyond-hw\build\libs
[echo] Now you can see all the runtime dependencies in the build.libs directory.
[echo] Please run "ant -projecthelp" to see all the useful targets
[echo]
BUILD SUCCESSFUL
Total time: 1 minute 29 seconds
C:\dev\sl\hb-beyond-hw>
Now we are ready to run tests, as the last message in the suggests we can run ant -projecthelp and it will give us list of available tests:
C:\dev\sl\hb-beyond-hw>ant -projecthelp
Buildfile: build.xml
Main targets:
archive Create source archive
build build test classes
clean purge all the deliverables
test-fetch-strategies run Fetch Strategies test
test-gotchas run Hibernate gotcha test
test-haop run Hibernate with AOP test
test-ibatis-coop run Hibernate and iBatis cooperation test
test-sql run SQL cooperation test
Default target: all
|