| Index: editor/tools/plugins/com.google.dart.server_test/src/com/google/dart/server/internal/remote/RemoteAnalysisServerImplTest.java
|
| ===================================================================
|
| --- editor/tools/plugins/com.google.dart.server_test/src/com/google/dart/server/internal/remote/RemoteAnalysisServerImplTest.java (revision 43141)
|
| +++ editor/tools/plugins/com.google.dart.server_test/src/com/google/dart/server/internal/remote/RemoteAnalysisServerImplTest.java (working copy)
|
| @@ -413,11 +413,13 @@
|
|
|
| public void test_analysis_getLibraryDependencies() throws Exception {
|
| final String[][] libraries = {{null}};
|
| + final List<Map<String, String>> packageMap = Lists.newArrayList();
|
| final RequestError[] requestErrorArray = {null};
|
| server.analysis_getLibraryDependencies(new GetLibraryDependenciesConsumer() {
|
| @Override
|
| - public void computedDependencies(String[] libs) {
|
| + public void computedDependencies(String[] libs, Map<String, String> packages) {
|
| libraries[0] = libs;
|
| + packageMap.add(packages);
|
| }
|
|
|
| @Override
|
| @@ -438,27 +440,36 @@
|
| "{",
|
| " 'id': '0',",
|
| " 'result': {",
|
| + " 'packageMap': {",
|
| + " 'pack_c' : '/a/b/',",
|
| + " 'pack_f' : '/d/e/',",
|
| + " 'pack_i' : '/g/h/'",
|
| + " },",
|
| " 'libraries': [",
|
| " '/a/b/c.dart',",
|
| " '/d/e/f.dart',",
|
| " '/g/h/i.dart'",
|
| - " ]",
|
| - " }",
|
| + " ]",
|
| + " }",
|
| "}");
|
| responseStream.waitForEmpty();
|
| server.test_waitForWorkerComplete();
|
|
|
| assertNull(requestErrorArray[0]);
|
| assertThat(libraries[0]).hasSize(3);
|
| + assertThat(packageMap).hasSize(1);
|
| + assertThat(packageMap.get(0).entrySet()).hasSize(3);
|
| }
|
|
|
| public void test_analysis_getLibraryDependenciess_error() throws Exception {
|
| - final String[][] directories = {null};
|
| + final String[][] libraries = {null};
|
| + final List<Map<String, String>> packageMap = Lists.newArrayList();
|
| final RequestError[] requestErrorArray = {null};
|
| server.analysis_getLibraryDependencies(new GetLibraryDependenciesConsumer() {
|
| @Override
|
| - public void computedDependencies(String[] dirs) {
|
| - directories[0] = dirs;
|
| + public void computedDependencies(String[] libs, Map<String, String> packages) {
|
| + libraries[0] = libs;
|
| + packageMap.add(packages);
|
| }
|
|
|
| @Override
|
| @@ -488,7 +499,8 @@
|
| responseStream.waitForEmpty();
|
| server.test_waitForWorkerComplete();
|
|
|
| - assertNull(directories[0]);
|
| + assertNull(libraries[0]);
|
| + assertThat(packageMap).isEmpty();
|
| assertNotNull(requestErrorArray[0]);
|
| RequestError requestError = requestErrorArray[0];
|
| assertEquals("CONTENT_MODIFIED", requestError.getCode());
|
|
|