/hg/rhino-tests: Added implementation of setUp() and tearDown() ...
ptisnovs at icedtea.classpath.org
ptisnovs at icedtea.classpath.org
Fri May 16 07:33:16 UTC 2014
changeset 8fa0f2667f65 in /hg/rhino-tests
details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=8fa0f2667f65
author: ptisnovs
date: Fri May 16 09:33:09 2014 +0200
Added implementation of setUp() and tearDown() methods, added one test.
diffstat:
ChangeLog | 5 +++
src/org/RhinoTests/SimpleScriptContextTest.java | 41 ++++++++++++++++++++++--
2 files changed, 42 insertions(+), 4 deletions(-)
diffs (79 lines):
diff -r 7ec0f5310ca5 -r 8fa0f2667f65 ChangeLog
--- a/ChangeLog Fri May 16 09:21:05 2014 +0200
+++ b/ChangeLog Fri May 16 09:33:09 2014 +0200
@@ -1,3 +1,8 @@
+2014-05-16 Pavel Tisnovsky <ptisnovs at redhat.com>
+
+ * src/org/RhinoTests/SimpleScriptContextTest.java:
+ Added implementation of setUp() and tearDown() methods, added one test.
+
2014-05-16 Pavel Tisnovsky <ptisnovs at redhat.com>
* src/org/RhinoTests/ScriptContextTest.java:
diff -r 7ec0f5310ca5 -r 8fa0f2667f65 src/org/RhinoTests/SimpleScriptContextTest.java
--- a/src/org/RhinoTests/SimpleScriptContextTest.java Fri May 16 09:21:05 2014 +0200
+++ b/src/org/RhinoTests/SimpleScriptContextTest.java Fri May 16 09:33:09 2014 +0200
@@ -1,7 +1,7 @@
/*
Rhino test framework
- Copyright (C) 2011 Red Hat
+ Copyright (C) 2011, 2012, 2013, 2014 Red Hat
This file is part of IcedTea.
@@ -40,18 +40,51 @@
package org.RhinoTests;
+import javax.script.ScriptContext;
+import javax.script.SimpleScriptContext;
+
/**
- * TODO: not implemented
- * @author ptisnovs
+ * Basic ScriptContext test suite. Following tests checks the interface
+ * javax.script.SimpleScriptContext.
*
+ * @author Pavel Tisnovsky
*/
-public class SimpleScriptContextTest {
+public class SimpleScriptContextTest extends BaseRhinoTest {
+
+ @Override
+ protected void setUp(String[] args) {
+ // this block could be empty
+ return;
+ }
+
+ @Override
+ protected void tearDown() {
+ // this block could be empty
+ return;
+ }
+
+ /**
+ * Test for toString() method.
+ */
+ protected void testToString() {
+ // tested object
+ Object object = new SimpleScriptContext();
+
+ // call the toString() method
+ String string = object.toString();
+
+ assertTrue(string != null, "toString() method returned null!");
+ assertTrue(string.startsWith("javax.script.SimpleScriptContext"), "bad toString() return value " + string);
+ }
+
/**
* Entry point to this test case.
*
* @param args parameters passed from command line
*/
public static void main(String[] args) {
+ new SimpleScriptContextTest().doTests(args);
}
}
+
More information about the distro-pkg-dev
mailing list