Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.team.tests.core; singleton:=true
Bundle-Version: 3.11.0.qualifier
Bundle-Version: 3.11.100.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package: org.eclipse.team.tests.core,
Expand Down
2 changes: 1 addition & 1 deletion team/tests/org.eclipse.team.tests.core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<version>4.40.0-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.team.tests.core</artifactId>
<version>3.11.0-SNAPSHOT</version>
<version>3.11.100-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.eclipse.compare.ITypedElement;
import org.eclipse.compare.contentmergeviewer.TextMergeViewer;
import org.eclipse.compare.internal.CompareEditor;
import org.eclipse.compare.internal.ComparePreferencePage;
import org.eclipse.compare.internal.CompareUIPlugin;
import org.eclipse.compare.internal.MergeSourceViewer;
import org.eclipse.compare.structuremergeviewer.Differencer;
Expand All @@ -47,6 +48,7 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.tests.resources.util.WorkspaceResetExtension;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.graphics.Image;
Expand Down Expand Up @@ -214,8 +216,8 @@ public TestSaveableEditorInput(ITypedElement left, ITypedElement right,
protected ICompareInput prepareCompareInput(IProgressMonitor monitor)
throws InvocationTargetException, InterruptedException {
input = createCompareInput();
getCompareConfiguration().setLeftEditable(true);
getCompareConfiguration().setRightEditable(false);
getCompareConfiguration().setLeftEditable(leftIsChanged());
getCompareConfiguration().setRightEditable(rightIsChanged());
return null;
}

Expand All @@ -229,6 +231,15 @@ protected void fireInputChange() {
}
}

static boolean rightIsChanged() {
IPreferenceStore store = CompareUIPlugin.getDefault().getPreferenceStore();
return store.getBoolean(ComparePreferencePage.SWAPPED);
}

static boolean leftIsChanged() {
return !rightIsChanged();
}

private void verifyDirtyStateChanges(
TestSaveableEditorInput compareEditorInput)
throws IllegalArgumentException, SecurityException,
Expand All @@ -240,10 +251,14 @@ private void verifyDirtyStateChanges(
.findContentViewer(null, compareEditorInput.input, shell);
viewer.setInput(compareEditorInput.getCompareResult());

MergeSourceViewer left = (MergeSourceViewer) ReflectionUtils.getField(
viewer, "fLeft");
MergeSourceViewer changed;
if (leftIsChanged()) {
changed = (MergeSourceViewer) ReflectionUtils.getField(viewer, "fLeft");
} else {
changed = (MergeSourceViewer) ReflectionUtils.getField(viewer, "fRight");
}

StyledText leftText = left.getSourceViewer().getTextWidget();
StyledText leftText = changed.getSourceViewer().getTextWidget();

// modify the left side of editor
leftText.append(appendFileContents);
Expand All @@ -270,7 +285,6 @@ public void testDirtyFlagOnLocalResourceTypedElement()
ITypedElement el2 = new TestFileElement(file2);

CompareConfiguration conf = new CompareConfiguration();
conf.setLeftEditable(true);
TestSaveableEditorInput compareEditorInput = new TestSaveableEditorInput(
el1, el2, conf);

Expand All @@ -293,7 +307,6 @@ public void testDirtyFlagOnCustomTypedElement() throws CoreException,
ITypedElement el2 = new TestFileElement(file2);

CompareConfiguration conf = new CompareConfiguration();
conf.setLeftEditable(true);
TestSaveableEditorInput compareEditorInput = new TestSaveableEditorInput(
el1, el2, conf);

Expand Down Expand Up @@ -321,7 +334,6 @@ public void testDirtyFlagOnLocalResourceTypedElementAndEmptyRight()
ITypedElement el2 = null;

CompareConfiguration conf = new CompareConfiguration();
conf.setLeftEditable(true);
TestSaveableEditorInput compareEditorInput = new TestSaveableEditorInput(
el1, el2, conf);

Expand All @@ -344,7 +356,6 @@ public void testDirtyFlagOnCustomTypedElementAndEmptyRight()
ITypedElement el2 = null;

CompareConfiguration conf = new CompareConfiguration();
conf.setLeftEditable(true);
TestSaveableEditorInput compareEditorInput = new TestSaveableEditorInput(
el1, el2, conf);

Expand Down
Loading