Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Keller2015-11-29 21:11:24 +0000
committerMarkus Keller2015-12-01 01:50:38 +0000
commit64b34b614087b96e6cc92c72143768b98ae32602 (patch)
tree4f4f493fd8161f9a5885f11021cd14a923946e9f /org.eclipse.core.filebuffers.tests
parentf01dd079500e382823d5d1767996cb9ef85233ee (diff)
downloadeclipse.platform.text-64b34b614087b96e6cc92c72143768b98ae32602.tar.gz
eclipse.platform.text-64b34b614087b96e6cc92c72143768b98ae32602.tar.xz
eclipse.platform.text-64b34b614087b96e6cc92c72143768b98ae32602.zip
Bug 478673: added @Override/@Deprecated and removed non-Javadoc boilerplate
Diffstat (limited to 'org.eclipse.core.filebuffers.tests')
-rw-r--r--org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBufferCreation.java2
-rw-r--r--org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBufferFunctions.java28
-rw-r--r--org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBufferListener.java40
-rw-r--r--org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForExternalFiles.java29
-rw-r--r--org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForFilesInLinkedFolders.java29
-rw-r--r--org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForLinkedFiles.java29
-rw-r--r--org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForNonAccessibleWorkspaceFiles.java30
-rw-r--r--org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForNonExistingExternalFiles.java26
-rw-r--r--org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForNonExistingWorkspaceFiles.java29
-rw-r--r--org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForWorkspaceFiles.java22
-rw-r--r--org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileStoreFileBufferFunctions.java28
-rw-r--r--org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileStoreFileBuffersForExternalFiles.java29
-rw-r--r--org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileStoreFileBuffersForNonExistingExternalFiles.java26
-rw-r--r--org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileStoreFileBuffersForNonExistingWorkspaceFiles.java29
-rw-r--r--org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileStoreFileBuffersForWorkspaceFiles.java22
-rw-r--r--org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/MockDocumentSetupParticipants.java11
-rw-r--r--org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/ResourceTextFileManagerDocCreationTests.java3
-rw-r--r--org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/TextFileManagerDocCreationTests.java3
18 files changed, 169 insertions, 246 deletions
diff --git a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBufferCreation.java b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBufferCreation.java
index 20f338caa5a..eb8667b1032 100644
--- a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBufferCreation.java
+++ b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBufferCreation.java
@@ -53,10 +53,12 @@ public class FileBufferCreation extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
fProject= ResourceHelper.createProject("project");
}
+ @Override
protected void tearDown() throws Exception {
ResourceHelper.deleteProject("project");
}
diff --git a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBufferFunctions.java b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBufferFunctions.java
index 5a0254672d4..71533493dec 100644
--- a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBufferFunctions.java
+++ b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBufferFunctions.java
@@ -60,6 +60,7 @@ public abstract class FileBufferFunctions extends TestCase {
protected abstract Class getAnnotationModelClass() throws Exception;
+ @Override
protected void setUp() throws Exception {
fManager= FileBuffers.getTextFileBufferManager();
fProject= ResourceHelper.createProject("project");
@@ -72,6 +73,7 @@ public abstract class FileBufferFunctions extends TestCase {
return fProject;
}
+ @Override
protected void tearDown() throws Exception {
ITextFileBuffer buffer= fManager.getTextFileBuffer(fPath, LocationKind.NORMALIZE);
assertTrue(buffer == null);
@@ -335,11 +337,13 @@ public abstract class FileBufferFunctions extends TestCase {
public IFileBuffer buffer;
public int count;
+ @Override
public void bufferCreated(IFileBuffer buf) {
++count;
this.buffer= buf;
}
+ @Override
public void bufferDisposed(IFileBuffer buf) {
--count;
this.buffer= buf;
@@ -380,6 +384,7 @@ public abstract class FileBufferFunctions extends TestCase {
public int count;
public boolean isDirty;
+ @Override
public void dirtyStateChanged(IFileBuffer buf, boolean state) {
++count;
this.buffer= buf;
@@ -430,6 +435,7 @@ public abstract class FileBufferFunctions extends TestCase {
public int count;
public boolean isDirty;
+ @Override
public void dirtyStateChanged(IFileBuffer buf, boolean state) {
++count;
this.buffer= buf;
@@ -478,11 +484,13 @@ public abstract class FileBufferFunctions extends TestCase {
public IFileBuffer preBuffer, postBuffer;
public int preCount, postCount;
+ @Override
public void bufferContentAboutToBeReplaced(IFileBuffer buffer) {
++preCount;
preBuffer= buffer;
}
+ @Override
public void bufferContentReplaced(IFileBuffer buffer) {
++postCount;
postBuffer= buffer;
@@ -527,11 +535,13 @@ public abstract class FileBufferFunctions extends TestCase {
public IFileBuffer preBuffer, postBuffer;
public int preCount, postCount;
+ @Override
public void bufferContentAboutToBeReplaced(IFileBuffer buffer) {
++preCount;
preBuffer= buffer;
}
+ @Override
public void bufferContentReplaced(IFileBuffer buffer) {
++postCount;
postBuffer= buffer;
@@ -575,6 +585,7 @@ public abstract class FileBufferFunctions extends TestCase {
public int count;
public boolean isStateValidated;
+ @Override
public void stateValidationChanged(IFileBuffer buf, boolean state) {
++count;
this.buffer= buf;
@@ -619,6 +630,7 @@ public abstract class FileBufferFunctions extends TestCase {
public int count;
public boolean isStateValidated;
+ @Override
public void stateValidationChanged(IFileBuffer buf, boolean state) {
++count;
this.buffer= buf;
@@ -664,6 +676,7 @@ public abstract class FileBufferFunctions extends TestCase {
public int count;
public boolean isStateValidated;
+ @Override
public void stateValidationChanged(IFileBuffer buf, boolean state) {
++count;
this.buffer= buf;
@@ -709,6 +722,7 @@ public abstract class FileBufferFunctions extends TestCase {
public int count;
public boolean isStateValidated;
+ @Override
public void stateValidationChanged(IFileBuffer buf, boolean state) {
++count;
this.buffer= buf;
@@ -755,6 +769,7 @@ public abstract class FileBufferFunctions extends TestCase {
public IFileBuffer buffer;
public int count;
+ @Override
public void underlyingFileDeleted(IFileBuffer buf) {
++count;
this.buffer= buf;
@@ -795,6 +810,7 @@ public abstract class FileBufferFunctions extends TestCase {
public int count;
public IPath newLocation;
+ @Override
public void underlyingFileMoved(IFileBuffer buf, IPath location) {
++count;
this.buffer= buf;
@@ -847,6 +863,7 @@ public abstract class FileBufferFunctions extends TestCase {
public IFileBuffer buffer;
public int count;
+ @Override
public void stateChanging(IFileBuffer buf) {
++count;
this.buffer= buf;
@@ -886,6 +903,7 @@ public abstract class FileBufferFunctions extends TestCase {
public IFileBuffer buffer;
public int count;
+ @Override
public void stateChanging(IFileBuffer buf) {
++count;
this.buffer= buf;
@@ -925,6 +943,7 @@ public abstract class FileBufferFunctions extends TestCase {
public IFileBuffer buffer;
public int count;
+ @Override
public void stateChanging(IFileBuffer buf) {
++count;
this.buffer= buf;
@@ -964,6 +983,7 @@ public abstract class FileBufferFunctions extends TestCase {
public IFileBuffer buffer;
public int count;
+ @Override
public void stateChanging(IFileBuffer buf) {
++count;
this.buffer= buf;
@@ -1004,6 +1024,7 @@ public abstract class FileBufferFunctions extends TestCase {
public IFileBuffer buffer;
public int count;
+ @Override
public void stateChanging(IFileBuffer buf) {
++count;
this.buffer= buf;
@@ -1045,6 +1066,7 @@ public abstract class FileBufferFunctions extends TestCase {
public IFileBuffer buffer;
public int count;
+ @Override
public void stateChanging(IFileBuffer buf) {
++count;
this.buffer= buf;
@@ -1107,9 +1129,11 @@ public abstract class FileBufferFunctions extends TestCase {
int notifyCount= 0;
+ @Override
public void bufferCreated(IFileBuffer buffer) {
notifyCount++;
}
+ @Override
public void bufferDisposed(IFileBuffer buffer) {
notifyCount++;
}
@@ -1118,10 +1142,12 @@ public abstract class FileBufferFunctions extends TestCase {
class ForcedException extends RuntimeException {
private static final long serialVersionUID= 1L;
+ @Override
public void printStackTrace(PrintStream s) {
s.println("!FORCED BY TEST: this entry is intentional");
}
+ @Override
public void printStackTrace(PrintWriter s) {
s.println("!FORCED BY TEST: this entry is intentional");
}
@@ -1131,9 +1157,11 @@ public abstract class FileBufferFunctions extends TestCase {
NotifiedListener notifyCounter2= new NotifiedListener();
FileBufferListener failingListener= new FileBufferListener() {
+ @Override
public void bufferCreated(IFileBuffer buffer) {
throw new ForcedException();
}
+ @Override
public void bufferDisposed(IFileBuffer buffer) {
throw new ForcedException();
}
diff --git a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBufferListener.java b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBufferListener.java
index 4dbc0deb4bc..b70a6897cb2 100644
--- a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBufferListener.java
+++ b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBufferListener.java
@@ -20,63 +20,43 @@ import org.eclipse.core.filebuffers.IFileBufferListener;
*/
public class FileBufferListener implements IFileBufferListener {
- /*
- * @see org.eclipse.core.filebuffers.IFileBufferListener#bufferCreated(org.eclipse.core.filebuffers.IFileBuffer)
- */
+ @Override
public void bufferCreated(IFileBuffer buffer) {
}
- /*
- * @see org.eclipse.core.filebuffers.IFileBufferListener#bufferDisposed(org.eclipse.core.filebuffers.IFileBuffer)
- */
+ @Override
public void bufferDisposed(IFileBuffer buffer) {
}
- /*
- * @see org.eclipse.core.filebuffers.IFileBufferListener#bufferContentAboutToBeReplaced(org.eclipse.core.filebuffers.IFileBuffer)
- */
+ @Override
public void bufferContentAboutToBeReplaced(IFileBuffer buffer) {
}
- /*
- * @see org.eclipse.core.filebuffers.IFileBufferListener#bufferContentReplaced(org.eclipse.core.filebuffers.IFileBuffer)
- */
+ @Override
public void bufferContentReplaced(IFileBuffer buffer) {
}
- /*
- * @see org.eclipse.core.filebuffers.IFileBufferListener#stateChanging(org.eclipse.core.filebuffers.IFileBuffer)
- */
+ @Override
public void stateChanging(IFileBuffer buffer) {
}
- /*
- * @see org.eclipse.core.filebuffers.IFileBufferListener#dirtyStateChanged(org.eclipse.core.filebuffers.IFileBuffer, boolean)
- */
+ @Override
public void dirtyStateChanged(IFileBuffer buffer, boolean isDirty) {
}
- /*
- * @see org.eclipse.core.filebuffers.IFileBufferListener#stateValidationChanged(org.eclipse.core.filebuffers.IFileBuffer, boolean)
- */
+ @Override
public void stateValidationChanged(IFileBuffer buffer, boolean isStateValidated) {
}
- /*
- * @see org.eclipse.core.filebuffers.IFileBufferListener#underlyingFileMoved(org.eclipse.core.filebuffers.IFileBuffer, org.eclipse.core.runtime.IPath)
- */
+ @Override
public void underlyingFileMoved(IFileBuffer buffer, IPath path) {
}
- /*
- * @see org.eclipse.core.filebuffers.IFileBufferListener#underlyingFileDeleted(org.eclipse.core.filebuffers.IFileBuffer)
- */
+ @Override
public void underlyingFileDeleted(IFileBuffer buffer) {
}
- /*
- * @see org.eclipse.core.filebuffers.IFileBufferListener#stateChangeFailed(org.eclipse.core.filebuffers.IFileBuffer)
- */
+ @Override
public void stateChangeFailed(IFileBuffer buffer) {
}
}
diff --git a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForExternalFiles.java b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForExternalFiles.java
index 65f3b3c53db..6f165eb60f3 100644
--- a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForExternalFiles.java
+++ b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForExternalFiles.java
@@ -27,18 +27,14 @@ import org.eclipse.core.filebuffers.FileBuffers;
*/
public class FileBuffersForExternalFiles extends FileBufferFunctions {
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#tearDown()
- */
+ @Override
protected void tearDown() throws Exception {
FileTool.delete(getPath());
FileTool.delete(FileBuffers.getSystemFileAtLocation(getPath()).getParentFile());
super.tearDown();
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#createPath(org.eclipse.core.resources.IProject)
- */
+ @Override
protected IPath createPath(IProject project) throws Exception {
File sourceFile= FileTool.getFileInPlugin(FileBuffersTestPlugin.getDefault(), new Path("testResources/ExternalFile"));
File externalFile= FileTool.createTempFileInPlugin(FileBuffersTestPlugin.getDefault(), new Path("externalResources/ExternalFile"));
@@ -46,43 +42,34 @@ public class FileBuffersForExternalFiles extends FileBufferFunctions {
return new Path(externalFile.getAbsolutePath());
}
+ @Override
protected void setReadOnly(boolean state) throws Exception {
IFileStore fileStore= FileBuffers.getFileStoreAtLocation(getPath());
assertNotNull(fileStore);
fileStore.fetchInfo().setAttribute(EFS.ATTRIBUTE_READ_ONLY, state);
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#isStateValidationSupported()
- */
+ @Override
protected boolean isStateValidationSupported() {
return false;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#deleteUnderlyingFile()
- */
+ @Override
protected boolean deleteUnderlyingFile() throws Exception {
return false;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#moveUnderlyingFile()
- */
+ @Override
protected IPath moveUnderlyingFile() throws Exception {
return null;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#modifyUnderlyingFile()
- */
+ @Override
protected boolean modifyUnderlyingFile() throws Exception {
return false;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#getAnnotationModelClass()
- */
+ @Override
protected Class getAnnotationModelClass() throws Exception {
return null;
}
diff --git a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForFilesInLinkedFolders.java b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForFilesInLinkedFolders.java
index 59b7ab1720f..55dc5ec0938 100644
--- a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForFilesInLinkedFolders.java
+++ b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForFilesInLinkedFolders.java
@@ -41,9 +41,7 @@ public class FileBuffersForFilesInLinkedFolders extends FileBufferFunctions {
private File fExternalFile;
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#tearDown()
- */
+ @Override
protected void tearDown() throws Exception {
FileTool.delete(getPath());
File file= fExternalFile;
@@ -55,9 +53,7 @@ public class FileBuffersForFilesInLinkedFolders extends FileBufferFunctions {
super.tearDown();
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#createPath(org.eclipse.core.resources.IProject)
- */
+ @Override
protected IPath createPath(IProject project) throws Exception {
File sourceFile= FileTool.getFileInPlugin(FileBuffersTestPlugin.getDefault(), new Path("testResources/linkedFolderTarget/FileInLinkedFolder"));
fExternalFile= FileTool.createTempFileInPlugin(FileBuffersTestPlugin.getDefault(), new Path("externalResources/linkedFolderTarget/FileInLinkedFolder"));
@@ -71,6 +67,7 @@ public class FileBuffersForFilesInLinkedFolders extends FileBufferFunctions {
/*
* @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#markReadOnly()
*/
+ @Override
protected void setReadOnly(boolean state) throws Exception {
IFile file= FileBuffers.getWorkspaceFileAtLocation(getPath());
ResourceAttributes attributes= new ResourceAttributes();
@@ -78,25 +75,19 @@ public class FileBuffersForFilesInLinkedFolders extends FileBufferFunctions {
file.setResourceAttributes(attributes);
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#isStateValidationSupported()
- */
+ @Override
protected boolean isStateValidationSupported() {
return true;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#deleteUnderlyingFile()
- */
+ @Override
protected boolean deleteUnderlyingFile() throws Exception {
IFile file= FileBuffers.getWorkspaceFileAtLocation(getPath());
file.delete(true, false, null);
return file.exists();
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#moveUnderlyingFile()
- */
+ @Override
protected IPath moveUnderlyingFile() throws Exception {
IFile file= FileBuffers.getWorkspaceFileAtLocation(getPath());
ResourceHelper.createFolder("project/folderA");
@@ -110,9 +101,7 @@ public class FileBuffersForFilesInLinkedFolders extends FileBufferFunctions {
return null;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#modifyUnderlyingFile()
- */
+ @Override
protected boolean modifyUnderlyingFile() throws Exception {
IFileStore fileStore= FileBuffers.getFileStoreAtLocation(getPath());
assertTrue(fileStore.fetchInfo().exists());
@@ -135,9 +124,7 @@ public class FileBuffersForFilesInLinkedFolders extends FileBufferFunctions {
return true;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#getAnnotationModelClass()
- */
+ @Override
protected Class getAnnotationModelClass() throws Exception {
Bundle bundle= Platform.getBundle("org.eclipse.ui.editors");
return bundle != null ? IAnnotationModel.class : null;
diff --git a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForLinkedFiles.java b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForLinkedFiles.java
index 9e5cd2637a3..26a35228861 100644
--- a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForLinkedFiles.java
+++ b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForLinkedFiles.java
@@ -34,18 +34,14 @@ public class FileBuffersForLinkedFiles extends FileBufferFunctions {
private File fExternalFile;
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#tearDown()
- */
+ @Override
protected void tearDown() throws Exception {
FileTool.delete(fExternalFile);
FileTool.delete(fExternalFile.getParentFile());
super.tearDown();
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#createPath(org.eclipse.core.resources.IProject)
- */
+ @Override
protected IPath createPath(IProject project) throws Exception {
File sourceFile= FileTool.getFileInPlugin(FileBuffersTestPlugin.getDefault(), new Path("testResources/LinkedFileTarget"));
fExternalFile= FileTool.createTempFileInPlugin(FileBuffersTestPlugin.getDefault(), new Path("externalResources/LinkedFileTarget"));
@@ -57,6 +53,7 @@ public class FileBuffersForLinkedFiles extends FileBufferFunctions {
/*
* @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#markReadOnly()
*/
+ @Override
protected void setReadOnly(boolean state) throws Exception {
IFile file= FileBuffers.getWorkspaceFileAtLocation(getPath());
ResourceAttributes attributes= new ResourceAttributes();
@@ -64,25 +61,19 @@ public class FileBuffersForLinkedFiles extends FileBufferFunctions {
file.setResourceAttributes(attributes);
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#isStateValidationSupported()
- */
+ @Override
protected boolean isStateValidationSupported() {
return true;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#deleteUnderlyingFile()
- */
+ @Override
protected boolean deleteUnderlyingFile() throws Exception {
IFile file= FileBuffers.getWorkspaceFileAtLocation(getPath());
file.delete(true, false, null);
return file.exists();
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#moveUnderlyingFile()
- */
+ @Override
protected IPath moveUnderlyingFile() throws Exception {
IFile file= FileBuffers.getWorkspaceFileAtLocation(getPath());
ResourceHelper.createFolder("project/folderA");
@@ -96,9 +87,7 @@ public class FileBuffersForLinkedFiles extends FileBufferFunctions {
return null;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#modifyUnderlyingFile()
- */
+ @Override
protected boolean modifyUnderlyingFile() throws Exception {
FileTool.write(fExternalFile.getAbsolutePath(), new StringBuffer("Changed content of linked file"));
fExternalFile.setLastModified(1000);
@@ -107,9 +96,7 @@ public class FileBuffersForLinkedFiles extends FileBufferFunctions {
return true;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#getAnnotationModelClass()
- */
+ @Override
protected Class getAnnotationModelClass() throws Exception {
Bundle bundle= Platform.getBundle("org.eclipse.ui.editors");
return bundle != null ? IAnnotationModel.class : null;
diff --git a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForNonAccessibleWorkspaceFiles.java b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForNonAccessibleWorkspaceFiles.java
index 3272f550245..f2526d51873 100644
--- a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForNonAccessibleWorkspaceFiles.java
+++ b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForNonAccessibleWorkspaceFiles.java
@@ -26,11 +26,13 @@ import org.eclipse.core.filebuffers.FileBuffers;
*/
public class FileBuffersForNonAccessibleWorkspaceFiles extends FileBufferFunctions {
+ @Override
protected void setUp() throws Exception {
super.setUp();
getProject().close(null);
}
+ @Override
protected IPath createPath(IProject project) throws Exception {
IFolder folder= ResourceHelper.createFolder("project/folderA/folderB/");
IFile file= ResourceHelper.createFile(folder, "WorkspaceFile", "content");
@@ -38,9 +40,7 @@ public class FileBuffersForNonAccessibleWorkspaceFiles extends FileBufferFunctio
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#tearDown()
- */
+ @Override
protected void tearDown() throws Exception {
FileTool.delete(getPath());
super.tearDown();
@@ -49,55 +49,49 @@ public class FileBuffersForNonAccessibleWorkspaceFiles extends FileBufferFunctio
/*
* @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#markReadOnly()
*/
+ @Override
protected void setReadOnly(boolean state) throws Exception {
IFileStore fileStore= FileBuffers.getFileStoreAtLocation(getPath());
assertNotNull(fileStore);
fileStore.fetchInfo().setAttribute(EFS.ATTRIBUTE_READ_ONLY, state);
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#isStateValidationSupported()
- */
+ @Override
protected boolean isStateValidationSupported() {
return false;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#deleteUnderlyingFile()
- */
+ @Override
protected boolean deleteUnderlyingFile() throws Exception {
return false;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#moveUnderlyingFile()
- */
+ @Override
protected IPath moveUnderlyingFile() throws Exception {
return null;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#modifyUnderlyingFile()
- */
+ @Override
protected boolean modifyUnderlyingFile() throws Exception {
return false;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#getAnnotationModelClass()
- */
+ @Override
protected Class getAnnotationModelClass() throws Exception {
return null;
}
+ @Override
public void test7() throws Exception {
// disable because it might create a file outside the closed project
}
+ @Override
public void test11_1() throws Exception {
// disable because it might create a file outside the closed project
}
+ @Override
public void test17_3() throws Exception {
// disable because it might create a file outside the closed project
}
diff --git a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForNonExistingExternalFiles.java b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForNonExistingExternalFiles.java
index 7afde21f432..ccf40bd5e14 100644
--- a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForNonExistingExternalFiles.java
+++ b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForNonExistingExternalFiles.java
@@ -25,14 +25,13 @@ import org.eclipse.core.filebuffers.FileBuffers;
*/
public class FileBuffersForNonExistingExternalFiles extends FileBufferFunctions {
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#tearDown()
- */
+ @Override
protected void tearDown() throws Exception {
FileTool.delete(getPath());
super.tearDown();
}
+ @Override
protected IPath createPath(IProject project) throws Exception {
IPath path= FileBuffersTestPlugin.getDefault().getStateLocation();
path= path.append("NonExistingExternalFile");
@@ -42,43 +41,34 @@ public class FileBuffersForNonExistingExternalFiles extends FileBufferFunctions
/*
* @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#markReadOnly()
*/
+ @Override
protected void setReadOnly(boolean state) throws Exception {
IFileStore fileStore= FileBuffers.getFileStoreAtLocation(getPath());
assertNotNull(fileStore);
fileStore.fetchInfo().setAttribute(EFS.ATTRIBUTE_READ_ONLY, state);
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#isStateValidationSupported()
- */
+ @Override
protected boolean isStateValidationSupported() {
return false;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#deleteUnderlyingFile()
- */
+ @Override
protected boolean deleteUnderlyingFile() throws Exception {
return false;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#moveUnderlyingFile()
- */
+ @Override
protected IPath moveUnderlyingFile() throws Exception {
return null;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#modifyUnderlyingFile()
- */
+ @Override
protected boolean modifyUnderlyingFile() throws Exception {
return false;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#getAnnotationModelClass()
- */
+ @Override
protected Class getAnnotationModelClass() throws Exception {
return null;
}
diff --git a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForNonExistingWorkspaceFiles.java b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForNonExistingWorkspaceFiles.java
index e953f63cc79..7629120ddcc 100644
--- a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForNonExistingWorkspaceFiles.java
+++ b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForNonExistingWorkspaceFiles.java
@@ -28,17 +28,13 @@ import org.eclipse.core.filebuffers.LocationKind;
*/
public class FileBuffersForNonExistingWorkspaceFiles extends FileBufferFunctions {
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#tearDown()
- */
+ @Override
protected void tearDown() throws Exception {
FileTool.delete(getPath());
super.tearDown();
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#createPath(org.eclipse.core.resources.IProject)
- */
+ @Override
protected IPath createPath(IProject project) throws Exception {
IFolder folder= ResourceHelper.createFolder("project/folderA/folderB/");
IPath filePath= folder.getLocation().append("NonExistingWorkspaceFile");
@@ -77,43 +73,34 @@ public class FileBuffersForNonExistingWorkspaceFiles extends FileBufferFunctions
/*
* @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#markReadOnly()
*/
+ @Override
protected void setReadOnly(boolean state) throws Exception {
IFileStore fileStore= FileBuffers.getFileStoreAtLocation(getPath());
assertNotNull(fileStore);
fileStore.fetchInfo().setAttribute(EFS.ATTRIBUTE_READ_ONLY, state);
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#isStateValidationSupported()
- */
+ @Override
protected boolean isStateValidationSupported() {
return false;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#deleteUnderlyingFile()
- */
+ @Override
protected boolean deleteUnderlyingFile() throws Exception {
return false;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#moveUnderlyingFile()
- */
+ @Override
protected IPath moveUnderlyingFile() throws Exception {
return null;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#modifyUnderlyingFile()
- */
+ @Override
protected boolean modifyUnderlyingFile() throws Exception {
return false;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#getAnnotationModelClass()
- */
+ @Override
protected Class getAnnotationModelClass() throws Exception {
return null;
}
diff --git a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForWorkspaceFiles.java b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForWorkspaceFiles.java
index f540f3363d9..7f703dd39a8 100644
--- a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForWorkspaceFiles.java
+++ b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForWorkspaceFiles.java
@@ -38,6 +38,7 @@ import org.eclipse.jface.text.source.IAnnotationModel;
*/
public class FileBuffersForWorkspaceFiles extends FileBufferFunctions {
+ @Override
protected IPath createPath(IProject project) throws Exception {
IFolder folder= ResourceHelper.createFolder("project/folderA/folderB/");
IFile file= ResourceHelper.createFile(folder, "WorkspaceFile", "content");
@@ -47,6 +48,7 @@ public class FileBuffersForWorkspaceFiles extends FileBufferFunctions {
/*
* @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#markReadOnly()
*/
+ @Override
protected void setReadOnly(boolean state) throws Exception {
IFile file= FileBuffers.getWorkspaceFileAtLocation(getPath());
ResourceAttributes attributes= new ResourceAttributes();
@@ -54,25 +56,19 @@ public class FileBuffersForWorkspaceFiles extends FileBufferFunctions {
file.setResourceAttributes(attributes);
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#isStateValidationSupported()
- */
+ @Override
protected boolean isStateValidationSupported() {
return true;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#deleteUnderlyingFile()
- */
+ @Override
protected boolean deleteUnderlyingFile() throws Exception {
IFile file= FileBuffers.getWorkspaceFileAtLocation(getPath());
file.delete(true, false, null);
return file.exists();
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#moveUnderlyingFile()
- */
+ @Override
protected IPath moveUnderlyingFile() throws Exception {
IFile file= FileBuffers.getWorkspaceFileAtLocation(getPath());
ResourceHelper.createFolder("project/folderA/folderB/folderC");
@@ -86,9 +82,7 @@ public class FileBuffersForWorkspaceFiles extends FileBufferFunctions {
return null;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#modifyUnderlyingFile()
- */
+ @Override
protected boolean modifyUnderlyingFile() throws Exception {
IFileStore fileStore= FileBuffers.getFileStoreAtLocation(getPath());
assertTrue(fileStore.fetchInfo().exists());
@@ -110,9 +104,7 @@ public class FileBuffersForWorkspaceFiles extends FileBufferFunctions {
return true;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#getAnnotationModelClass()
- */
+ @Override
protected Class getAnnotationModelClass() throws Exception {
Bundle bundle= Platform.getBundle("org.eclipse.ui.editors");
return bundle != null ? IAnnotationModel.class : null;
diff --git a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileStoreFileBufferFunctions.java b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileStoreFileBufferFunctions.java
index 559c8631532..5a4b6a2dbcb 100644
--- a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileStoreFileBufferFunctions.java
+++ b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileStoreFileBufferFunctions.java
@@ -58,6 +58,7 @@ public abstract class FileStoreFileBufferFunctions extends TestCase {
protected abstract Class getAnnotationModelClass() throws Exception;
+ @Override
protected void setUp() throws Exception {
fManager= FileBuffers.getTextFileBufferManager();
fProject= ResourceHelper.createProject("project");
@@ -70,6 +71,7 @@ public abstract class FileStoreFileBufferFunctions extends TestCase {
return fProject;
}
+ @Override
protected void tearDown() throws Exception {
ITextFileBuffer buffer= fManager.getFileStoreTextFileBuffer(fFileStore);
assertTrue(buffer == null);
@@ -331,11 +333,13 @@ public abstract class FileStoreFileBufferFunctions extends TestCase {
public IFileBuffer buffer;
public int count;
+ @Override
public void bufferCreated(IFileBuffer buf) {
++count;
this.buffer= buf;
}
+ @Override
public void bufferDisposed(IFileBuffer buf) {
--count;
this.buffer= buf;
@@ -376,6 +380,7 @@ public abstract class FileStoreFileBufferFunctions extends TestCase {
public int count;
public boolean isDirty;
+ @Override
public void dirtyStateChanged(IFileBuffer buf, boolean state) {
++count;
this.buffer= buf;
@@ -426,6 +431,7 @@ public abstract class FileStoreFileBufferFunctions extends TestCase {
public int count;
public boolean isDirty;
+ @Override
public void dirtyStateChanged(IFileBuffer buf, boolean state) {
++count;
this.buffer= buf;
@@ -474,11 +480,13 @@ public abstract class FileStoreFileBufferFunctions extends TestCase {
public IFileBuffer preBuffer, postBuffer;
public int preCount, postCount;
+ @Override
public void bufferContentAboutToBeReplaced(IFileBuffer buffer) {
++preCount;
preBuffer= buffer;
}
+ @Override
public void bufferContentReplaced(IFileBuffer buffer) {
++postCount;
postBuffer= buffer;
@@ -523,11 +531,13 @@ public abstract class FileStoreFileBufferFunctions extends TestCase {
public IFileBuffer preBuffer, postBuffer;
public int preCount, postCount;
+ @Override
public void bufferContentAboutToBeReplaced(IFileBuffer buffer) {
++preCount;
preBuffer= buffer;
}
+ @Override
public void bufferContentReplaced(IFileBuffer buffer) {
++postCount;
postBuffer= buffer;
@@ -571,6 +581,7 @@ public abstract class FileStoreFileBufferFunctions extends TestCase {
public int count;
public boolean isStateValidated;
+ @Override
public void stateValidationChanged(IFileBuffer buf, boolean state) {
++count;
this.buffer= buf;
@@ -615,6 +626,7 @@ public abstract class FileStoreFileBufferFunctions extends TestCase {
public int count;
public boolean isStateValidated;
+ @Override
public void stateValidationChanged(IFileBuffer buf, boolean state) {
++count;
this.buffer= buf;
@@ -660,6 +672,7 @@ public abstract class FileStoreFileBufferFunctions extends TestCase {
public int count;
public boolean isStateValidated;
+ @Override
public void stateValidationChanged(IFileBuffer buf, boolean state) {
++count;
this.buffer= buf;
@@ -705,6 +718,7 @@ public abstract class FileStoreFileBufferFunctions extends TestCase {
public int count;
public boolean isStateValidated;
+ @Override
public void stateValidationChanged(IFileBuffer buf, boolean state) {
++count;
this.buffer= buf;
@@ -751,6 +765,7 @@ public abstract class FileStoreFileBufferFunctions extends TestCase {
public IFileBuffer buffer;
public int count;
+ @Override
public void underlyingFileDeleted(IFileBuffer buf) {
++count;
this.buffer= buf;
@@ -791,6 +806,7 @@ public abstract class FileStoreFileBufferFunctions extends TestCase {
public int count;
public IPath newLocation;
+ @Override
public void underlyingFileMoved(IFileBuffer buf, IPath location) {
++count;
this.buffer= buf;
@@ -833,6 +849,7 @@ public abstract class FileStoreFileBufferFunctions extends TestCase {
public IFileBuffer buffer;
public int count;
+ @Override
public void stateChanging(IFileBuffer buf) {
++count;
this.buffer= buf;
@@ -872,6 +889,7 @@ public abstract class FileStoreFileBufferFunctions extends TestCase {
public IFileBuffer buffer;
public int count;
+ @Override
public void stateChanging(IFileBuffer buf) {
++count;
this.buffer= buf;
@@ -911,6 +929,7 @@ public abstract class FileStoreFileBufferFunctions extends TestCase {
public IFileBuffer buffer;
public int count;
+ @Override
public void stateChanging(IFileBuffer buf) {
++count;
this.buffer= buf;
@@ -950,6 +969,7 @@ public abstract class FileStoreFileBufferFunctions extends TestCase {
public IFileBuffer buffer;
public int count;
+ @Override
public void stateChanging(IFileBuffer buf) {
++count;
this.buffer= buf;
@@ -990,6 +1010,7 @@ public abstract class FileStoreFileBufferFunctions extends TestCase {
public IFileBuffer buffer;
public int count;
+ @Override
public void stateChanging(IFileBuffer buf) {
++count;
this.buffer= buf;
@@ -1031,6 +1052,7 @@ public abstract class FileStoreFileBufferFunctions extends TestCase {
public IFileBuffer buffer;
public int count;
+ @Override
public void stateChanging(IFileBuffer buf) {
++count;
this.buffer= buf;
@@ -1093,9 +1115,11 @@ public abstract class FileStoreFileBufferFunctions extends TestCase {
int notifyCount= 0;
+ @Override
public void bufferCreated(IFileBuffer buffer) {
notifyCount++;
}
+ @Override
public void bufferDisposed(IFileBuffer buffer) {
notifyCount++;
}
@@ -1104,10 +1128,12 @@ public abstract class FileStoreFileBufferFunctions extends TestCase {
class ForcedException extends RuntimeException {
private static final long serialVersionUID= 1L;
+ @Override
public void printStackTrace(PrintStream s) {
s.println("!FORCED BY TEST: this entry is intentional");
}
+ @Override
public void printStackTrace(PrintWriter s) {
s.println("!FORCED BY TEST: this entry is intentional");
}
@@ -1117,9 +1143,11 @@ public abstract class FileStoreFileBufferFunctions extends TestCase {
NotifiedListener notifyCounter2= new NotifiedListener();
FileBufferListener failingListener= new FileBufferListener() {
+ @Override
public void bufferCreated(IFileBuffer buffer) {
throw new ForcedException();
}
+ @Override
public void bufferDisposed(IFileBuffer buffer) {
throw new ForcedException();
}
diff --git a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileStoreFileBuffersForExternalFiles.java b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileStoreFileBuffersForExternalFiles.java
index 993d8cff587..de05cffeb1d 100644
--- a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileStoreFileBuffersForExternalFiles.java
+++ b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileStoreFileBuffersForExternalFiles.java
@@ -27,18 +27,14 @@ import org.eclipse.core.filebuffers.FileBuffers;
*/
public class FileStoreFileBuffersForExternalFiles extends FileStoreFileBufferFunctions {
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#tearDown()
- */
+ @Override
protected void tearDown() throws Exception {
FileTool.delete(getPath());
FileTool.delete(FileBuffers.getSystemFileAtLocation(getPath()).getParentFile());
super.tearDown();
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#createPath(org.eclipse.core.resources.IProject)
- */
+ @Override
protected IPath createPath(IProject project) throws Exception {
File sourceFile= FileTool.getFileInPlugin(FileBuffersTestPlugin.getDefault(), new Path("testResources/ExternalFile"));
File externalFile= FileTool.createTempFileInPlugin(FileBuffersTestPlugin.getDefault(), new Path("externalResources/ExternalFile"));
@@ -46,43 +42,34 @@ public class FileStoreFileBuffersForExternalFiles extends FileStoreFileBufferFun
return new Path(externalFile.getAbsolutePath());
}
+ @Override
protected void setReadOnly(boolean state) throws Exception {
IFileStore fileStore= FileBuffers.getFileStoreAtLocation(getPath());
assertNotNull(fileStore);
fileStore.fetchInfo().setAttribute(EFS.ATTRIBUTE_READ_ONLY, state);
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#isStateValidationSupported()
- */
+ @Override
protected boolean isStateValidationSupported() {
return false;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#deleteUnderlyingFile()
- */
+ @Override
protected boolean deleteUnderlyingFile() throws Exception {
return false;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#moveUnderlyingFile()
- */
+ @Override
protected IPath moveUnderlyingFile() throws Exception {
return null;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#modifyUnderlyingFile()
- */
+ @Override
protected boolean modifyUnderlyingFile() throws Exception {
return false;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#getAnnotationModelClass()
- */
+ @Override
protected Class getAnnotationModelClass() throws Exception {
return null;
}
diff --git a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileStoreFileBuffersForNonExistingExternalFiles.java b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileStoreFileBuffersForNonExistingExternalFiles.java
index 60fed9c5d1f..1484e941c21 100644
--- a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileStoreFileBuffersForNonExistingExternalFiles.java
+++ b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileStoreFileBuffersForNonExistingExternalFiles.java
@@ -25,14 +25,13 @@ import org.eclipse.core.filebuffers.FileBuffers;
*/
public class FileStoreFileBuffersForNonExistingExternalFiles extends FileStoreFileBufferFunctions {
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#tearDown()
- */
+ @Override
protected void tearDown() throws Exception {
FileTool.delete(getPath());
super.tearDown();
}
+ @Override
protected IPath createPath(IProject project) throws Exception {
IPath path= FileBuffersTestPlugin.getDefault().getStateLocation();
path= path.append("NonExistingExternalFile");
@@ -42,43 +41,34 @@ public class FileStoreFileBuffersForNonExistingExternalFiles extends FileStoreFi
/*
* @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#markReadOnly()
*/
+ @Override
protected void setReadOnly(boolean state) throws Exception {
IFileStore fileStore= FileBuffers.getFileStoreAtLocation(getPath());
assertNotNull(fileStore);
fileStore.fetchInfo().setAttribute(EFS.ATTRIBUTE_READ_ONLY, state);
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#isStateValidationSupported()
- */
+ @Override
protected boolean isStateValidationSupported() {
return false;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#deleteUnderlyingFile()
- */
+ @Override
protected boolean deleteUnderlyingFile() throws Exception {
return false;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#moveUnderlyingFile()
- */
+ @Override
protected IPath moveUnderlyingFile() throws Exception {
return null;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#modifyUnderlyingFile()
- */
+ @Override
protected boolean modifyUnderlyingFile() throws Exception {
return false;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#getAnnotationModelClass()
- */
+ @Override
protected Class getAnnotationModelClass() throws Exception {
return null;
}
diff --git a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileStoreFileBuffersForNonExistingWorkspaceFiles.java b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileStoreFileBuffersForNonExistingWorkspaceFiles.java
index cb532c610d8..9c50e9a9a32 100644
--- a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileStoreFileBuffersForNonExistingWorkspaceFiles.java
+++ b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileStoreFileBuffersForNonExistingWorkspaceFiles.java
@@ -28,17 +28,13 @@ import org.eclipse.core.filebuffers.LocationKind;
*/
public class FileStoreFileBuffersForNonExistingWorkspaceFiles extends FileStoreFileBufferFunctions {
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#tearDown()
- */
+ @Override
protected void tearDown() throws Exception {
FileTool.delete(getPath());
super.tearDown();
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#createPath(org.eclipse.core.resources.IProject)
- */
+ @Override
protected IPath createPath(IProject project) throws Exception {
IFolder folder= ResourceHelper.createFolder("project/folderA/folderB/");
IPath filePath= folder.getLocation().append("NonExistingWorkspaceFile");
@@ -77,43 +73,34 @@ public class FileStoreFileBuffersForNonExistingWorkspaceFiles extends FileStoreF
/*
* @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#markReadOnly()
*/
+ @Override
protected void setReadOnly(boolean state) throws Exception {
IFileStore fileStore= FileBuffers.getFileStoreAtLocation(getPath());
assertNotNull(fileStore);
fileStore.fetchInfo().setAttribute(EFS.ATTRIBUTE_READ_ONLY, state);
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#isStateValidationSupported()
- */
+ @Override
protected boolean isStateValidationSupported() {
return false;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#deleteUnderlyingFile()
- */
+ @Override
protected boolean deleteUnderlyingFile() throws Exception {
return false;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#moveUnderlyingFile()
- */
+ @Override
protected IPath moveUnderlyingFile() throws Exception {
return null;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#modifyUnderlyingFile()
- */
+ @Override
protected boolean modifyUnderlyingFile() throws Exception {
return false;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#getAnnotationModelClass()
- */
+ @Override
protected Class getAnnotationModelClass() throws Exception {
return null;
}
diff --git a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileStoreFileBuffersForWorkspaceFiles.java b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileStoreFileBuffersForWorkspaceFiles.java
index 65a0f7112ed..22a7d3a204b 100644
--- a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileStoreFileBuffersForWorkspaceFiles.java
+++ b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileStoreFileBuffersForWorkspaceFiles.java
@@ -38,6 +38,7 @@ import org.eclipse.jface.text.source.IAnnotationModel;
*/
public class FileStoreFileBuffersForWorkspaceFiles extends FileBufferFunctions {
+ @Override
protected IPath createPath(IProject project) throws Exception {
IFolder folder= ResourceHelper.createFolder("project/folderA/folderB/");
IFile file= ResourceHelper.createFile(folder, "WorkspaceFile", "content");
@@ -47,6 +48,7 @@ public class FileStoreFileBuffersForWorkspaceFiles extends FileBufferFunctions {
/*
* @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#markReadOnly()
*/
+ @Override
protected void setReadOnly(boolean state) throws Exception {
IFile file= FileBuffers.getWorkspaceFileAtLocation(getPath());
ResourceAttributes attributes= new ResourceAttributes();
@@ -54,25 +56,19 @@ public class FileStoreFileBuffersForWorkspaceFiles extends FileBufferFunctions {
file.setResourceAttributes(attributes);
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#isStateValidationSupported()
- */
+ @Override
protected boolean isStateValidationSupported() {
return true;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#deleteUnderlyingFile()
- */
+ @Override
protected boolean deleteUnderlyingFile() throws Exception {
IFile file= FileBuffers.getWorkspaceFileAtLocation(getPath());
file.delete(true, false, null);
return file.exists();
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#moveUnderlyingFile()
- */
+ @Override
protected IPath moveUnderlyingFile() throws Exception {
IFile file= FileBuffers.getWorkspaceFileAtLocation(getPath());
ResourceHelper.createFolder("project/folderA/folderB/folderC");
@@ -86,9 +82,7 @@ public class FileStoreFileBuffersForWorkspaceFiles extends FileBufferFunctions {
return null;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#modifyUnderlyingFile()
- */
+ @Override
protected boolean modifyUnderlyingFile() throws Exception {
IFileStore fileStore= FileBuffers.getFileStoreAtLocation(getPath());
assertTrue(fileStore.fetchInfo().exists());
@@ -110,9 +104,7 @@ public class FileStoreFileBuffersForWorkspaceFiles extends FileBufferFunctions {
return true;
}
- /*
- * @see org.eclipse.core.filebuffers.tests.FileBufferFunctions#getAnnotationModelClass()
- */
+ @Override
protected Class getAnnotationModelClass() throws Exception {
Bundle bundle= Platform.getBundle("org.eclipse.ui.editors");
return bundle != null ? IAnnotationModel.class : null;
diff --git a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/MockDocumentSetupParticipants.java b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/MockDocumentSetupParticipants.java
index 8b6759b903b..a0d22a5ebe1 100644
--- a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/MockDocumentSetupParticipants.java
+++ b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/MockDocumentSetupParticipants.java
@@ -33,18 +33,14 @@ public class MockDocumentSetupParticipants {
* into the document being setup for integration test purposes.
*/
static abstract class AbstractTestDSP implements IDocumentSetupParticipant {
- /*
- * @see org.eclipse.core.filebuffers.IDocumentSetupParticipant#setup(org.eclipse.jface.text.IDocument)
- */
+ @Override
public void setup(IDocument document) {
append(document, getClass()+"\n");
}
}
static abstract class AbstractTestDSPExtension extends AbstractTestDSP implements IDocumentSetupParticipantExtension {
- /*
- * @see org.eclipse.core.filebuffers.IDocumentSetupParticipantExtension#setup(org.eclipse.jface.text.IDocument, org.eclipse.core.runtime.IPath, org.eclipse.core.filebuffers.LocationKind)
- */
+ @Override
public void setup(IDocument document, IPath location, LocationKind locationKind) {
append(document, getClass()+"%%EXTENSION\n");
}
@@ -59,6 +55,7 @@ public class MockDocumentSetupParticipants {
public static class TestDSP6 extends AbstractTestDSPExtension {}
public static class TestDSP7 extends AbstractTestDSPExtension {
+ @Override
public void setup(IDocument document, IPath location, LocationKind locationKind) {
if (locationKind == LocationKind.IFILE)
append(document, new StringBuffer(location.toPortableString()).reverse().toString());
@@ -66,6 +63,7 @@ public class MockDocumentSetupParticipants {
}
public static class TestDSP8 extends AbstractTestDSPExtension {
+ @Override
public void setup(IDocument document, IPath location, LocationKind locationKind) {
if (locationKind == LocationKind.LOCATION)
append(document, new StringBuffer(location.toPortableString()).reverse().toString());
@@ -73,6 +71,7 @@ public class MockDocumentSetupParticipants {
}
public static class TestDSP9 extends AbstractTestDSPExtension {
+ @Override
public void setup(IDocument document, IPath location, LocationKind locationKind) {
if (locationKind == LocationKind.NORMALIZE)
append(document, new StringBuffer(location.toPortableString()).reverse().toString());
diff --git a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/ResourceTextFileManagerDocCreationTests.java b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/ResourceTextFileManagerDocCreationTests.java
index 95823e8ec45..ae2a30f8377 100644
--- a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/ResourceTextFileManagerDocCreationTests.java
+++ b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/ResourceTextFileManagerDocCreationTests.java
@@ -25,10 +25,12 @@ import org.eclipse.core.filebuffers.LocationKind;
*/
public class ResourceTextFileManagerDocCreationTests extends AbstractFileBufferDocCreationTests {
+ @Override
protected void setUp() throws Exception {
fManager= new ResourceTextFileBufferManager();
}
+ @Override
protected void assertDocumentContent(String expectedContent, String fullPath, LocationKind locKind) {
assertEquals(expectedContent, fManager.createEmptyDocument(new Path(fullPath), locKind).get());
if (locKind == LocationKind.IFILE) {
@@ -37,6 +39,7 @@ public class ResourceTextFileManagerDocCreationTests extends AbstractFileBufferD
}
}
+ @Override
protected LocationKind[] getSupportLocationKinds() {
return new LocationKind[] {LocationKind.IFILE, LocationKind.LOCATION, LocationKind.NORMALIZE};
}
diff --git a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/TextFileManagerDocCreationTests.java b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/TextFileManagerDocCreationTests.java
index e282eb6e6fd..c4c295e5167 100644
--- a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/TextFileManagerDocCreationTests.java
+++ b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/TextFileManagerDocCreationTests.java
@@ -20,10 +20,12 @@ import org.eclipse.core.filebuffers.LocationKind;
*/
public class TextFileManagerDocCreationTests extends AbstractFileBufferDocCreationTests {
+ @Override
protected void setUp() throws Exception {
fManager= new TextFileBufferManager();
}
+ @Override
protected void assertDocumentContent(String expectedContent, String path, LocationKind locKind) {
if (locKind != LocationKind.IFILE) {
/** {@link TextFileBufferManager} does not deal with {@link LocationKind#IFILE} */
@@ -31,6 +33,7 @@ public class TextFileManagerDocCreationTests extends AbstractFileBufferDocCreati
}
}
+ @Override
protected LocationKind[] getSupportLocationKinds() {
return new LocationKind[] {LocationKind.LOCATION, LocationKind.NORMALIZE};
}

Back to the top