Author: pete.muir(a)jboss.org
Date: 2009-08-07 14:02:55 -0400 (Fri, 07 Aug 2009)
New Revision: 3407
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/security/
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/security/SecurityTest.java
Modified:
ri/trunk/tests/unit-tests.xml
Log:
Add security test to validate an assumption about setAccessible
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/security/SecurityTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/security/SecurityTest.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/security/SecurityTest.java 2009-08-07
18:02:55 UTC (rev 3407)
@@ -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();
+ }
+
+}
Property changes on:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/security/SecurityTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/tests/unit-tests.xml
===================================================================
--- ri/trunk/tests/unit-tests.xml 2009-08-07 18:01:19 UTC (rev 3406)
+++ ri/trunk/tests/unit-tests.xml 2009-08-07 18:02:55 UTC (rev 3407)
@@ -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" />
@@ -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>