aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/events/EventTestTemplate.java
diff options
context:
space:
mode:
authorGravatar Lukacs Berki <lberki@google.com>2015-06-12 11:37:46 +0000
committerGravatar Philipp Wollermann <philwo@google.com>2015-06-12 11:52:48 +0000
commit4833822ced449008ffc57d217334edac3122ef7e (patch)
treed85e6abf853d68568d47051c2f56eb605a561f71 /src/test/java/com/google/devtools/build/lib/events/EventTestTemplate.java
parent19f3413dbc4bda45df09ddfbe882c41fc81350d8 (diff)
Remove Path from Location, ParserInputSource and bunch of other low-level classes.
This makes the code cleaner because a lot of places never read the file and thus never needed a Path in the first place. I got to this change in a bit convoluted way: - I wanted the default tools in Android rules to point to //external: - I wanted to make sure that that doesn't cause an error is no Android rules are built, thus I had to add some binding for them in the default WORKSPACE file - I wanted the Android rules not to depend on Bazel core with an eye towards eventually moving them to a separate jar / Skylark code - The default WORKSPACE file is currently composed from files extracted by the Bazel launcher which would make the Android rules depend on a very core mechanism - I couldn't simply pass in jdk.WORKSPACE as a String because Location, ParserInputSource and a bunch of other things needed a Path, which a simple string doesn't have. Thus, this change. -- MOS_MIGRATED_REVID=95828839
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/events/EventTestTemplate.java')
-rw-r--r--src/test/java/com/google/devtools/build/lib/events/EventTestTemplate.java9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/events/EventTestTemplate.java b/src/test/java/com/google/devtools/build/lib/events/EventTestTemplate.java
index 6f0f8fef7c..b8388ff590 100644
--- a/src/test/java/com/google/devtools/build/lib/events/EventTestTemplate.java
+++ b/src/test/java/com/google/devtools/build/lib/events/EventTestTemplate.java
@@ -14,25 +14,22 @@
package com.google.devtools.build.lib.events;
import com.google.devtools.build.lib.events.Location.LineAndColumn;
-import com.google.devtools.build.lib.testutil.Scratch;
-import com.google.devtools.build.lib.vfs.Path;
+import com.google.devtools.build.lib.vfs.PathFragment;
import org.junit.Before;
public abstract class EventTestTemplate {
protected Event event;
- protected Path path;
+ protected PathFragment path;
protected Location location;
protected Location locationNoPath;
protected Location locationNoLineInfo;
- private Scratch scratch = new Scratch();
-
@Before
public void setUp() throws Exception {
String message = "This is not an error message.";
- path = scratch.resolve("/path/to/workspace/my/sample/path.txt");
+ path = new PathFragment("/path/to/workspace/my/sample/path.txt");
location = Location.fromPathAndStartColumn(path, 21, 31, new LineAndColumn(3, 4));