/hg/rhino-tests: Ten new tests added into SimpleScriptContextTest.
ptisnovs at icedtea.classpath.org
ptisnovs at icedtea.classpath.org
Fri May 16 07:39:28 UTC 2014
changeset bd78ec86c792 in /hg/rhino-tests
details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=bd78ec86c792
author: ptisnovs
date: Fri May 16 09:39:20 2014 +0200
Ten new tests added into SimpleScriptContextTest.
diffstat:
ChangeLog | 5 +
src/org/RhinoTests/SimpleScriptContextTest.java | 150 ++++++++++++++++++++++++
2 files changed, 155 insertions(+), 0 deletions(-)
diffs (172 lines):
diff -r 8fa0f2667f65 -r bd78ec86c792 ChangeLog
--- a/ChangeLog Fri May 16 09:33:09 2014 +0200
+++ b/ChangeLog Fri May 16 09:39:20 2014 +0200
@@ -1,3 +1,8 @@
+2014-05-16 Pavel Tisnovsky <ptisnovs at redhat.com>
+
+ * src/org/RhinoTests/SimpleScriptContextTest.java:
+ Ten new tests added into SimpleScriptContextTest.
+
2014-05-16 Pavel Tisnovsky <ptisnovs at redhat.com>
* src/org/RhinoTests/SimpleScriptContextTest.java:
diff -r 8fa0f2667f65 -r bd78ec86c792 src/org/RhinoTests/SimpleScriptContextTest.java
--- a/src/org/RhinoTests/SimpleScriptContextTest.java Fri May 16 09:33:09 2014 +0200
+++ b/src/org/RhinoTests/SimpleScriptContextTest.java Fri May 16 09:39:20 2014 +0200
@@ -78,6 +78,156 @@
}
/**
+ * Test for method SimpleScriptContext.setAttribute().
+ */
+ protected void testSetAttribute1() {
+ // tested object
+ SimpleScriptContext object = new SimpleScriptContext();
+ try {
+ object.setAttribute("name", "value", ScriptContext.ENGINE_SCOPE);
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ throw new AssertionError(e.getMessage());
+ }
+ }
+
+ /**
+ * Test for method SimpleScriptContext.setAttribute().
+ */
+ protected void testSetAttribute2() {
+ // tested object
+ SimpleScriptContext object = new SimpleScriptContext();
+ try {
+ object.setAttribute("name", "", ScriptContext.ENGINE_SCOPE);
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ throw new AssertionError(e.getMessage());
+ }
+ }
+
+ /**
+ * Test for method SimpleScriptContext.setAttribute().
+ */
+ protected void testSetAttribute3() {
+ // tested object
+ SimpleScriptContext object = new SimpleScriptContext();
+ try {
+ object.setAttribute("name", null, ScriptContext.ENGINE_SCOPE);
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ throw new AssertionError(e.getMessage());
+ }
+ }
+
+ /**
+ * Test for method SimpleScriptContext.setAttribute().
+ */
+ protected void testSetAttribute4() {
+ // tested object
+ SimpleScriptContext object = new SimpleScriptContext();
+ try {
+ object.setAttribute("", "value", ScriptContext.ENGINE_SCOPE);
+ throw new AssertionError("ScriptContext.setAttribute(\"\", \"value\", ScriptContext.ENGINE_SCOPE.) does not throw any exception");
+ }
+ catch (Exception e) {
+ // expected exception
+ }
+ }
+
+ /**
+ * Test for method SimpleScriptContext.setAttribute().
+ */
+ protected void testSetAttribute5() {
+ // tested object
+ SimpleScriptContext object = new SimpleScriptContext();
+ try {
+ object.setAttribute("", "", ScriptContext.ENGINE_SCOPE);
+ throw new AssertionError("ScriptContext.setAttribute(\"\", \"\", ScriptContext.ENGINE_SCOPE) does not throw any exception");
+ }
+ catch (Exception e) {
+ // expected exception
+ }
+ }
+
+ /**
+ * Test for method SimpleScriptContext.setAttribute().
+ */
+ protected void testSetAttribute6() {
+ // tested object
+ SimpleScriptContext object = new SimpleScriptContext();
+ try {
+ object.setAttribute("", null, ScriptContext.ENGINE_SCOPE);
+ throw new AssertionError("ScriptContext.setAttribute(\"\", null, ScriptContext.ENGINE_SCOPE) does not throw any exception");
+ }
+ catch (Exception e) {
+ // expected exception
+ }
+ }
+
+ /**
+ * Test for method SimpleScriptContext.setAttribute().
+ */
+ protected void testSetAttribute7() {
+ // tested object
+ SimpleScriptContext object = new SimpleScriptContext();
+ try {
+ object.setAttribute(null, "value", ScriptContext.ENGINE_SCOPE);
+ throw new AssertionError("ScriptContext.setAttribute(null, \"value\", ScriptContext.ENGINE_SCOPE) does not throw any exception");
+ }
+ catch (Exception e) {
+ // expected exception
+ }
+ }
+
+ /**
+ * Test for method SimpleScriptContext.setAttribute().
+ */
+ protected void testSetAttribute8() {
+ // tested object
+ SimpleScriptContext object = new SimpleScriptContext();
+ try {
+ object.setAttribute(null, "", ScriptContext.ENGINE_SCOPE);
+ throw new AssertionError("ScriptContext.setAttribute(null, \"\", ScriptContext.ENGINE_SCOPE) does not throw any exception");
+ }
+ catch (Exception e) {
+ // expected exception
+ }
+ }
+
+ /**
+ * Test for method SimpleScriptContext.setAttribute().
+ */
+ protected void testSetAttribute9() {
+ // tested object
+ SimpleScriptContext object = new SimpleScriptContext();
+ try {
+ object.setAttribute(null, null, ScriptContext.ENGINE_SCOPE);
+ throw new AssertionError("ScriptContext.setAttribute(null, null, ScriptContext.ENGINE_SCOPE) does not throw any exception");
+ }
+ catch (Exception e) {
+ // expected exception
+ }
+ }
+
+ /**
+ * Test for method SimpleScriptContext.setAttribute().
+ */
+ protected void testSetAttribute10() {
+ // tested object
+ SimpleScriptContext object = new SimpleScriptContext();
+ try {
+ object.setAttribute("name", "value", ScriptContext.GLOBAL_SCOPE);
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ throw new AssertionError(e.getMessage());
+ }
+ }
+
+ /**
* Entry point to this test case.
*
* @param args parameters passed from command line
More information about the distro-pkg-dev
mailing list