Skip to content

Commit

Permalink
Add security test to validate an assumption about setAccessible
Browse files Browse the repository at this point in the history
git-svn-id: http://anonsvn.jboss.org/repos/weld/ri/trunk@3407 1c488680-804c-0410-94cd-c6b725194a0e
  • Loading branch information
pmuir committed Aug 7, 2009
1 parent da790ca commit 0173d3d
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 26 deletions.
@@ -0,0 +1,42 @@
/*
* JBoss, Home of Professional Open Source
* Copyright 2008, Red Hat Middleware LLC, and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.webbeans.test.unit.security;

import java.lang.reflect.Field;

import org.testng.annotations.Test;

/**
* @author pmuir
*
*/
public class SecurityTest
{

private String foo;

@Test
public void testSetAccessibleDoesNotPropagate() throws Exception
{
Field field = SecurityTest.class.getDeclaredField("foo");
assert !field.isAccessible();
field.setAccessible(true);
assert field.isAccessible();
assert !SecurityTest.class.getDeclaredField("foo").isAccessible();
}

}
27 changes: 1 addition & 26 deletions tests/unit-tests.xml
Expand Up @@ -13,35 +13,11 @@
</method-selectors>
<groups>
<run>
<!--
<exclude name="specialization" />
<exclude name="deployment" />
<exclude name="disposalMethod" />
<exclude name="observerMethod" />
<exclude name="deferredEvent" />
<exclude name="ejb3" />
<exclude name="webservice" />
<exclude name="annotationDefinition" />
<exclude name="webbeansxml" />
<exclude name="el" />
<exclude name="jms" />
<exclude name="interceptors" />
<exclude name="decorators" />
<exclude name="servlet" />
<exclude name="passivation" />
<exclude name="singletons" />
<exclude name="ejbjarxml" />
<exclude name="beanDestruction" />
<exclude name="commonAnnotations" />
-->
<exclude name="stub" />
<exclude name="broken" />
</run>
</groups>
<packages>
<!-- <package name="org.jboss.jsr299.tck.tests.implementation.enterprise.lifecycle" />-->
<package name="org.jboss.webbeans.test.examples" />

<package name="org.jboss.webbeans.test.unit.activities" />
Expand Down Expand Up @@ -76,8 +52,7 @@
<package name="org.jboss.webbeans.test.unit.lookup.circular" />
<package name="org.jboss.webbeans.test.unit.lookup.wbri279" />
<package name="org.jboss.webbeans.test.unit.manager" />
<package name="org.jboss.webbeans.test.unit.servlet" />
<package name="org.jboss.webbeans.test.unit.xml.deploy" />
<package name="org.jboss.webbeans.test.unit.security" />
</packages>
</test>

Expand Down

0 comments on commit 0173d3d

Please sign in to comment.