FYI, I'd rather add a resolveFile() and resolvePath() to TestSupport so that tests don't need to muck with File().getPath() and such.

--jason


On Aug 31, 2006, at 12:48 PM, Jason Dillon wrote:

No, the BASEDIR rooting is important, as we can not always control the basedir that the tests are executed from. Tests are not just run from maven, but also from IDE's.

It is a good practice to always root your files in tests... and this is why I changed them to use BASEDIR.

--jason


On Aug 31, 2006, at 6:00 AM, anita kulshreshtha wrote:

   I have always wondered why we need to do this:
 File auditlog = new File(BASEDIR, "target/login-audit.log");
instead of
File auditlog = new File("target/login-audit.log");

The relative file references in java are resolved using the current
user dir, given by the system property user.dir, and is typically the
directory in which the Java virtual machine was invoked.
The <workingDirectory> specifies the dir the jvm is forked from. If
it is set to {basedir}/target by default, then all the tests should
just use:
File auditlog = new File("login-audit.log");
   This is the most natural way. WDYT?

Thanks
Anita

--- "Jason Dillon (JIRA)" <dev@geronimo.apache.org> wrote:

     [ http://issues.apache.org/jira/browse/GERONIMO-2211?page=all ]

Jason Dillon closed GERONIMO-2211.
----------------------------------

    Resolution: Fixed

Thanks Anita for pointing out that it works with basedir, the
reference to the login-audit.log was not being rooted with BASEDIR.

Looks okay now, so I'm enabling this test again.

Enable tests (geronimo-security :: **/ConfigurationEntryTest.java)
------------------------------------------------------------------

                Key: GERONIMO-2211
                URL:
http://issues.apache.org/jira/browse/GERONIMO-2211
            Project: Geronimo
         Issue Type: Sub-task
     Security Level: public(Regular issues)
   Affects Versions: 1.2
           Reporter: Jason Dillon
        Assigned To: Jason Dillon
            Fix For: 1.2


A few tests failed in non-obvious ways when run under the m2 build.
 Need someone who knows these tests better to inspect, resolve and
enable the test (remove the test exclusions in the pom).
The test fails with (on the console):
{noformat}
DEBUG [main] Starting boot
DEBUG [main] GBeanInstanceState for:
geronimo/boot/none/car?role=kernel State changed from stopped to
starting
DEBUG [main] GBeanInstanceState for:
geronimo/boot/none/car?role=kernel State changed from starting to
running
DEBUG [main] Booted
DEBUG [main] GBeanInstanceState for: test/foo/1/car?name=ServerInfo
State changed from stopped to starting
DEBUG [main] GBeanInstanceState for: test/foo/1/car?name=ServerInfo
State changed from starting to running
DEBUG [main] GBeanInstanceState for:
test/foo/1/car?new=LoginConfiguration State changed from stopped to
starting
DEBUG [main] Installed Geronimo login configuration
DEBUG [main] GBeanInstanceState for:
test/foo/1/car?new=LoginConfiguration State changed from starting to
running
DEBUG [main] GBeanInstanceState for:
test/foo/1/car?name=TestLoginService State changed from stopped to
starting
DEBUG [main] GBeanInstanceState for:
test/foo/1/car?name=TestLoginService State changed from starting to
running
DEBUG [main] GBeanInstanceState for:
test/foo/1/car?name=JaasLoginServiceRemotingServer State changed from
stopped to starting
DEBUG [main] Remote login service started on: tcp://0.0.0.0:4242
clients can connect to: tcp://0.0.0.0:4242
DEBUG [main] GBeanInstanceState for:
test/foo/1/car?name=JaasLoginServiceRemotingServer State changed from
starting to running
DEBUG [main] GBeanInstanceState for:
test/foo/1/car?name=client-ConfigurationEntry State changed from
stopped to starting
DEBUG [main] GBeanInstanceState for:
test/foo/1/car?name=client-ConfigurationEntry State changed from
starting to running
DEBUG [main] Added Application Configuration Entry
properties-client
DEBUG [main] GBeanInstanceState for:
test/foo/1/car?name=PropertiesSecurityRealm State changed from
stopped to starting
DEBUG [main] Waiting to start
test/foo/1/car?name=PropertiesSecurityRealm because no targets are
running for reference LoginModuleConfiguration matching the patterns
test/foo/1/car?name=PropertiesLoginModuleUse
DEBUG [main] GBeanInstanceState for:
test/foo/1/car?name=AuditLoginModule State changed from stopped to
starting
DEBUG [main] GBeanInstanceState for:
test/foo/1/car?name=AuditLoginModule State changed from starting to
running
DEBUG [main] GBeanInstanceState for:
test/foo/1/car?name=AuditLoginModuleUse State changed from stopped to
starting
DEBUG [main] Waiting to start
test/foo/1/car?name=AuditLoginModuleUse because no targets are
running for reference Next matching the patterns
test/foo/1/car?name=UPCredLoginModuleUse
DEBUG [main] GBeanInstanceState for:
test/foo/1/car?name=PropertiesLoginModule State changed from stopped
to starting
DEBUG [main] GBeanInstanceState for:
test/foo/1/car?name=PropertiesLoginModule State changed from starting
to running
DEBUG [main] GBeanInstanceState for:
test/foo/1/car?name=PropertiesLoginModuleUse State changed from
stopped to starting
DEBUG [main] Waiting to start
test/foo/1/car?name=PropertiesLoginModuleUse because no targets are
running for reference Next matching the patterns
test/foo/1/car?name=AuditLoginModuleUse
DEBUG [main] GBeanInstanceState for:
test/foo/1/car?name=UPCredLoginModule State changed from stopped to
starting
DEBUG [main] GBeanInstanceState for:
test/foo/1/car?name=UPCredLoginModule State changed from starting to
running
DEBUG [main] GBeanInstanceState for:
test/foo/1/car?name=UPCredLoginModuleUse State changed from stopped
to starting
DEBUG [main] GBeanInstanceState for:
test/foo/1/car?name=UPCredLoginModuleUse State changed from starting
to running
DEBUG [main] Checking if parent is running:
parent=test/foo/1/car?name=AuditLoginModule
DEBUG [main] Parent is running:
parent=test/foo/1/car?name=AuditLoginModule
DEBUG [main] GBeanInstanceState for:
test/foo/1/car?name=AuditLoginModuleUse State changed from starting
to running
DEBUG [main] Checking if parent is running:
parent=test/foo/1/car?name=PropertiesLoginModule
DEBUG [main] Parent is running:
parent=test/foo/1/car?name=PropertiesLoginModule
DEBUG [main] GBeanInstanceState for:
test/foo/1/car?name=PropertiesLoginModuleUse State changed from
starting to running
DEBUG [main] Checking if parent is running:
parent=test/foo/1/car?name=ServerInfo
DEBUG [main] Parent is running:
parent=test/foo/1/car?name=ServerInfo
DEBUG [main] Checking if parent is running:
parent=test/foo/1/car?name=TestLoginService
DEBUG [main] Parent is running:
parent=test/foo/1/car?name=TestLoginService
DEBUG [main] GBeanInstanceState for:
test/foo/1/car?name=PropertiesSecurityRealm State changed from
starting to running
DEBUG [main] Added Application Configuration Entry properties-realm

DEBUG [main] GBeanInstanceState for:
test/foo/1/car?name=JaasLoginServiceRemotingServer State changed from
running to stopping
DEBUG [main] Stopped remote login service.
DEBUG [main] GBeanInstanceState for:
test/foo/1/car?name=JaasLoginServiceRemotingServer State changed from
stopping to stopped
DEBUG [main] GBeanInstanceState for:
test/foo/1/car?name=PropertiesSecurityRealm State changed from
running to stopping
DEBUG [main] Removed Application Configuration Entry
properties-realm
DEBUG [main] GBeanInstanceState for:
test/foo/1/car?name=PropertiesSecurityRealm State changed from
stopping to stopped
DEBUG [main] GBeanInstanceState for:
test/foo/1/car?name=UPCredLoginModule State changed from running to
stopping
DEBUG [main] Checking if child is running:
child=test/foo/1/car?name=UPCredLoginModuleUse
DEBUG [main] Stopping child:
child=test/foo/1/car?name=UPCredLoginModuleUse
DEBUG [main] GBeanInstanceState for:
test/foo/1/car?name=UPCredLoginModuleUse State changed from running
to stopping
DEBUG [main] Checking if child is running:
child=test/foo/1/car?name=AuditLoginModuleUse
DEBUG [main] Stopping child:
child=test/foo/1/car?name=AuditLoginModuleUse
DEBUG [main] GBeanInstanceState for:
test/foo/1/car?name=AuditLoginModuleUse State changed from running to
stopping
DEBUG [main] Checking if child is running:
child=test/foo/1/car?name=PropertiesLoginModuleUse
DEBUG [main] Stopping child:
child=test/foo/1/car?name=PropertiesLoginModuleUse
DEBUG [main] GBeanInstanceState for:
test/foo/1/car?name=PropertiesLoginModuleUse State changed from
running to stopping
DEBUG [main] GBeanInstanceState for:
test/foo/1/car?name=PropertiesLoginModuleUse State changed from
stopping to stopped
DEBUG [main] Stopped child:
child=test/foo/1/car?name=PropertiesLoginModuleUse
DEBUG [main] GBeanInstanceState for:
test/foo/1/car?name=AuditLoginModuleUse State changed from stopping
to stopped
DEBUG [main] Stopped child:
child=test/foo/1/car?name=AuditLoginModuleUse
DEBUG [main] GBeanInstanceState for:
test/foo/1/car?name=UPCredLoginModuleUse State changed from stopping
to stopped
DEBUG [main] Stopped child:
child=test/foo/1/car?name=UPCredLoginModuleUse
DEBUG [main] GBeanInstanceState for:
test/foo/1/car?name=UPCredLoginModule State changed from stopping to
stopped
=== message truncated ===


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


Reply via email to