| Index: compiler/javatests/com/google/dart/compiler/resolver/MockLibraryUnit.java
|
| diff --git a/compiler/javatests/com/google/dart/compiler/resolver/MockLibraryUnit.java b/compiler/javatests/com/google/dart/compiler/resolver/MockLibraryUnit.java
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..37bec076cb02980054b842e9dd30376b0c6c567b
|
| --- /dev/null
|
| +++ b/compiler/javatests/com/google/dart/compiler/resolver/MockLibraryUnit.java
|
| @@ -0,0 +1,33 @@
|
| +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
|
| +// for details. All rights reserved. Use of this source code is governed by a
|
| +// BSD-style license that can be found in the LICENSE file.
|
| +package com.google.dart.compiler.resolver;
|
| +
|
| +import com.google.dart.compiler.LibrarySource;
|
| +import com.google.dart.compiler.MockLibrarySource;
|
| +import com.google.dart.compiler.ast.DartUnit;
|
| +import com.google.dart.compiler.ast.LibraryUnit;
|
| +
|
| +/**
|
| + * Testing support for {@link LibraryUnit}.
|
| + */
|
| +public final class MockLibraryUnit {
|
| + /**
|
| + * @return the mock {@link LibraryUnit}.
|
| + */
|
| + public static LibraryUnit create() {
|
| + LibrarySource librarySource = new MockLibrarySource();
|
| + return new LibraryUnit(librarySource);
|
| + }
|
| +
|
| + /**
|
| + * Creates the mock {@link LibraryUnit} and sets it for given {@link DartUnit}.
|
| + *
|
| + * @return the mock {@link LibraryUnit}.
|
| + */
|
| + public static LibraryUnit create(DartUnit unit) {
|
| + LibraryUnit libraryUnit = create();
|
| + unit.setLibrary(libraryUnit);
|
| + return libraryUnit;
|
| + }
|
| +}
|
|
|