Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
| 2 // for details. All rights reserved. Use of this source code is governed by a | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 package com.google.dart.compiler; | |
| 5 | |
| 6 import junit.framework.TestCase; | |
| 7 | |
| 8 import java.io.File; | |
| 9 import java.net.URI; | |
| 10 import java.net.URISyntaxException; | |
| 11 import java.util.Map; | |
| 12 import java.util.Map.Entry; | |
| 13 | |
| 14 /** | |
| 15 * Test the {@link SystemLibrariesReader} | |
| 16 */ | |
| 17 public class SystemLibrariesReaderTest extends TestCase { | |
| 18 | |
| 19 | |
| 20 public void testLibrariesFileExists(){ | |
| 21 File sdkLibPath = new File(PackageLibraryManager.DEFAULT_SDK_PATH, "lib"); | |
| 22 File librariesFile = new File(new File(sdkLibPath, SystemLibrariesReader.INT ERNAL_DIR), SystemLibrariesReader.LIBRARIES_FILE); | |
| 23 assertTrue(librariesFile.exists()); | |
| 24 } | |
| 25 | |
| 26 public void testLibrariesFileContent(){ | |
| 27 File sdkLibPath = new File(PackageLibraryManager.DEFAULT_SDK_PATH, "lib"); | |
| 28 URI base = sdkLibPath.toURI(); | |
| 29 SystemLibrariesReader reader = new SystemLibrariesReader(sdkLibPath); | |
| 30 Map<String, Map<String, String>> librariesMap = reader.getLibrariesMap(); | |
| 31 assertTrue(!librariesMap.isEmpty()); | |
| 32 for (Entry<String, Map<String, String>> entry : librariesMap.entrySet()){ | |
| 33 String path = entry.getValue().get("path"); | |
| 34 File file; | |
| 35 try { | |
| 36 file = new File(base.resolve(new URI(null, null, path, null, null)).norma lize()); | |
| 37 } catch (URISyntaxException e) { | |
| 38 continue; | |
|
danrubel
2012/08/28 00:25:45
Seems like we should fail if it cannot be resolved
keertip
2012/08/28 20:41:57
Done.
| |
| 39 } | |
| 40 assertTrue(file.exists()); | |
| 41 } | |
| 42 } | |
| 43 | |
|
danrubel
2012/08/28 00:25:45
Perhaps some tests to sanity check other aspects i
keertip
2012/08/28 20:41:57
Done.
| |
| 44 } | |
| OLD | NEW |