Tests for exceptions and snippet id. Bugs.

andrei.eremeev andrei.eremeev at oracle.com
Thu Feb 19 15:37:43 UTC 2015


Hi REPL team,

Please find new tests here: 
http://cr.openjdk.java.net/~aeremeev/exceptions_and_snippets_id.00/

Concerning yesterday's conversation with Robert, I have developed tests 
for the following points:
 > Extract the id from a declared snippet and assert that the #<number> 
in the exception filename matches.
Added more tests cases to ExceptionsTest. Currently "filename" is 
extracted from snippets.

 > Declare a variety of things in one test and assert that each id gets 
bigger than the last from first to last.
 > Replace (and also Redefine) and assert that the id is retained.
Newly declared snippets are checked whether id() is larger than id() of 
previous snippets in case of snippet declaration, and whether id() 
equals to id() of an old snippet in case of snippet redefinition or 
replacement. (See KullaTesting#assertSuccesfullDeclare)

Bugs:

1. When import is redeclared, declaration type is Declared, but id is 
retained from old declaration.
2. Line number in stack trace elements is always one. While exception is 
thrown in the second line. Example:
     -> void f() {
     >> throw new Error();
     >> }
     |  Declared method f

     -> f();
     |  java.lang.Error thrown
     |        at f (#9:1)
     |        at (#10:1)
3. Class names of anonymous and local classes do not appear in stack 
trace. (See ExceptionTest)

Andrei Eremeev



More information about the kulla-dev mailing list