hg: kulla/dev/langtools: Extract the id from a declared snippet and assert that the #<number> in the exception filename matches.

robert.field at oracle.com robert.field at oracle.com
Thu Feb 19 16:41:17 UTC 2015


Changeset: b528d3c6c037
Author:    rfield
Date:      2015-02-19 08:38 -0800
URL:       http://hg.openjdk.java.net/kulla/dev/langtools/rev/b528d3c6c037

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 == new test failures:

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)

Contributed-by: andrei.eremeev at oracle.com

! repl/testng/test/ClassesTest.java
! repl/testng/test/ExceptionsTest.java
! repl/testng/test/KullaTesting.java
! repl/testng/test/MethodsTest.java
! repl/testng/test/ModifiersTest.java
! repl/testng/test/ReplaceTest.java
! repl/testng/test/SanityTest.java
! repl/testng/test/SnippetTest.java
! repl/testng/test/VariablesTest.java



More information about the kulla-dev mailing list