langtools/test/jdk/jshell/VariablesTest.java
changeset 40304 0318f4e75c6d
parent 37644 33cf53901cac
child 43134 006808ae5f6e
equal deleted inserted replaced
40303:96a1226aca18 40304:0318f4e75c6d
    37 import jdk.jshell.VarSnippet;
    37 import jdk.jshell.VarSnippet;
    38 import jdk.jshell.Snippet.SubKind;
    38 import jdk.jshell.Snippet.SubKind;
    39 import jdk.jshell.SnippetEvent;
    39 import jdk.jshell.SnippetEvent;
    40 import org.testng.annotations.Test;
    40 import org.testng.annotations.Test;
    41 
    41 
       
    42 import static java.util.stream.Collectors.toList;
    42 import static jdk.jshell.Snippet.Status.*;
    43 import static jdk.jshell.Snippet.Status.*;
    43 import static jdk.jshell.Snippet.SubKind.VAR_DECLARATION_SUBKIND;
    44 import static jdk.jshell.Snippet.SubKind.VAR_DECLARATION_SUBKIND;
    44 import static org.testng.Assert.assertEquals;
    45 import static org.testng.Assert.assertEquals;
    45 import static org.testng.Assert.fail;
    46 import static org.testng.Assert.fail;
    46 
    47 
   329                 ste(MAIN_SNIPPET, VALID, RECOVERABLE_NOT_DEFINED, true, null),
   330                 ste(MAIN_SNIPPET, VALID, RECOVERABLE_NOT_DEFINED, true, null),
   330                 ste(key, VALID, OVERWRITTEN, false, MAIN_SNIPPET)));
   331                 ste(key, VALID, OVERWRITTEN, false, MAIN_SNIPPET)));
   331         //assertEquals(getState().source(snippet), src);
   332         //assertEquals(getState().source(snippet), src);
   332         //assertEquals(snippet, undefKey);
   333         //assertEquals(snippet, undefKey);
   333         assertEquals(getState().status(undefKey), RECOVERABLE_NOT_DEFINED);
   334         assertEquals(getState().status(undefKey), RECOVERABLE_NOT_DEFINED);
   334         List<String> unr = getState().unresolvedDependencies((VarSnippet) undefKey);
   335         List<String> unr = getState().unresolvedDependencies((VarSnippet) undefKey).collect(toList());;
   335         assertEquals(unr.size(), 1);
   336         assertEquals(unr.size(), 1);
   336         assertEquals(unr.get(0), "class undefined");
   337         assertEquals(unr.get(0), "class undefined");
   337         assertVariables(variable("undefined", "d"));
   338         assertVariables(variable("undefined", "d"));
   338     }
   339     }
   339 
   340