Skip to content

Commit 190b3e7

Browse files
author
zhourenjian
committed
Ignore those unnecessary method invocations for Java2Script JUnit to run correctly
1 parent 990ee55 commit 190b3e7

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

sources/net.sf.j2s.java.junit/src/junit/framework/TestSuite.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ static public Test createTest(Class theClass, String name) {
148148

149149
/**
150150
* Converts the stack trace into a string
151+
* @j2sNative
152+
* return "";
151153
*/
152154
private static String exceptionToString(Throwable t) {
153155
StringWriter stringWriter= new StringWriter();

sources/net.sf.j2s.java.junit/src/junit/runner/BaseTestRunner.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ protected static Properties getPreferences() {
3939
return fPreferences;
4040
}
4141

42+
/**
43+
* @throws IOException
44+
* @j2sNative
45+
*/
4246
public static void savePreferences() throws IOException {
4347
FileOutputStream fos= new FileOutputStream(getPreferencesFile());
4448
try {
@@ -204,20 +208,32 @@ protected void clearStatus() { // Belongs in the GUI TestRunner class
204208
* Returns the loader to be used.
205209
*/
206210
public TestSuiteLoader getLoader() {
211+
/**
212+
* @j2sNative
213+
*/ {
207214
if (useReloadingTestSuiteLoader())
208215
return new ReloadingTestSuiteLoader();
216+
}
209217
return new StandardTestSuiteLoader();
210218
}
211219

212220
protected boolean useReloadingTestSuiteLoader() {
213221
return getPreference("loading").equals("true") && !inVAJava() && fLoading;
214222
}
215223

224+
/**
225+
* @return
226+
* @j2sNative
227+
* return null;
228+
*/
216229
private static File getPreferencesFile() {
217230
String home= System.getProperty("user.home");
218231
return new File(home, "junit.properties");
219232
}
220233

234+
/**
235+
* @j2sNative
236+
*/
221237
private static void readPreferences() {
222238
InputStream is= null;
223239
try {
@@ -261,6 +277,8 @@ public static boolean inVAJava() {
261277

262278
/**
263279
* Returns a filtered stack trace
280+
* @j2sNative
281+
* return "";
264282
*/
265283
public static String getFilteredTrace(Throwable t) {
266284
StringWriter stringWriter= new StringWriter();
@@ -273,6 +291,8 @@ public static String getFilteredTrace(Throwable t) {
273291

274292
/**
275293
* Filters stack frames from internal JUnit classes
294+
* @j2sNative
295+
* return "";
276296
*/
277297
public static String getFilteredTrace(String stack) {
278298
if (showStackRaw())

0 commit comments

Comments
 (0)