/**
 * 
 */
package org.mozilla.javascript.tests;

import junit.framework.TestCase;

import org.mozilla.javascript.Context;
import org.mozilla.javascript.Scriptable;
import org.mozilla.javascript.ClassShutter;
import org.mozilla.javascript.RhinoException;

/**
 * @author Norris Boyd
 */
public class ClassShutterExceptionTest extends TestCase {
    
    Scriptable globalScope;
    
    /**
     * Define a ClassShutter that prevents access to all Java classes.
     */
    static class OpaqueShutter implements ClassShutter {
        public boolean visibleToScripts(String name) {
            return false;
        }
    }
    
    public void testClassShutterException() {
        Context cx = Context.enter();
        try {
            globalScope = cx.initStandardObjects();
            cx.setClassShutter(new OpaqueShutter());
            cx.evaluateString(globalScope, 
                    "java.lang.System.out.println('hi');",
                    "test source", 1, null);
            fail();
        } catch (RhinoException e) {
            // OpaqueShutter should prevent access to java.lang...
        } finally {
            Context.exit();
        }
    }

    public void testThrowingException() {
        Context cx = Context.enter();
        try {
            cx.setClassShutter(new OpaqueShutter());
            // JavaScript exceptions with no reference to Java
            // should not be affected by the ClassShutter
            cx.evaluateString(globalScope, 
                    "try { throw 3; } catch (e) { }",
                    "test source", 1, null);
        } finally {
            Context.exit();
        }
    }
  
   
}

@@ -348,41 +348,8 @@
    %0A
-    Scriptable globalScope;%0A    %0A
     
@@ -700,16 +700,27 @@
         
+Scriptable 
 globalSc
@@ -1227,32 +1227,95 @@
 ;%0A        try %7B%0A
+            Scriptable globalScope = cx.initStandardObjects();%0A
             cx.s

Fix test