diff options
Diffstat (limited to 'velocity-engine-core/src')
-rw-r--r-- | velocity-engine-core/src/test/java/org/apache/velocity/test/SecureIntrospectionTestCase.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/velocity-engine-core/src/test/java/org/apache/velocity/test/SecureIntrospectionTestCase.java b/velocity-engine-core/src/test/java/org/apache/velocity/test/SecureIntrospectionTestCase.java index 9593433a..081e48b2 100644 --- a/velocity-engine-core/src/test/java/org/apache/velocity/test/SecureIntrospectionTestCase.java +++ b/velocity-engine-core/src/test/java/org/apache/velocity/test/SecureIntrospectionTestCase.java @@ -33,6 +33,9 @@ import org.apache.velocity.util.introspection.SecureUberspector; import java.io.IOException; import java.io.StringWriter; import java.io.Writer; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLClassLoader; import java.util.Collection; import java.util.HashSet; @@ -172,6 +175,27 @@ public class SecureIntrospectionTestCase extends BaseTestCase return c; } + public ClassLoader getSampleClassLoader1() + { + return this.getClass().getClassLoader(); + } + + /** + * sample property which is a subclass of ClassLoader + * @return + */ + public ClassLoader getSampleClassLoader2() + { + try + { + return new URLClassLoader(new URL[]{new URL("file://.")}, this.getClass().getClassLoader()); + } + catch (MalformedURLException e) + { + throw new RuntimeException(e); + } + } + } |