mirror of
https://github.com/sbt/sbt.git
synced 2026-09-01 02:27:13 +02:00
Added >1 framework class per framework support, this enables sbt to support both old and new framework API at the same time.
This commit is contained in:
@@ -168,6 +168,9 @@ public class ForkMain {
|
||||
void logError(ObjectOutputStream os, String message) {
|
||||
write(os, new Object[]{ForkTags.Error, message});
|
||||
}
|
||||
void logDebug(ObjectOutputStream os, String message) {
|
||||
write(os, new Object[]{ForkTags.Debug, message});
|
||||
}
|
||||
void writeEvents(ObjectOutputStream os, ForkTestDefinition test, ForkEvent[] events) {
|
||||
write(os, new Object[]{test.name, events});
|
||||
}
|
||||
@@ -187,22 +190,27 @@ public class ForkMain {
|
||||
};
|
||||
|
||||
for (int i = 0; i < nFrameworks; i++) {
|
||||
final String implClassName = (String) is.readObject();
|
||||
final String[] implClassNames = (String[]) is.readObject();
|
||||
final String[] frameworkArgs = (String[]) is.readObject();
|
||||
final String[] remoteFrameworkArgs = (String[]) is.readObject();
|
||||
|
||||
final Framework framework;
|
||||
try {
|
||||
Object rawFramework = Class.forName(implClassName).newInstance();
|
||||
if (rawFramework instanceof Framework)
|
||||
framework = (Framework) rawFramework;
|
||||
else
|
||||
framework = new FrameworkWrapper((org.scalatools.testing.Framework) rawFramework);
|
||||
} catch (ClassNotFoundException e) {
|
||||
logError(os, "Framework implementation '" + implClassName + "' not present.");
|
||||
continue;
|
||||
Framework framework = null;
|
||||
for (String implClassName : implClassNames) {
|
||||
try {
|
||||
Object rawFramework = Class.forName(implClassName).newInstance();
|
||||
if (rawFramework instanceof Framework)
|
||||
framework = (Framework) rawFramework;
|
||||
else
|
||||
framework = new FrameworkWrapper((org.scalatools.testing.Framework) rawFramework);
|
||||
break;
|
||||
} catch (ClassNotFoundException e) {
|
||||
logDebug(os, "Framework implementation '" + implClassName + "' not present.");
|
||||
}
|
||||
}
|
||||
|
||||
if (framework == null)
|
||||
continue;
|
||||
|
||||
ArrayList<ForkTestDefinition> filteredTests = new ArrayList<ForkTestDefinition>();
|
||||
for (Fingerprint testFingerprint : framework.fingerprints()) {
|
||||
for (ForkTestDefinition test : tests) {
|
||||
|
||||
Reference in New Issue
Block a user