diff options
author | Will Glass-Husain <wglass@forio.com> | 2020-07-16 22:24:06 -0700 |
---|---|---|
committer | Will Glass-Husain <wglass@forio.com> | 2020-07-16 22:24:06 -0700 |
commit | 3e28c5fb7e618dc002cdbc6e4d0df9e2fd4bc155 (patch) | |
tree | bf0beff7f105992c74a83d8ee5941f2edcabda6f | |
parent | 2ce3d7cd829a9f834b2a01809d0c4734054ac2c8 (diff) | |
download | apache-velocity-engine-3e28c5fb7e618dc002cdbc6e4d0df9e2fd4bc155.tar.gz |
tests for SecureIntrospection
-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); + } + } + } |