| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013, the Dart project authors. | 2 * Copyright (c) 2013, the Dart project authors. |
| 3 * | 3 * |
| 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u
se this file except | 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u
se this file except |
| 5 * in compliance with the License. You may obtain a copy of the License at | 5 * in compliance with the License. You may obtain a copy of the License at |
| 6 * | 6 * |
| 7 * http://www.eclipse.org/legal/epl-v10.html | 7 * http://www.eclipse.org/legal/epl-v10.html |
| 8 * | 8 * |
| 9 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License | 9 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License |
| 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express | 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express |
| 11 * or implied. See the License for the specific language governing permissions a
nd limitations under | 11 * or implied. See the License for the specific language governing permissions a
nd limitations under |
| 12 * the License. | 12 * the License. |
| 13 */ | 13 */ |
| 14 package com.google.dart.tools.core.internal.analysis.model; | 14 package com.google.dart.tools.core.internal.analysis.model; |
| 15 | 15 |
| 16 import com.google.dart.engine.sdk.DartSdk; | 16 import com.google.dart.engine.sdk.DartSdk; |
| 17 import com.google.dart.engine.source.FileBasedSource; | 17 import com.google.dart.engine.source.FileBasedSource; |
| 18 import com.google.dart.engine.source.PackageUriResolver; |
| 18 import com.google.dart.engine.utilities.io.FileUtilities2; | 19 import com.google.dart.engine.utilities.io.FileUtilities2; |
| 19 import com.google.dart.tools.core.DartCore; | 20 import com.google.dart.tools.core.DartCore; |
| 20 import com.google.dart.tools.core.pub.PubspecModel; | 21 import com.google.dart.tools.core.pub.PubspecModel; |
| 21 | 22 |
| 23 import static com.google.dart.tools.core.DartCore.PACKAGES_DIRECTORY_NAME; |
| 22 import static com.google.dart.tools.core.pub.PubYamlUtilsTest.pubspecYamlString; | 24 import static com.google.dart.tools.core.pub.PubYamlUtilsTest.pubspecYamlString; |
| 23 | 25 |
| 24 import static org.mockito.Mockito.mock; | 26 import static org.mockito.Mockito.mock; |
| 25 | 27 |
| 26 import java.io.File; | 28 import java.io.File; |
| 27 | 29 |
| 28 public class PubFolderImplTest extends PubResourceMapImplTest { | 30 public class PubFolderImplTest extends PubResourceMapImplTest { |
| 29 | 31 |
| 30 private DartSdk expectedSdk; | 32 private DartSdk expectedSdk; |
| 31 | 33 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 61 | 63 |
| 62 public void test_getSdk() throws Exception { | 64 public void test_getSdk() throws Exception { |
| 63 PubFolderImpl pubFolder = newTarget(); | 65 PubFolderImpl pubFolder = newTarget(); |
| 64 DartSdk sdk = pubFolder.getSdk(); | 66 DartSdk sdk = pubFolder.getSdk(); |
| 65 assertNotNull(sdk); | 67 assertNotNull(sdk); |
| 66 assertSame(expectedSdk, sdk); | 68 assertSame(expectedSdk, sdk); |
| 67 } | 69 } |
| 68 | 70 |
| 69 @Override | 71 @Override |
| 70 protected PubFolderImpl newTarget() { | 72 protected PubFolderImpl newTarget() { |
| 71 pubContainer.getMockFile(DartCore.PUBSPEC_FILE_NAME).setContents( | 73 pubContainer.getMockFile(DartCore.PUBSPEC_FILE_NAME) |
| 72 pubspecYamlString.replace("name: web_components", "name: myapp")); | 74 .setContents(pubspecYamlString.replace("name: web_components", "name: my
app")); |
| 73 return new PubFolderImpl(pubContainer, context, expectedSdk); | 75 return new PubFolderImpl( |
| 76 pubContainer, |
| 77 context, |
| 78 expectedSdk, |
| 79 new PackageUriResolver(new File(pubContainer.toFile(), PACKAGES_DIRECTOR
Y_NAME))); |
| 74 } | 80 } |
| 75 | 81 |
| 76 @Override | 82 @Override |
| 77 protected void setUp() throws Exception { | 83 protected void setUp() throws Exception { |
| 78 super.setUp(); | 84 super.setUp(); |
| 79 expectedSdk = mock(DartSdk.class); | 85 expectedSdk = mock(DartSdk.class); |
| 80 } | 86 } |
| 81 } | 87 } |
| OLD | NEW |