mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
CIDR: initial 'build' functionality
CIDR: read old-style SDK CIDR: some refactoring
This commit is contained in:
@@ -498,53 +498,6 @@ public abstract class PlatformTestCase extends UsefulTestCase implements DataPro
|
||||
SwingUtilities.invokeAndWait(runnable);
|
||||
}
|
||||
|
||||
protected void runTest() throws Throwable {
|
||||
/*
|
||||
Method runMethod = null;
|
||||
try {
|
||||
runMethod = getClass().getMethod(getName(), new Class[0]);
|
||||
}
|
||||
catch (NoSuchMethodException e) {
|
||||
fail("Method \"" + getName() + "\" not found");
|
||||
}
|
||||
if (runMethod != null && !Modifier.isPublic(runMethod.getModifiers())) {
|
||||
fail("Method \"" + getName() + "\" should be public");
|
||||
}
|
||||
|
||||
final Method method = runMethod;
|
||||
*/
|
||||
|
||||
final Throwable[] throwables = new Throwable[1];
|
||||
|
||||
Runnable runnable = new Runnable() {
|
||||
public void run() {
|
||||
try {
|
||||
PlatformTestCase.super.runTest();
|
||||
/*
|
||||
method.invoke(IdeaTestCase.this, new Class[0]);
|
||||
*/
|
||||
}
|
||||
catch (InvocationTargetException e) {
|
||||
e.fillInStackTrace();
|
||||
throwables[0] = e.getTargetException();
|
||||
}
|
||||
catch (IllegalAccessException e) {
|
||||
e.fillInStackTrace();
|
||||
throwables[0] = e;
|
||||
}
|
||||
catch (Throwable e) {
|
||||
throwables[0] = e;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
invokeTestRunnable(runnable);
|
||||
|
||||
if (throwables[0] != null) {
|
||||
throw throwables[0];
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean isRunInWriteAction() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.*;
|
||||
@@ -154,6 +155,39 @@ public abstract class UsefulTestCase extends TestCase {
|
||||
return myTestRootDisposable;
|
||||
}
|
||||
|
||||
protected void runTest() throws Throwable {
|
||||
final Throwable[] throwables = new Throwable[1];
|
||||
|
||||
Runnable runnable = new Runnable() {
|
||||
public void run() {
|
||||
try {
|
||||
UsefulTestCase.super.runTest();
|
||||
}
|
||||
catch (InvocationTargetException e) {
|
||||
e.fillInStackTrace();
|
||||
throwables[0] = e.getTargetException();
|
||||
}
|
||||
catch (IllegalAccessException e) {
|
||||
e.fillInStackTrace();
|
||||
throwables[0] = e;
|
||||
}
|
||||
catch (Throwable e) {
|
||||
throwables[0] = e;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
invokeTestRunnable(runnable);
|
||||
|
||||
if (throwables[0] != null) {
|
||||
throw throwables[0];
|
||||
}
|
||||
}
|
||||
|
||||
protected void invokeTestRunnable(Runnable runnable) throws Exception {
|
||||
runnable.run();
|
||||
}
|
||||
|
||||
@NonNls
|
||||
public static String toString(Collection<?> collection) {
|
||||
if (collection.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user