By ByronNevins on Mar 23, 2011
Recently a colleague added a test to the Admin Development Tests. This is a huge suite of tests that we developers use as a sanity test that exercise the administration of a running GlassFish server.
here is the symptom of the problem -
The test failed on her machine.
The test failed on my machine
The test succeeded on the Hudson build that runs it automatically -- it passed 100% of the time
I finally tracked this problem down today with the help of an invaluable tool for asadmin. I always set this variable in my environment:
When this is set -- every asadmin command is written into the logfile. It includes the full command with all arguments, the time-stamp and the return value.
I quickly figured out the problem by looking in this file on my platform, Windows, and on the Hudson platform, Linux. Here it is:
Command inside the test itself: asadmin list -m \*
Command inside cli.log
03/22/2011 21:55:27 EXIT: 1 asadmin --user admin --passwordfile D:\\gf\\v2\\appserv-tests/config/adminpassword.txt --host localhost --port 4848 --echo=true --terse=true list -m .svn apps build build.xml byron derby.log dome.bat foo foo2 foo2.bat hudson.sh Jira.java mon.bat nbproject pom.xml q qqq resources seconddb src
OOPS!! The star is special in Windows calling the asadmin script -- even from Runtime.exec(). The star was replaced with the names of every file that happened to be sitting in the directory that the tests are running in.
Solution: In the code use "\\"\*\\"" for Windows and '\*' otherwise