You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by us...@apache.org on 2015/07/02 23:08:58 UTC

svn commit: r1688913 - /lucene/dev/branches/branch_5x/lucene/core/src/test/org/apache/lucene/util/TestAttributeSource.java

Author: uschindler
Date: Thu Jul  2 21:08:58 2015
New Revision: 1688913

URL: http://svn.apache.org/r1688913
Log:
LUCENE-6651: Remove test completely: Cannot work (inner doPrivileged reverts back to codebase granted permissions; no idea why it worked for me)

Modified:
    lucene/dev/branches/branch_5x/lucene/core/src/test/org/apache/lucene/util/TestAttributeSource.java

Modified: lucene/dev/branches/branch_5x/lucene/core/src/test/org/apache/lucene/util/TestAttributeSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/lucene/core/src/test/org/apache/lucene/util/TestAttributeSource.java?rev=1688913&r1=1688912&r2=1688913&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/lucene/core/src/test/org/apache/lucene/util/TestAttributeSource.java (original)
+++ lucene/dev/branches/branch_5x/lucene/core/src/test/org/apache/lucene/util/TestAttributeSource.java Thu Jul  2 21:08:58 2015
@@ -20,9 +20,6 @@ package org.apache.lucene.util;
 import org.apache.lucene.analysis.Token;
 import org.apache.lucene.analysis.tokenattributes.*;
 
-import java.lang.reflect.ReflectPermission;
-import java.security.AccessControlException;
-import java.security.PrivilegedExceptionAction;
 import java.util.HashMap;
 import java.util.Iterator;
 
@@ -183,7 +180,6 @@ public class TestAttributeSource extends
   
   @SuppressWarnings("unused")
   static final class OnlyReflectAttributeImpl extends AttributeImpl implements TypeAttribute {
-    
     private String field1 = "foo";
     private int field2 = 4711;
     private static int x = 0;
@@ -204,7 +200,6 @@ public class TestAttributeSource extends
 
     @Override
     public void copyTo(AttributeImpl target) {}
-    
   }
   
   public void testBackwardsCompatibilityReflector() throws Exception {
@@ -215,22 +210,4 @@ public class TestAttributeSource extends
     }});    
   }
   
-  /* For now disable this...
-  public void testBackwardsCompatibilityReflectorWithoutRights() throws Exception {
-    try {
-      runWithRestrictedPermissions(new PrivilegedExceptionAction<Void>() {
-        @Override
-        public Void run() throws Exception {
-          testBackwardsCompatibilityReflector();
-          return null; // Void
-        }
-      }, new RuntimePermission("*"));
-      fail("Should not run successfully because private field access is denied by policy.");
-    } catch (AccessControlException e) {
-      assertTrue(e.getPermission() instanceof ReflectPermission);
-      assertEquals("suppressAccessChecks", e.getPermission().getName());
-    }
-  }
-  */
-  
 }