Skip to content

Commit

Permalink
AS7-6476 Fix (existing) testcases to explicitly specify missing-metho…
Browse files Browse the repository at this point in the history
…d-permissions-deny-access configuration, wherever applicable
  • Loading branch information
jaikiran authored and bstansberry committed Feb 9, 2013
1 parent 1a99daf commit 33c2c1e
Show file tree
Hide file tree
Showing 21 changed files with 223 additions and 8 deletions.
Expand Up @@ -91,6 +91,7 @@ public class EjbJarRuntimeResourceTestBase {
public static Archive<?> getEJBJar() {
JavaArchive jar = ShrinkWrap.create(JavaArchive.class, JAR_NAME);
jar.addPackage(EjbJarRuntimeResourcesTestCase.class.getPackage());
jar.addAsManifestResource(EjbJarRuntimeResourcesTestCase.class.getPackage(), "jboss-ejb3.xml", "jboss-ejb3.xml");
return jar;
}

Expand Down
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ JBoss, Home of Professional Open Source.
~ Copyright 2013, Red Hat, Inc., and individual contributors
~ as indicated by the @author tags. See the copyright.txt file in the
~ distribution for a full listing of individual contributors.
~
~ This is free software; you can redistribute it and/or modify it
~ under the terms of the GNU Lesser General Public License as
~ published by the Free Software Foundation; either version 2.1 of
~ the License, or (at your option) any later version.
~
~ This software is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
~ Lesser General Public License for more details.
~
~ You should have received a copy of the GNU Lesser General Public
~ License along with this software; if not, write to the Free
~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<jboss:jboss
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:jboss="http://www.jboss.com/xml/ns/javaee"
xmlns:s="urn:security:1.1"
version="3.1" impl-version="2.0">

<assembly-descriptor>
<s:security>
<ejb-name>*</ejb-name>
<s:missing-method-permissions-deny-access>false</s:missing-method-permissions-deny-access>
</s:security>
</assembly-descriptor>
</jboss:jboss>
Expand Up @@ -85,6 +85,7 @@ public static Archive<JavaArchive> testAppDeployment(final Logger LOG, final Str
//.addClass(Util.class)
//.addClass(SecurityTest.class)
.addAsManifestResource("ejb3/security/EMPTY_MANIFEST.MF", "MANIFEST.MF");
jar.addAsManifestResource(SB_TO_TEST.getPackage(), "jboss-ejb3.xml", "jboss-ejb3.xml");
jar.addPackage(CommonCriteria.class.getPackage());
LOG.info(jar.toString(true));
return jar;
Expand Down
Expand Up @@ -98,6 +98,7 @@ public static Archive<?> deployment() {
.addAsResource("ejb3/security/roles.properties", "roles.properties")
.addAsWebInfResource("ejb3/security/web.xml", "web.xml")
.addAsWebInfResource("ejb3/security/jboss-web.xml", "jboss-web.xml")
.addAsWebInfResource(AuthenticationTestCase.class.getPackage(), "jboss-ejb3.xml", "jboss-ejb3.xml")
.addAsManifestResource(new StringAsset("Manifest-Version: 1.0\nDependencies: org.jboss.as.controller-client,org.jboss.dmr\n"), "MANIFEST.MF");
war.addPackage(CommonCriteria.class.getPackage());
log.info(war.toString(true));
Expand Down
Expand Up @@ -65,6 +65,7 @@ public static JavaArchive createDeployment() {
final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "ejb-security-test.jar");
jar.addPackage(AnnotatedSLSB.class.getPackage());
jar.addAsManifestResource("ejb/security/ejb-jar.xml", "ejb-jar.xml");
jar.addAsManifestResource(EJBSecurityTestCase.class.getPackage(), "jboss-ejb3.xml", "jboss-ejb3.xml");
jar.addPackage(CommonCriteria.class.getPackage());
return jar;
}
Expand Down
Expand Up @@ -80,6 +80,7 @@ public static Archive<?> runAsDeployment() {
.addAsResource("ejb3/security/users.properties", "users.properties")
.addAsResource("ejb3/security/roles.properties", "roles.properties")
.addAsWebInfResource("ejb3/security/jboss-web.xml", "jboss-web.xml")
.addAsWebInfResource(LifecycleTestCase.class.getPackage(), "jboss-ejb3.xml", "jboss-ejb3.xml")
.addAsManifestResource(new StringAsset("Manifest-Version: 1.0\nDependencies: org.jboss.as.controller-client,org.jboss.dmr\n"), "MANIFEST.MF");
war.addPackage(CommonCriteria.class.getPackage());
log.info(war.toString(true));
Expand Down
Expand Up @@ -77,15 +77,12 @@ public class MDBRoleTestCase {
public static Archive<?> deployment() {
final JavaArchive deployment = ShrinkWrap.create(JavaArchive.class, "ejb3mdb.jar")
.addClass(MDBRole.class)

.addClass(CreateQueueSetupTask.class)
.addClasses(AbstractSecurityDomainSetup.class, EjbSecurityDomainSetup.class)

.addClass(Simple.class)
.addClass(SimpleSLSB.class)

.addClass(TimeoutUtil.class);

deployment.addAsManifestResource(MDBRoleTestCase.class.getPackage(), "jboss-ejb3.xml", "jboss-ejb3.xml");
deployment.addPackage(CommonCriteria.class.getPackage());
return deployment;
}
Expand Down
Expand Up @@ -69,6 +69,7 @@ public static Archive<?> runAsDeployment() {
.addClass(RunAsPrincipalTestCase.class)
.addClass(Base64.class)
.addClasses(AbstractSecurityDomainSetup.class, EjbSecurityDomainSetup.class)
.addAsWebInfResource(RunAsPrincipalTestCase.class.getPackage(), "jboss-ejb3.xml", "jboss-ejb3.xml")
.addAsManifestResource(new StringAsset("Dependencies: org.jboss.as.controller-client,org.jboss.dmr\n"),"MANIFEST.MF");
war.addPackage(CommonCriteria.class.getPackage());
log.info(war.toString(true));
Expand Down
Expand Up @@ -135,6 +135,7 @@ public static Archive<?> deploymentSingleton() {
final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "single.jar")
.addClass(TestResultsSingleton.class)
.addClass(ITestResultsSingleton.class)
.addAsManifestResource(GetCallerPrincipalTestCase.class.getPackage(), "jboss-ejb3.xml", "jboss-ejb3.xml")
.addAsManifestResource(GetCallerPrincipalTestCase.class.getPackage(), "MANIFEST.MF-single", "MANIFEST.MF");
jar.addPackage(CommonCriteria.class.getPackage());
log.info(jar.toString(true));
Expand All @@ -148,7 +149,8 @@ public static Archive<?> deploymentSlsb() {
.addClass(IBeanLifecycleCallback.class)
.addAsResource(GetCallerPrincipalTestCase.class.getPackage(), "users.properties", "users.properties")
.addAsResource(GetCallerPrincipalTestCase.class.getPackage(), "roles.properties", "roles.properties")
.addAsManifestResource(GetCallerPrincipalTestCase.class.getPackage(), "MANIFEST.MF-bean", "MANIFEST.MF") ;
.addAsManifestResource(GetCallerPrincipalTestCase.class.getPackage(), "jboss-ejb3.xml", "jboss-ejb3.xml")
.addAsManifestResource(GetCallerPrincipalTestCase.class.getPackage(), "MANIFEST.MF-bean", "MANIFEST.MF");
jar.addPackage(CommonCriteria.class.getPackage());
log.info(jar.toString(true));
return jar;
Expand All @@ -161,6 +163,7 @@ public static Archive<?> deploymentSfsb() {
.addClass(IBeanLifecycleCallback.class)
.addAsResource(GetCallerPrincipalTestCase.class.getPackage(), "users.properties", "users.properties")
.addAsResource(GetCallerPrincipalTestCase.class.getPackage(), "roles.properties", "roles.properties")
.addAsManifestResource(GetCallerPrincipalTestCase.class.getPackage(), "jboss-ejb3.xml", "jboss-ejb3.xml")
.addAsManifestResource(GetCallerPrincipalTestCase.class.getPackage(), "MANIFEST.MF-bean", "MANIFEST.MF");
jar.addPackage(CommonCriteria.class.getPackage());
log.info(jar.toString(true));
Expand All @@ -173,6 +176,7 @@ public static Archive<?> deploymentMdb() {
.addClass(MDBLifecycleCallback.class)
.addAsResource(GetCallerPrincipalTestCase.class.getPackage(), "users.properties", "users.properties")
.addAsResource(GetCallerPrincipalTestCase.class.getPackage(), "roles.properties", "roles.properties")
.addAsManifestResource(GetCallerPrincipalTestCase.class.getPackage(), "jboss-ejb3.xml", "jboss-ejb3.xml")
.addAsManifestResource(GetCallerPrincipalTestCase.class.getPackage(), "MANIFEST.MF-bean", "MANIFEST.MF") ;
jar.addPackage(CommonCriteria.class.getPackage());
log.info(jar.toString(true));
Expand All @@ -186,6 +190,7 @@ public static Archive<?> deploymentEntityBean() {
.addClass(EntityBeanHome.class)
.addClass(EntityBean.class)
.addAsManifestResource(GetCallerPrincipalTestCase.class.getPackage(), "MANIFEST.MF-bean", "MANIFEST.MF")
.addAsManifestResource(GetCallerPrincipalTestCase.class.getPackage(), "jboss-ejb3.xml", "jboss-ejb3.xml")
.addAsManifestResource(GetCallerPrincipalTestCase.class.getPackage(), "ejb-jar.xml", "ejb-jar.xml");
jar.addPackage(CommonCriteria.class.getPackage());
log.info(jar.toString(true));
Expand All @@ -205,6 +210,7 @@ public static Archive<?> deployment() {
.addPackage(AbstractMgmtTestBase.class.getPackage()).addClasses(MgmtOperationException.class, XMLElementReader.class, XMLElementWriter.class)
.addAsResource(GetCallerPrincipalTestCase.class.getPackage(), "users.properties", "users.properties")
.addAsResource(GetCallerPrincipalTestCase.class.getPackage(), "roles.properties", "roles.properties")
.addAsManifestResource(GetCallerPrincipalTestCase.class.getPackage(), "jboss-ejb3.xml", "jboss-ejb3.xml")
.addAsManifestResource(GetCallerPrincipalTestCase.class.getPackage(), "MANIFEST.MF-test", "MANIFEST.MF");
jar.addPackage(CommonCriteria.class.getPackage());
log.info(jar.toString(true));
Expand Down
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ JBoss, Home of Professional Open Source.
~ Copyright 2013, Red Hat, Inc., and individual contributors
~ as indicated by the @author tags. See the copyright.txt file in the
~ distribution for a full listing of individual contributors.
~
~ This is free software; you can redistribute it and/or modify it
~ under the terms of the GNU Lesser General Public License as
~ published by the Free Software Foundation; either version 2.1 of
~ the License, or (at your option) any later version.
~
~ This software is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
~ Lesser General Public License for more details.
~
~ You should have received a copy of the GNU Lesser General Public
~ License along with this software; if not, write to the Free
~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<jboss:jboss
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:jboss="http://www.jboss.com/xml/ns/javaee"
xmlns:s="urn:security:1.1"
version="3.1" impl-version="2.0">

<assembly-descriptor>
<s:security>
<ejb-name>*</ejb-name>
<s:missing-method-permissions-deny-access>false</s:missing-method-permissions-deny-access>
</s:security>
</assembly-descriptor>
</jboss:jboss>
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<jboss:jboss
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:jboss="http://www.jboss.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:s="urn:security:1.1"
version="3.1" impl-version="2.0">

<assembly-descriptor>
<s:security>
<ejb-name>*</ejb-name>
<s:missing-method-permissions-deny-access>false</s:missing-method-permissions-deny-access>
</s:security>
</assembly-descriptor>
</jboss:jboss>
Expand Up @@ -84,6 +84,7 @@ public static Archive createDeployment() {
final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, MODULE_NAME + ".jar");
jar.addClasses(BeanInterface.class,FirstBean.class, SecondBean.class);
jar.addPackage(CommonCriteria.class.getPackage());
jar.addAsManifestResource(JBossAppXMLSecurityTestCase.class.getPackage(), "jboss-ejb3.xml", "jboss-ejb3.xml");

logger.info(jar.toString(true));

Expand Down
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ JBoss, Home of Professional Open Source.
~ Copyright 2013, Red Hat, Inc., and individual contributors
~ as indicated by the @author tags. See the copyright.txt file in the
~ distribution for a full listing of individual contributors.
~
~ This is free software; you can redistribute it and/or modify it
~ under the terms of the GNU Lesser General Public License as
~ published by the Free Software Foundation; either version 2.1 of
~ the License, or (at your option) any later version.
~
~ This software is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
~ Lesser General Public License for more details.
~
~ You should have received a copy of the GNU Lesser General Public
~ License along with this software; if not, write to the Free
~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<jboss:jboss
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:jboss="http://www.jboss.com/xml/ns/javaee"
xmlns:s="urn:security:1.1"
version="3.1" impl-version="2.0">

<assembly-descriptor>
<s:security>
<ejb-name>*</ejb-name>
<s:missing-method-permissions-deny-access>false</s:missing-method-permissions-deny-access>
</s:security>
</assembly-descriptor>
</jboss:jboss>
Expand Up @@ -7,7 +7,6 @@
version="3.1" impl-version="2.0">

<assembly-descriptor>
<!-- Map the role to the principal -->
<s:security>
<ejb-name>*</ejb-name>
<s:missing-method-permissions-deny-access>false</s:missing-method-permissions-deny-access>
Expand Down
Expand Up @@ -7,7 +7,6 @@
version="3.1" impl-version="2.0">

<assembly-descriptor>
<!-- Map the role to the principal -->
<s:security>
<ejb-name>*</ejb-name>
<s:missing-method-permissions-deny-access>true</s:missing-method-permissions-deny-access>
Expand Down
Expand Up @@ -96,6 +96,7 @@ public static Archive<?> runAsDeployment() {
.addAsResource("ejb3/security/roles.properties", "roles.properties")
.addAsWebInfResource("ejb3/security/web.xml", "web.xml")
.addAsWebInfResource("ejb3/security/jboss-web.xml", "jboss-web.xml")
.addAsWebInfResource(RunAsTestCase.class.getPackage(), "jboss-ejb3.xml", "jboss-ejb3.xml")
.addAsManifestResource(new StringAsset("Manifest-Version: 1.0\nDependencies: org.jboss.as.controller-client,org.jboss.dmr\n"), "MANIFEST.MF");
war.addPackage(CommonCriteria.class.getPackage());
log.info(war.toString(true));
Expand Down
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ JBoss, Home of Professional Open Source.
~ Copyright 2013, Red Hat, Inc., and individual contributors
~ as indicated by the @author tags. See the copyright.txt file in the
~ distribution for a full listing of individual contributors.
~
~ This is free software; you can redistribute it and/or modify it
~ under the terms of the GNU Lesser General Public License as
~ published by the Free Software Foundation; either version 2.1 of
~ the License, or (at your option) any later version.
~
~ This software is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
~ Lesser General Public License for more details.
~
~ You should have received a copy of the GNU Lesser General Public
~ License along with this software; if not, write to the Free
~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<jboss:jboss
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:jboss="http://www.jboss.com/xml/ns/javaee"
xmlns:s="urn:security:1.1"
version="3.1" impl-version="2.0">

<assembly-descriptor>
<s:security>
<ejb-name>*</ejb-name>
<s:missing-method-permissions-deny-access>false</s:missing-method-permissions-deny-access>
</s:security>
</assembly-descriptor>
</jboss:jboss>
Expand Up @@ -98,6 +98,7 @@ public static Archive<?> deploy() {
.addClass(JmsQueueSetup.class)
.addAsResource(RunAsMDBUnitTestCase.class.getPackage(), "users.properties", "users.properties")
.addAsResource(RunAsMDBUnitTestCase.class.getPackage(), "roles.properties", "roles.properties");
jar.addAsManifestResource(RunAsMDBUnitTestCase.class.getPackage(), "jboss-ejb3.xml", "jboss-ejb3.xml");
jar.addAsManifestResource(new StringAsset("Dependencies: org.jboss.as.controller-client,org.jboss.dmr \n"), "MANIFEST.MF");
jar.addPackage(CommonCriteria.class.getPackage());
log.info(jar.toString(true));
Expand Down
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ JBoss, Home of Professional Open Source.
~ Copyright 2013, Red Hat, Inc., and individual contributors
~ as indicated by the @author tags. See the copyright.txt file in the
~ distribution for a full listing of individual contributors.
~
~ This is free software; you can redistribute it and/or modify it
~ under the terms of the GNU Lesser General Public License as
~ published by the Free Software Foundation; either version 2.1 of
~ the License, or (at your option) any later version.
~
~ This software is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
~ Lesser General Public License for more details.
~
~ You should have received a copy of the GNU Lesser General Public
~ License along with this software; if not, write to the Free
~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<jboss:jboss
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:jboss="http://www.jboss.com/xml/ns/javaee"
xmlns:s="urn:security:1.1"
version="3.1" impl-version="2.0">

<assembly-descriptor>
<s:security>
<ejb-name>*</ejb-name>
<s:missing-method-permissions-deny-access>false</s:missing-method-permissions-deny-access>
</s:security>
</assembly-descriptor>
</jboss:jboss>
Expand Up @@ -24,10 +24,15 @@
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:jboss="http://www.jboss.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:s="urn:security" xmlns:sr="urn:security-role"
xmlns:s="urn:security:1.1" xmlns:sr="urn:security-role"
version="3.1" impl-version="2.0">

<assembly-descriptor>
<s:security>
<ejb-name>*</ejb-name>
<s:missing-method-permissions-deny-access>false</s:missing-method-permissions-deny-access>
</s:security>

<!-- Map the role to the principal -->
<sr:security-role>
<sr:role-name>RealRole</sr:role-name>
Expand Down

0 comments on commit 33c2c1e

Please sign in to comment.