move ForkMain.Tags out to top-level ForkTags to make sxr happy

This commit is contained in:
Mark Harrah 2012-04-06 23:29:48 -04:00
parent f94eae15b6
commit 75dfccf098
3 changed files with 17 additions and 12 deletions

View File

@ -42,7 +42,7 @@ private[sbt] object ForkTests {
val os = new ObjectOutputStream(socket.getOutputStream) val os = new ObjectOutputStream(socket.getOutputStream)
val is = new ObjectInputStream(socket.getInputStream) val is = new ObjectInputStream(socket.getInputStream)
import Tags._ import ForkTags._
@annotation.tailrec def react: Unit = is.readObject match { @annotation.tailrec def react: Unit = is.readObject match {
case `Done` => os.writeObject(Done); case `Done` => os.writeObject(Done);
case Array(`Error`, s: String) => log.error(s); react case Array(`Error`, s: String) => log.error(s); react

View File

@ -15,10 +15,6 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
public class ForkMain { public class ForkMain {
public static enum Tags {
Error, Warn, Info, Debug, Done;
}
static class SubclassFingerscan implements TestFingerprint, Serializable { static class SubclassFingerscan implements TestFingerprint, Serializable {
private boolean isModule; private boolean isModule;
private String superClassName; private String superClassName;
@ -102,10 +98,10 @@ public class ForkMain {
Logger[] loggers = { Logger[] loggers = {
new Logger() { new Logger() {
public boolean ansiCodesSupported() { return ansiCodesSupported; } public boolean ansiCodesSupported() { return ansiCodesSupported; }
public void error(String s) { write(os, new Object[]{Tags.Error, s}); } public void error(String s) { write(os, new Object[]{ForkTags.Error, s}); }
public void warn(String s) { write(os, new Object[]{Tags.Warn, s}); } public void warn(String s) { write(os, new Object[]{ForkTags.Warn, s}); }
public void info(String s) { write(os, new Object[]{Tags.Info, s}); } public void info(String s) { write(os, new Object[]{ForkTags.Info, s}); }
public void debug(String s) { write(os, new Object[]{Tags.Debug, s}); } public void debug(String s) { write(os, new Object[]{ForkTags.Debug, s}); }
public void trace(Throwable t) { write(os, t); } public void trace(Throwable t) { write(os, t); }
} }
}; };
@ -118,7 +114,7 @@ public class ForkMain {
try { try {
framework = (Framework) Class.forName(implClassName).newInstance(); framework = (Framework) Class.forName(implClassName).newInstance();
} catch (ClassNotFoundException e) { } catch (ClassNotFoundException e) {
write(os, new Object[]{Tags.Error, "Framework implementation '" + implClassName + "' not present."}); write(os, new Object[]{ForkTags.Error, "Framework implementation '" + implClassName + "' not present."});
continue; continue;
} }
@ -139,12 +135,12 @@ public class ForkMain {
} else if (test.fingerprint instanceof TestFingerprint) { } else if (test.fingerprint instanceof TestFingerprint) {
runner.run(test.name, (TestFingerprint) test.fingerprint, handler, frameworkArgs); runner.run(test.name, (TestFingerprint) test.fingerprint, handler, frameworkArgs);
} else { } else {
write(os, new Object[]{Tags.Error, "Framework '" + framework + "' does not support test '" + test.name + "'"}); write(os, new Object[]{ForkTags.Error, "Framework '" + framework + "' does not support test '" + test.name + "'"});
} }
write(os, events.toArray(new ForkEvent[events.size()])); write(os, events.toArray(new ForkEvent[events.size()]));
} }
} }
write(os, Tags.Done); write(os, ForkTags.Done);
is.readObject(); is.readObject();
} }
} }

View File

@ -0,0 +1,9 @@
/* sbt -- Simple Build Tool
* Copyright 2012 Eugene Vigdorchik
*/
package sbt;
public enum ForkTags {
Error, Warn, Info, Debug, Done;
}