[jboss-jira] [JBoss JIRA] Commented: (JBAS-4286) users.properties file not being correctly located in CustomSecurityManagerTestCase

Richard Achmatowicz (JIRA) jira-events at lists.jboss.org
Tue Apr 10 13:06:58 EDT 2007


    [ http://jira.jboss.com/jira/browse/JBAS-4286?page=comments#action_12358810 ] 
            
Richard Achmatowicz commented on JBAS-4286:
-------------------------------------------

1. I changed the test case setup code from this:
    <!-- Replace the security manager classname -->
    <replace file="${jboss.dist}/server/custom-securitymgr/conf/jboss-service.xml">
      <replacetoken><![CDATA[<attribute name="SecurityManagerClassName">org.jboss.security.plugins.JaasSecurityManager</attribute>]]>
      </replacetoken>
      <replacevalue><![CDATA[<attribute name="SecurityManagerClassName">org.jboss.test.security.test.CustomSecurityManager</attribute>]]>
      </replacevalue>
    </replace>

to this:
 <replace file="${jboss.dist}/server/custom-securitymgr/conf/jboss-service.xml"
   token="&lt;attribute name=&quot;SecurityManagerClassName&quot;&gt;org.jboss.security.plugins.JaasSecurityManager&lt;/attribute&gt;"
   value="&lt;attribute name=&quot;SecurityManagerClassName&quot;&gt;org.jboss.test.security.test.CustomSecurityManager&lt;/attribute&gt;"
   />

and the tests passed. Upon inspection of jboss-service.xml, the replacement did work correctly.

Thus, one way to fix this problem would be to use the non-multiline version of the replace command in place of the multiline version.
I have only tested this on Windows, but as there is another <replace/> task in the build.xml file which operates in the same way, I expect there  will be no problems. 

2. I would also consider removing the lines 
    <waitfor maxwait="60" maxwaitunit="second" checkevery="5" checkeveryunit="second" timeoutproperty="startup.timeout">
      <http url="http://${node0}:8080/"/>
    </waitfor>
    <fail message="Timeout waiting for server to start" if="startup.timeout"/>
from this testcase. These tasks cause the build to wait 60 seconds for server startup and then fails the build if the Tomcat instance does not respond within that time. 

Timeout checking on server startup is already being perfortmed by server:start, and with a different timeout value, which we can adjust using a system property in case we are running the testsuite on slower machines. This specific timeout check is therefore not required.




 


 

> users.properties file not being correctly located in CustomSecurityManagerTestCase
> ----------------------------------------------------------------------------------
>
>                 Key: JBAS-4286
>                 URL: http://jira.jboss.com/jira/browse/JBAS-4286
>             Project: JBoss Application Server
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: Security
>    Affects Versions: JBossAS-4.2.0.CR1
>         Environment: Windows 2003, x86_64, x86, BEA JVM
>            Reporter: Richard Achmatowicz
>         Assigned To: Anil Saldhana
>         Attachments: output.log, server.log
>
>
> The following tests are failing due to a common error:
> testGetCallerPrinciple, testStatefulCreateCaller, testMethodAccess, testDomainMethodAccess
> testMethodAccess2, testLocalMethodAccess, testUncheckedRemote, testRemoteUnchecked, testUnchecked
> testUncheckedWithLogin, testExcluded, testRunAs, testDeepRunAs
> and others
> The common error is:
> Suite: org.jboss.test.security.test.CustomSecurityManagerTestCase(custom-secmgr)
> Test: testDomainMethodAccess
> Type: error
> Exception: java.rmi.AccessException
> Message: SecurityException; nested exception is: javax.security.auth.login.LoginException: Missing users.properties file.
> ---------------------------------
> The test case CunstomSecurityManagerTestCase is a subclass of the test case EJBSpecUnitTestCase.
> EJBSpecUnitTestCase deploys the jar security-spec.jar which contains users.properties and roles.properties files, but these seem not to be located.
> From the output.log, it seems that the security-spec.jar is not being deployed before the custom-secmgrtests.ear. I have attached the log. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list