# HG changeset patch # User ptisnovs # Date 1400224865 -7200 # Node ID 7ec0f5310ca549d287fcadd03d157c4f2f944d7e # Parent 324c54e484c19ce08a545b3db57dd61f00666970 Nine new tests added into ScriptContextTest. diff -r 324c54e484c1 -r 7ec0f5310ca5 ChangeLog --- 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 + + * src/org/RhinoTests/ScriptContextTest.java: + Nine new tests added into ScriptContextTest. + 2014-05-15 Pavel Tisnovsky * src/org/RhinoTests/ScriptContextTest.java: diff -r 324c54e484c1 -r 7ec0f5310ca5 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