/hg/rhino-tests: Three new tests added into ScriptEngineFactoryC...
ptisnovs at icedtea.classpath.org
ptisnovs at icedtea.classpath.org
Tue Mar 25 08:42:58 UTC 2014
changeset 4aec4c1b2a37 in /hg/rhino-tests
details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=4aec4c1b2a37
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Tue Mar 25 09:43:42 2014 +0100
Three new tests added into ScriptEngineFactoryClassTest.
diffstat:
ChangeLog | 5 ++
src/org/RhinoTests/ScriptEngineFactoryClassTest.java | 41 +++++++++++++++++++-
2 files changed, 45 insertions(+), 1 deletions(-)
diffs (74 lines):
diff -r a925ed2c4086 -r 4aec4c1b2a37 ChangeLog
--- a/ChangeLog Mon Mar 24 11:13:09 2014 +0100
+++ b/ChangeLog Tue Mar 25 09:43:42 2014 +0100
@@ -1,3 +1,8 @@
+2014-03-25 Pavel Tisnovsky <ptisnovs at redhat.com>
+
+ * src/org/RhinoTests/ScriptEngineFactoryClassTest.java:
+ Three new tests added into ScriptEngineFactoryClassTest.
+
2014-03-24 Pavel Tisnovsky <ptisnovs at redhat.com>
* src/org/RhinoTests/ScriptExceptionClassTest.java:
diff -r a925ed2c4086 -r 4aec4c1b2a37 src/org/RhinoTests/ScriptEngineFactoryClassTest.java
--- a/src/org/RhinoTests/ScriptEngineFactoryClassTest.java Mon Mar 24 11:13:09 2014 +0100
+++ b/src/org/RhinoTests/ScriptEngineFactoryClassTest.java Tue Mar 25 09:43:42 2014 +0100
@@ -1859,6 +1859,27 @@
}
/**
+ * Test for method javax.script.ScriptEngineFactory.getClass().getResourceNPETest()
+ */
+ protected void testGetResourceNPETest() {
+ try {
+ Object resource = this.scriptEngineFactoryClass.getResource(null);
+ throw new AssertionError("NullPointerException expected!");
+ }
+ catch (NullPointerException e) {
+ //This is OK OK
+ }
+ }
+
+ /**
+ * Test for method javax.script.ScriptEngineFactory.getClass().getResourceNegativeTest()
+ */
+ protected void testGetResourceNegativeTest() {
+ Object resource = this.scriptEngineFactoryClass.getResource("unknown");
+ assertNull(resource, "getResource() does not return null");
+ }
+
+ /**
* Test for method javax.script.ScriptEngineFactory.getClass().getResourceAsStreamNegativeTest()
*/
protected void testGetResourceAsStreamNegativeTest() {
@@ -1918,6 +1939,25 @@
stream = this.scriptEngineFactoryClass.getResourceAsStream("/org/RhinoTests/SimpleScriptContextTest.class");
assertNotNull(stream, "getAsStreamResource(\"/org/RhinoTests/SimpleScriptContextTest.class\") returns null");
}
+
+ /**
+ * Test for method javax.script.ScriptEngineFactory.getClass().getResourceAsStreamPositiveTest()
+ */
+ protected void testGetResourceAsStreamPositiveTest() {
+ Object stream;
+ stream = this.scriptEngineFactoryClass.getResourceAsStream("/org/RhinoTests/AbstractScriptEngineClassTest.class");
+ assertNotNull(stream, "getResourceAsStream(\"/org/RhinoTests/AbstractScriptEngineClassTest.class\") returns null");
+ }
+
+ /**
+ * Test for method javax.script.ScriptEngineFactory.getClass().toString()
+ */
+ protected void testToString() {
+ String asString;
+ asString = this.scriptEngineFactoryClass.toString();
+ assertEquals("interface javax.script.ScriptEngineFactory", asString, "wrong toString() return value");
+ }
+
/**
* Test for instanceof operator applied to a class javax.script.ScriptEngineFactory
*/
@@ -1942,4 +1982,3 @@
new ScriptEngineFactoryClassTest().doTests(args);
}
}
-
More information about the distro-pkg-dev
mailing list