diff options
author | Dani Megert | 2011-03-24 11:59:16 +0000 |
---|---|---|
committer | Dani Megert | 2011-03-24 11:59:16 +0000 |
commit | 9d09c3fbac71e02660d12373e75d5fd1bc5b56b2 (patch) | |
tree | 01d6e72393db1eea3a9200b3fe148ebd5b8d94af /org.eclipse.jface.text.tests/src | |
parent | 37713bcab51a0cab403e85fe2157d07808e24771 (diff) | |
download | eclipse.platform.text-9d09c3fbac71e02660d12373e75d5fd1bc5b56b2.tar.gz eclipse.platform.text-9d09c3fbac71e02660d12373e75d5fd1bc5b56b2.tar.xz eclipse.platform.text-9d09c3fbac71e02660d12373e75d5fd1bc5b56b2.zip |
Fixed lost aboutToReconcile().v20110329-0800
Diffstat (limited to 'org.eclipse.jface.text.tests/src')
-rw-r--r-- | org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/reconciler/AbstractReconcilerTest.java | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/reconciler/AbstractReconcilerTest.java b/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/reconciler/AbstractReconcilerTest.java index a20fbaff584..698f5589d69 100644 --- a/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/reconciler/AbstractReconcilerTest.java +++ b/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/reconciler/AbstractReconcilerTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -16,6 +16,9 @@ import java.util.List; import junit.framework.TestCase; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.NullProgressMonitor; + import org.eclipse.text.tests.Accessor; import org.eclipse.jface.text.BadLocationException; @@ -129,6 +132,9 @@ public class AbstractReconcilerTest extends TestCase { protected AbstractReconciler fReconciler; private Document fDocument; + private IProgressMonitor fProgressMonitor; + + protected void setUp() { fBarrier= new Barrier(); fCallLog= Collections.synchronizedList(new ArrayList()); @@ -156,6 +162,9 @@ public class AbstractReconcilerTest extends TestCase { }; fReconciler.setIsIncrementalReconciler(false); fReconciler.setDelay(50); // make tests run faster + + fProgressMonitor= new NullProgressMonitor(); + fReconciler.setProgressMonitor(fProgressMonitor); fViewer= new TestTextViewer(); fReconciler.install(fViewer); @@ -230,8 +239,14 @@ public class AbstractReconcilerTest extends TestCase { assertTrue(isDirty()); fCallLog.clear(); dirty(); - // no aboutToBeReconciled since the reconciler is still running - // when the second edition comes in + + if (fProgressMonitor.isCanceled()) + assertEquals("aboutToBeReconciled", fCallLog.remove(0)); + else { + // no aboutToBeReconciled since the reconciler is still running + // when the second edition comes in + } + assertEquals("reconcilerReset", fCallLog.remove(0)); fBarrier.wakeAll(); @@ -358,6 +373,11 @@ public class AbstractReconcilerTest extends TestCase { return ((Boolean) bool).booleanValue(); } + boolean isCanceled() { + Object bool= fAccessor.invoke("isCanceled", null); + return ((Boolean)bool).booleanValue(); + } + boolean isDirty() { Object bool= fAccessor.invoke("isDirty", null); return ((Boolean) bool).booleanValue(); |