Skip to content

Commit d4f7356

Browse files
committed
This revision adds hamcrest-core-1.3.jar to lib/buildlib; the version of JUnit now being used (4.11?) requires it. This revision also includes lots of minor changes and format edits that are probably not very important. But I wanted the repository to be consistent with my current build.
The following files were added, deleted, or modified: new file: lib/buildlib/hamcrest-core-1.3.jar modified: src/edu/rice/cs/drjava/config/OptionConstants.java modified: src/edu/rice/cs/drjava/config/RecursiveFileListPropertyTest.java modified: src/edu/rice/cs/drjava/model/AbstractGlobalModel.java modified: src/edu/rice/cs/drjava/model/ClipboardHistoryModelTest.java modified: src/edu/rice/cs/drjava/model/DefaultGlobalModel.java modified: src/edu/rice/cs/drjava/model/GlobalModelCompileTest.java modified: src/edu/rice/cs/drjava/model/GlobalModelJUnitTest.java modified: src/edu/rice/cs/drjava/model/GlobalModelTestCase.java modified: src/edu/rice/cs/drjava/model/repl/newjvm/MainJVM.java modified: src/edu/rice/cs/drjava/model/repl/newjvm/MainJVMRemoteI.java modified: src/edu/rice/cs/drjava/ui/DefinitionsPaneTest.java modified: src/edu/rice/cs/util/XMLConfigTest.java modified: src/edu/rice/cs/util/newjvm/AbstractMasterJVM.java modified: src/edu/rice/cs/util/newjvm/AbstractSlaveJVM.java modified: ../javalanglevels/build.xml deleted: ../javalanglevels/lib/plt.jar
1 parent 51c69d0 commit d4f7356

17 files changed

+57
-58
lines changed
44 KB
Binary file not shown.

drjava/src/edu/rice/cs/drjava/config/OptionConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1672,7 +1672,7 @@ public static ArrayList<String> evaluate() {
16721672

16731673
/** Number of entries in the browser history (0 for unlimited). */
16741674
public static final NonNegativeIntegerOption BROWSER_HISTORY_MAX_SIZE =
1675-
new NonNegativeIntegerOption("browser.history.max.size", Integer.valueOf(1000));
1675+
new NonNegativeIntegerOption("browser.history.max.size", 10000); // exploting autoboxing
16761676

16771677
/** Whether to also list files with fully qualified paths. */
16781678
public static final BooleanOption DIALOG_GOTOFILE_FULLY_QUALIFIED =

drjava/src/edu/rice/cs/drjava/config/RecursiveFileListPropertyTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package edu.rice.cs.drjava.config;
22

33
import junit.framework.TestCase;
4-
import junit.framework.Assert;
4+
import org.junit.Assert;
55

66
import java.io.File;
77
import java.io.FileFilter;

drjava/src/edu/rice/cs/drjava/model/AbstractGlobalModel.java

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,37 +1252,33 @@ public OpenDefinitionsDocument newTestCase(String name, boolean makeSetUp, boole
12521252

12531253
final StringBuilder buf = new StringBuilder();
12541254
if (! elementary) buf.append("import junit.framework.TestCase;\n\n");
1255-
buf.append("/**\n");
1256-
buf.append("* A JUnit test case class.\n");
1257-
buf.append("* Every method starting with the word \"test\" will be called when running\n");
1258-
buf.append("* the test with JUnit.\n");
1259-
buf.append("*/\n");
1255+
buf.append("/** A JUnit test case class.\n");
1256+
buf.append(" * Every method starting with the word \"test\" will be called when running\n");
1257+
buf.append(" * the test with JUnit.\n");
1258+
buf.append(" */\n");
12601259
if (! elementary) buf.append("public ");
12611260
buf.append("class ");
12621261
buf.append(name);
12631262
buf.append(" extends TestCase {\n\n");
12641263
if (makeSetUp) {
1265-
buf.append("/**\n");
1266-
buf.append("* This method is called before each test method, to perform any common\n");
1267-
buf.append("* setup if necessary.\n");
1268-
buf.append("*/\n");
1264+
buf.append("/** This method is called before each test method, to perform any common\n");
1265+
buf.append(" * setup if necessary.\n");
1266+
buf.append(" */\n");
12691267
if (! elementary) buf.append("public ");
12701268
buf.append("void setUp() throws Exception {\n}\n\n");
12711269
}
12721270
if (makeTearDown) {
1273-
buf.append("/**\n");
1274-
buf.append("* This method is called after each test method, to perform any common\n");
1275-
buf.append("* clean-up if necessary.\n");
1276-
buf.append("*/\n");
1271+
buf.append("/** This method is called after each test method, to perform any common\n");
1272+
buf.append(" * clean-up if necessary.\n");
1273+
buf.append(" */\n");
12771274
if (! elementary) buf.append("public ");
12781275
buf.append("void tearDown() throws Exception {\n}\n\n");
12791276
}
1280-
buf.append("/**\n");
1281-
buf.append("* A test method.\n");
1282-
buf.append("* (Replace \"X\" with a name describing the test. You may write as\n");
1283-
buf.append ("* many \"testSomething\" methods in this class as you wish, and each\n");
1284-
buf.append("* one will be called when running JUnit over this class.)\n");
1285-
buf.append("*/\n");
1277+
buf.append("/** A test method.\n");
1278+
buf.append(" * (Replace \"X\" with a name describing the test. You may write as\n");
1279+
buf.append(" * many \"testSomething\" methods in this class as you wish, and each\n");
1280+
buf.append(" * one will be called when running JUnit over this class.)\n");
1281+
buf.append(" */\n");
12861282
if (! elementary) buf.append("public ");
12871283
buf.append("void testX() {\n}\n\n");
12881284
buf.append("}\n");

drjava/src/edu/rice/cs/drjava/model/ClipboardHistoryModelTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package edu.rice.cs.drjava.model;
22

33
import junit.framework.TestCase;
4-
import junit.framework.Assert;
4+
import org.junit.Assert;
55

66
import java.util.List;
77

drjava/src/edu/rice/cs/drjava/model/DefaultGlobalModel.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
* methods, and the GlobalModel responds via the GlobalModelListener interface. This removes the dependency on the
103103
* UI for the logical flow of the program's features. With the current implementation, we can finally test the compile
104104
* functionality of DrJava, along with many other things. <p>
105-
* @version $Id: DefaultGlobalModel.java 5755 2013-08-30 12:00:36Z rcartwright $
105+
* @version $Id$
106106
*/
107107
public class DefaultGlobalModel extends AbstractGlobalModel {
108108
/* FIELDS */
@@ -458,7 +458,8 @@ public void ensureJVMStarterFinished() {
458458
public void resetInteractions(File wd, boolean forceReset) {
459459
assert _interactionsModel._pane != null;
460460

461-
debug.logStart();
461+
_log.log("DefaultGlobalModel.resetInteractions(" + wd + ", " + forceReset + ") called");
462+
// debug.logStart();
462463
File workDir = _interactionsModel.getWorkingDirectory();
463464
if (wd == null) { wd = workDir; }
464465
forceReset |= isClassPathChanged();
@@ -467,8 +468,10 @@ public void resetInteractions(File wd, boolean forceReset) {
467468
DrJava.getConfig().setSetting(LAST_INTERACTIONS_DIRECTORY, wd);
468469

469470
getDebugger().setAutomaticTraceEnabled(false);
471+
// log.log("_interactionsModel.resetInteractions(" + wd + ", " + forceReset + ") called");
470472
_interactionsModel.resetInterpreter(wd, forceReset);
471-
debug.logEnd();
473+
_log.log("DefaultGlobalModel.resetInteractions(" + wd + ", " + forceReset + ") complete");
474+
// debug.logEnd();
472475
}
473476

474477
/** Interprets the current given text at the prompt in the interactions pane. */

drjava/src/edu/rice/cs/drjava/model/GlobalModelCompileTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
* @version $Id$
5151
*/
5252
public final class GlobalModelCompileTest extends GlobalModelTestCase {
53-
protected static final Log _log = new Log("GlobalModelCompileTest.txt", false);
53+
protected static final Log _log = new Log("/home/cork/GlobalModelTest.txt", false);
5454

5555
/** Tests calling compileAll with no source files works. Does not reset interactions.
5656
* @throws BadLocationException if attempts to reference an invalid location

drjava/src/edu/rice/cs/drjava/model/GlobalModelJUnitTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
*/
5353
public final class GlobalModelJUnitTest extends GlobalModelTestCase {
5454

55-
private static Log _log = new Log("GlobalModelTest.txt", false);
55+
private static Log _log = new Log("/home/cork/GlobalModelJUnitTest.txt", true);
5656

5757
/** Whether or not to print debugging output. */
5858
static final boolean printMessages = true;

drjava/src/edu/rice/cs/drjava/model/GlobalModelTestCase.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
*/
7676
public abstract class GlobalModelTestCase extends MultiThreadedTestCase {
7777

78-
public static final Log _log = new Log("GlobalModelTest.txt", false);
78+
public static final Log _log = new Log("/home/cork/GlobalModelTest.txt", false);
7979

8080
protected volatile DefaultGlobalModel _model;
8181
protected volatile InteractionsController _interactionsController;
@@ -1027,6 +1027,7 @@ public void updateCurrentLocationInDoc() { /* this event is not directly tested
10271027
}
10281028

10291029
public static class InteractionListener extends TestListener {
1030+
public static Log _log = new Log("/home/cork/GlobalModelTest.txt", false);
10301031
private static final int WAIT_TIMEOUT = 20000; // time to wait for _interactionDone or _resetDone
10311032
private volatile CompletionMonitor _interactionDone;
10321033
private volatile CompletionMonitor _resetDone;
@@ -1081,6 +1082,7 @@ public void consoleReset() {
10811082
public void resetConsoleResetCount() { consoleResetCount = 0; }
10821083

10831084
public synchronized void logInteractionStart() {
1085+
_log.log("Resetting _interactionDone and _resetDone");
10841086
_interactionDone.reset();
10851087
_resetDone.reset();
10861088
}

drjava/src/edu/rice/cs/drjava/model/repl/newjvm/MainJVM.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -76,22 +76,22 @@
7676

7777
import static edu.rice.cs.plt.debug.DebugUtil.debug;
7878

79-
/** * <p>Manages a remote JVM. Includes methods for communication in both directions: MainJVMRemoteI
80-
* provides callbacks allowing the remote JVM to access the model, and a variety of delegating
81-
* methods wrap calls to the InterpreterJVMRemoteI methods, taking care of any RMI-related errors.
82-
* In the case of errors, these interpreter-delegating methods communicate the failure via the
83-
* return value. (Note that it is impossible to guarantee success of these methods -- the remote
84-
* process may exit arbitrarily at any time -- and clients should behave gracefully when failures
85-
* occur.)</p>
86-
*
87-
* <p>The current design is flawed: strictly speaking, two sequential interpreter-delegating calls to
88-
* this object may communicate with <em>different</em> JVMs if the remote JVM happens to reset in
89-
* the interim. A better design would return a separate object for interfacing with each unique remote
90-
* JVM. In this way, clients would know that all calls to a certain object would be forwarded to
91-
* the same remote JVM.</p>
92-
*
93-
* @version $Id$
94-
*/
79+
/** <p>Manages a remote JVM. Includes methods for communication in both directions: MainJVMRemoteI
80+
* provides callbacks allowing the remote JVM to access the model, and a variety of delegating
81+
* methods wrap calls to the InterpreterJVMRemoteI methods, taking care of any RMI-related errors.
82+
* In the case of errors, these interpreter-delegating methods communicate the failure via the
83+
* return value. (Note that it is impossible to guarantee success of these methods -- the remote
84+
* process may exit arbitrarily at any time -- and clients should behave gracefully when failures
85+
* occur.)</p>
86+
*
87+
* <p>The current design is flawed: strictly speaking, two sequential interpreter-delegating calls to
88+
* this object may communicate with <em>different</em> JVMs if the remote JVM happens to reset in
89+
* the interim. A better design would return a separate object for interfacing with each unique remote
90+
* JVM. In this way, clients would know that all calls to a certain object would be forwarded to
91+
* the same remote JVM.</p>
92+
*
93+
* @version $Id$
94+
*/
9595
public class MainJVM extends AbstractMasterJVM implements MainJVMRemoteI {
9696

9797
/** Number of slave startup failures allowed before aborting the startup process. */

0 commit comments

Comments
 (0)