Mercurial > hg > rhino-tests
changeset 360:7ec0f5310ca5 draft
Nine new tests added into ScriptContextTest.
author | ptisnovs |
---|---|
date | Fri, 16 May 2014 09:21:05 +0200 |
parents | 324c54e484c1 |
children | 8fa0f2667f65 |
files | ChangeLog src/org/RhinoTests/ScriptContextTest.java |
diffstat | 2 files changed, 140 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Thu May 15 15:17:50 2014 +0200 +++ b/ChangeLog Fri May 16 09:21:05 2014 +0200 @@ -1,3 +1,8 @@ +2014-05-16 Pavel Tisnovsky <ptisnovs@redhat.com> + + * src/org/RhinoTests/ScriptContextTest.java: + Nine new tests added into ScriptContextTest. + 2014-05-15 Pavel Tisnovsky <ptisnovs@redhat.com> * src/org/RhinoTests/ScriptContextTest.java:
--- a/src/org/RhinoTests/ScriptContextTest.java Thu May 15 15:17:50 2014 +0200 +++ b/src/org/RhinoTests/ScriptContextTest.java Fri May 16 09:21:05 2014 +0200 @@ -212,6 +212,141 @@ } /** + * Test for method SimpleScriptContext.setAttribute(). + */ + protected void testSetAttribute10() { + // tested object + ScriptContext object = new SimpleScriptContext(); + try { + object.setAttribute("name", "value", ScriptContext.GLOBAL_SCOPE); + } + catch (Exception e) { + e.printStackTrace(); + throw new AssertionError(e.getMessage()); + } + } + + /** + * Test for method SimpleScriptContext.setAttribute(). + */ + protected void testSetAttribute11() { + // tested object + ScriptContext object = new SimpleScriptContext(); + try { + object.setAttribute("name", "", ScriptContext.GLOBAL_SCOPE); + } + catch (Exception e) { + e.printStackTrace(); + throw new AssertionError(e.getMessage()); + } + } + + /** + * Test for method SimpleScriptContext.setAttribute(). + */ + protected void testSetAttribute12() { + // tested object + ScriptContext object = new SimpleScriptContext(); + try { + object.setAttribute("name", null, ScriptContext.GLOBAL_SCOPE); + } + catch (Exception e) { + e.printStackTrace(); + throw new AssertionError(e.getMessage()); + } + } + + /** + * Test for method SimpleScriptContext.setAttribute(). + */ + protected void testSetAttribute13() { + // tested object + ScriptContext object = new SimpleScriptContext(); + try { + object.setAttribute("", "value", ScriptContext.GLOBAL_SCOPE); + } + catch (Exception e) { + e.printStackTrace(); + throw new AssertionError(e.getMessage()); + } + } + + /** + * Test for method SimpleScriptContext.setAttribute(). + */ + protected void testSetAttribute14() { + // tested object + ScriptContext object = new SimpleScriptContext(); + try { + object.setAttribute("", "", ScriptContext.GLOBAL_SCOPE); + } + catch (Exception e) { + e.printStackTrace(); + throw new AssertionError(e.getMessage()); + } + } + + /** + * Test for method SimpleScriptContext.setAttribute(). + */ + protected void testSetAttribute15() { + // tested object + ScriptContext object = new SimpleScriptContext(); + try { + object.setAttribute("", null, ScriptContext.GLOBAL_SCOPE); + } + catch (Exception e) { + e.printStackTrace(); + throw new AssertionError(e.getMessage()); + } + } + + /** + * Test for method SimpleScriptContext.setAttribute(). + */ + protected void testSetAttribute16() { + // tested object + ScriptContext object = new SimpleScriptContext(); + try { + object.setAttribute(null, "value", ScriptContext.GLOBAL_SCOPE); + } + catch (Exception e) { + e.printStackTrace(); + throw new AssertionError(e.getMessage()); + } + } + + /** + * Test for method SimpleScriptContext.setAttribute(). + */ + protected void testSetAttribute17() { + // tested object + ScriptContext object = new SimpleScriptContext(); + try { + object.setAttribute(null, "", ScriptContext.GLOBAL_SCOPE); + } + catch (Exception e) { + e.printStackTrace(); + throw new AssertionError(e.getMessage()); + } + } + + /** + * Test for method SimpleScriptContext.setAttribute(). + */ + protected void testSetAttribute18() { + // tested object + ScriptContext object = new SimpleScriptContext(); + try { + object.setAttribute(null, null, 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