Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2003-11-17 15:30:55 +0000
committerMichael Valenta2003-11-17 15:30:55 +0000
commitd31e0df2158058aa8af173dac37a7d6aca69a1f7 (patch)
treeea34002aa97ea09b69d07013fadfa89351e8a1b3 /tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team
parent339e7af3b9a68c3fa3a7e826f409bf79ffd6c934 (diff)
downloadeclipse.platform.team-d31e0df2158058aa8af173dac37a7d6aca69a1f7.tar.gz
eclipse.platform.team-d31e0df2158058aa8af173dac37a7d6aca69a1f7.tar.xz
eclipse.platform.team-d31e0df2158058aa8af173dac37a7d6aca69a1f7.zip
*** empty log message ***
Diffstat (limited to 'tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team')
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/CVSTestLogListener.java42
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/CVSTestSetup.java4
2 files changed, 25 insertions, 21 deletions
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/CVSTestLogListener.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/CVSTestLogListener.java
index f0187bd8d..a912fa449 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/CVSTestLogListener.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/CVSTestLogListener.java
@@ -26,6 +26,7 @@ public class CVSTestLogListener implements ILogListener {
* @see org.eclipse.core.runtime.ILogListener#logging(org.eclipse.core.runtime.IStatus, java.lang.String)
*/
public void logging(IStatus status, String plugin) {
+ if (!CVSTestSetup.FAIL_IF_EXCEPTION_LOGGED) return;
List pluginErrors = (List)errors.get(plugin);
if (pluginErrors == null) {
pluginErrors = new ArrayList();
@@ -35,25 +36,26 @@ public class CVSTestLogListener implements ILogListener {
}
public void checkErrors() throws CoreException {
-// if (errors.isEmpty()) return;
-// List allErrors = new ArrayList();
-// for (Iterator iter = errors.values().iterator(); iter.hasNext();) {
-// allErrors.addAll((List)iter.next());
-// }
-// errors.clear();
-// if (allErrors.isEmpty()) return;
-// IStatus status = null;
-// if (allErrors.size() == 1) {
-// status = (IStatus)allErrors.get(0);
-// if (!status.isMultiStatus()) {
-// throw new CVSException(status);
-// }
-// }
-// if (status == null) {
-// status = new MultiStatus("org.eclipse.team.tests.cvs.core", 0,
-// (IStatus[]) allErrors.toArray(new IStatus[allErrors.size()]),
-// "Errors were logged during this test. Check the log file for details", null);
-// }
-// throw new CoreException(status);
+ if (!CVSTestSetup.FAIL_IF_EXCEPTION_LOGGED) return;
+ if (errors.isEmpty()) return;
+ List allErrors = new ArrayList();
+ for (Iterator iter = errors.values().iterator(); iter.hasNext();) {
+ allErrors.addAll((List)iter.next());
+ }
+ errors.clear();
+ if (allErrors.isEmpty()) return;
+ IStatus status = null;
+ if (allErrors.size() == 1) {
+ status = (IStatus)allErrors.get(0);
+ if (!status.isMultiStatus()) {
+ throw new CVSException(status);
+ }
+ }
+ if (status == null) {
+ status = new MultiStatus("org.eclipse.team.tests.cvs.core", 0,
+ (IStatus[]) allErrors.toArray(new IStatus[allErrors.size()]),
+ "Errors were logged during this test. Check the log file for details", null);
+ }
+ throw new CoreException(status);
}
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/CVSTestSetup.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/CVSTestSetup.java
index 9cd759376..7a58f9e04 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/CVSTestSetup.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/CVSTestSetup.java
@@ -28,6 +28,7 @@ public class CVSTestSetup extends TestSetup {
public static final String RSH;
public static final int WAIT_FACTOR;
public static final int COMPRESSION_LEVEL;
+ public static final boolean FAIL_IF_EXCEPTION_LOGGED;
public static final String READ_REPOSITORY_LOCATION;
public static final String WRITE_REPOSITORY_LOCATION;
@@ -47,6 +48,7 @@ public class CVSTestSetup extends TestSetup {
LOCAL_REPO = Boolean.valueOf(System.getProperty("eclipse.cvs.localRepo", "false")).booleanValue();
WAIT_FACTOR = Integer.parseInt(System.getProperty("eclipse.cvs.waitFactor", "1"));
COMPRESSION_LEVEL = Integer.parseInt(System.getProperty("eclipse.cvs.compressionLevel", "0"));
+ FAIL_IF_EXCEPTION_LOGGED = Boolean.valueOf(System.getProperty("eclipse.cvs.failLog", "true")).booleanValue();
}
public static void loadProperties() {
@@ -168,7 +170,7 @@ public class CVSTestSetup extends TestSetup {
}
CVSProviderPlugin.getPlugin().setCompressionLevel(COMPRESSION_LEVEL);
// Add a log listener so we can ensure that nothing is logged during a test
- if (logListener == null) {
+ if (CVSTestSetup.FAIL_IF_EXCEPTION_LOGGED && logListener == null) {
logListener = new CVSTestLogListener();
Platform.addLogListener(logListener);
}

Back to the top