Remove the implementation from GWTTestCase checkpoints.
http://gwt-code-reviews.appspot.com/1146801/show
Review by: conroy@google.com
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@9299 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/tools/api-checker/config/gwt21_22userApi.conf b/tools/api-checker/config/gwt21_22userApi.conf
index 959caeb..836b2e1 100644
--- a/tools/api-checker/config/gwt21_22userApi.conf
+++ b/tools/api-checker/config/gwt21_22userApi.conf
@@ -101,6 +101,8 @@
:com.google.gwt.requestfactory.client.impl.messages\
:com.google.gwt.requestfactory.client.impl\
:com.google.gwt.requestfactory.shared.impl\
+:com.google.gwt.junit.client.impl\
+:com.google.gwt.benchmarks.client.impl\
##############################################
#Api whitelist
diff --git a/user/src/com/google/gwt/junit/client/GWTTestCase.java b/user/src/com/google/gwt/junit/client/GWTTestCase.java
index a2e254b..d69acbf 100644
--- a/user/src/com/google/gwt/junit/client/GWTTestCase.java
+++ b/user/src/com/google/gwt/junit/client/GWTTestCase.java
@@ -44,6 +44,7 @@
* translatable implementation.
* </p>
*/
+@SuppressWarnings("unused")
public abstract class GWTTestCase extends TestCase {
/**
@@ -192,19 +193,12 @@
}
/**
- * Add a checkpoint message to the current test. If this test fails, all
- * checkpoint messages will be appended to the getException description. This
- * can be useful in web mode for determining how far test execution progressed
- * before a failure occurs.
+ * Does nothing.
*
- * @param msg the checkpoint message to add
- * @deprecated This method will be removed when web mode supports stack
- * traces. It can be useful for debugging web mode failures, but
- * production code should not depend on it.
+ * @deprecated implementation removed
*/
@Deprecated
public final void addCheckpoint(String msg) {
- // implemented in the translatable version of this class
}
/**
@@ -222,31 +216,22 @@
}
/**
- * Clears the accumulated list of checkpoint messages.
+ * Does nothing.
*
- * @see #addCheckpoint(String)
- * @deprecated This method will be removed if and when web mode supports stack
- * traces. It can be useful for debugging web mode failures, but
- * production code should not depend on it
+ * @deprecated implementation removed
*/
@Deprecated
public final void clearCheckpoints() {
- // implemented in the translatable version of this class
}
/**
- * Returns the current set of checkpoint messages.
+ * Returns a zero-length array.
*
- * @return a non-<code>null</code> array of checkpoint messages
- * @see #addCheckpoint(String)
- * @deprecated This method will be removed if and when web mode supports stack
- * traces. It can be useful for debugging web mode failures, but
- * production code should not depend on it
+ * @deprecated implementation removed
*/
@Deprecated
public final String[] getCheckpoints() {
- // implemented in the translatable version of this class
- return null;
+ return new String[0];
}
/**
diff --git a/user/src/com/google/gwt/junit/client/impl/JUnitResult.java b/user/src/com/google/gwt/junit/client/impl/JUnitResult.java
index d5b2449..e79e1ed 100644
--- a/user/src/com/google/gwt/junit/client/impl/JUnitResult.java
+++ b/user/src/com/google/gwt/junit/client/impl/JUnitResult.java
@@ -34,11 +34,6 @@
private transient String agent;
/**
- * If non-null, check points that were encountered during the run.
- */
- private String[] checkPoints;
-
- /**
* If non-null, an exception that occurred during the run.
*/
private ExceptionWrapper exceptionWrapper;
@@ -50,10 +45,6 @@
return agent;
}
- public String[] getCheckPoints() {
- return checkPoints;
- }
-
public Throwable getException() {
return (exceptionWrapper == null) ? null : exceptionWrapper.getException();
}
@@ -66,10 +57,6 @@
this.agent = agent;
}
- public void setCheckPoints(String[] checkPoints) {
- this.checkPoints = checkPoints;
- }
-
public void setException(Throwable exception) {
this.exceptionWrapper = new ExceptionWrapper(exception);
}
diff --git a/user/src/com/google/gwt/junit/server/JUnitHostImpl.java b/user/src/com/google/gwt/junit/server/JUnitHostImpl.java
index 91bc3f1..9f79b68 100644
--- a/user/src/com/google/gwt/junit/server/JUnitHostImpl.java
+++ b/user/src/com/google/gwt/junit/server/JUnitHostImpl.java
@@ -114,7 +114,6 @@
for (JUnitResult result : results.values()) {
initResult(getThreadLocalRequest(), result);
resymbolize(result.getException());
- addCheckPointElements(result.getException(), result.getCheckPoints());
}
JUnitMessageQueue host = getHost();
ClientInfoExt clientInfoExt = createClientInfo(clientInfo,
@@ -139,29 +138,6 @@
}
}
- /**
- * Creates fake stack trace elements for any checkpoints passed. The elements
- * are copied in reverse order, so that the last check point is at the top of
- * the trace.
- */
- private void addCheckPointElements(Throwable exception, String[] checkPoints) {
- if (checkPoints == null) {
- return;
- }
- StackTraceElement[] stackTrace = exception.getStackTrace();
- StackTraceElement[] newStackTrace = new StackTraceElement[checkPoints.length
- + stackTrace.length];
- int pos = checkPoints.length - 1;
- for (String checkPoint : checkPoints) {
- newStackTrace[pos] = new StackTraceElement("Check", "point", checkPoint,
- -1);
- --pos;
- }
- System.arraycopy(stackTrace, 0, newStackTrace, checkPoints.length,
- stackTrace.length);
- exception.setStackTrace(newStackTrace);
- }
-
private ClientInfoExt createClientInfo(ClientInfo clientInfo,
HttpServletRequest request) {
assert (clientInfo.getSessionId() >= 0);
diff --git a/user/super/com/google/gwt/junit/translatable/com/google/gwt/junit/client/GWTTestCase.java b/user/super/com/google/gwt/junit/translatable/com/google/gwt/junit/client/GWTTestCase.java
index b5755a8..86ec411 100644
--- a/user/super/com/google/gwt/junit/translatable/com/google/gwt/junit/client/GWTTestCase.java
+++ b/user/super/com/google/gwt/junit/translatable/com/google/gwt/junit/client/GWTTestCase.java
@@ -23,12 +23,10 @@
import junit.framework.TestCase;
-import java.util.ArrayList;
-import java.util.List;
-
/**
* The translatable implementation of {@link GWTTestCase}.
*/
+@SuppressWarnings("unused")
public abstract class GWTTestCase extends TestCase {
/**
@@ -92,11 +90,6 @@
};
/**
- * The collected checkpoint messages.
- */
- private List<String> checkPoints;
-
- /**
* Tracks whether the main test body has run (for asynchronous mode).
*/
private boolean mainTestHasRun = false;
@@ -166,35 +159,21 @@
}
// CHECKSTYLE_ON
- /**
- * Implementation of {@link GWTTestCase#addCheckpoint(String)}.
- */
+ @Deprecated
public void addCheckpoint(String msg) {
- if (checkPoints == null) {
- checkPoints = new ArrayList<String>();
- }
- checkPoints.add(msg);
}
public boolean catchExceptions() {
return true;
}
+ @Deprecated
public void clearCheckpoints() {
- checkPoints = null;
}
+ @Deprecated
public String[] getCheckpoints() {
- if (checkPoints == null) {
- return new String[0];
- } else {
- int len = checkPoints.size();
- String[] retval = new String[len];
- for (int i = 0; i < len; ++i) {
- retval[i] = checkPoints.get(i);
- }
- return retval;
- }
+ return new String[0];
}
public abstract String getModuleName();
@@ -305,10 +284,6 @@
JUnitResult myResult = __getOrCreateTestResult();
if (ex != null) {
myResult.setException(ex);
- if (checkPoints != null) {
- String[] cpArray = checkPoints.toArray(new String[checkPoints.size()]);
- myResult.setCheckPoints(cpArray);
- }
}
testIsFinished = true;