mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-13 19:25:38 +02:00
Cosmetics
Change-Id: I52a10ff524628692e9fa94b6fb1cc6cf1708d7d1
This commit is contained in:
parent
94a97818bf
commit
2726670258
1 changed files with 9 additions and 8 deletions
|
@ -23,8 +23,6 @@ import java.util.List;
|
||||||
import java.util.zip.ZipException;
|
import java.util.zip.ZipException;
|
||||||
import java.util.zip.ZipFile;
|
import java.util.zip.ZipFile;
|
||||||
|
|
||||||
import junit.framework.Assert;
|
|
||||||
|
|
||||||
import org.eclipse.core.resources.IFile;
|
import org.eclipse.core.resources.IFile;
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.core.resources.IProjectDescription;
|
import org.eclipse.core.resources.IProjectDescription;
|
||||||
|
@ -36,6 +34,7 @@ import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.Path;
|
import org.eclipse.core.runtime.Path;
|
||||||
import org.eclipse.core.runtime.Plugin;
|
import org.eclipse.core.runtime.Plugin;
|
||||||
import org.eclipse.core.runtime.Preferences;
|
import org.eclipse.core.runtime.Preferences;
|
||||||
|
import org.junit.Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copied from org.eclipse.jdt.text.tests.performance.
|
* Copied from org.eclipse.jdt.text.tests.performance.
|
||||||
|
@ -43,7 +42,6 @@ import org.eclipse.core.runtime.Preferences;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
public class ResourceTestHelper {
|
public class ResourceTestHelper {
|
||||||
|
|
||||||
public static final int FAIL_IF_EXISTS= 0;
|
public static final int FAIL_IF_EXISTS= 0;
|
||||||
|
|
||||||
public static final int OVERWRITE_IF_EXISTS= 1;
|
public static final int OVERWRITE_IF_EXISTS= 1;
|
||||||
|
@ -55,9 +53,10 @@ public class ResourceTestHelper {
|
||||||
private static final long DELETE_RETRY_DELAY= 1000;
|
private static final long DELETE_RETRY_DELAY= 1000;
|
||||||
|
|
||||||
public static void replicate(String src, String destPrefix, String destSuffix, int n, int ifExists) throws CoreException {
|
public static void replicate(String src, String destPrefix, String destSuffix, int n, int ifExists) throws CoreException {
|
||||||
for (int i= 0; i < n; i++)
|
for (int i= 0; i < n; i++) {
|
||||||
copy(src, destPrefix + i + destSuffix, ifExists);
|
copy(src, destPrefix + i + destSuffix, ifExists);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void copy(String src, String dest) throws CoreException {
|
public static void copy(String src, String dest) throws CoreException {
|
||||||
copy(src, dest, FAIL_IF_EXISTS);
|
copy(src, dest, FAIL_IF_EXISTS);
|
||||||
|
@ -149,8 +148,8 @@ public class ResourceTestHelper {
|
||||||
getFile(dest).create(stream, true, null);
|
getFile(dest).create(stream, true, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void replicate(String src, String destPrefix, String destSuffix, int n, String srcName,
|
||||||
public static void replicate(String src, String destPrefix, String destSuffix, int n, String srcName, String destNamePrefix, int ifExists) throws IOException, CoreException {
|
String destNamePrefix, int ifExists) throws IOException, CoreException {
|
||||||
StringBuffer s= read(src);
|
StringBuffer s= read(src);
|
||||||
List<Integer> positions= identifierPositions(s, srcName);
|
List<Integer> positions= identifierPositions(s, srcName);
|
||||||
for (int j= 0; j < n; j++) {
|
for (int j= 0; j < n; j++) {
|
||||||
|
@ -163,7 +162,8 @@ public class ResourceTestHelper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void copy(String src, String dest, String srcName, String destName, int ifExists) throws IOException, CoreException {
|
public static void copy(String src, String dest, String srcName, String destName, int ifExists)
|
||||||
|
throws IOException, CoreException {
|
||||||
if (handleExisting(dest, ifExists)) {
|
if (handleExisting(dest, ifExists)) {
|
||||||
StringBuffer buf= read(src);
|
StringBuffer buf= read(src);
|
||||||
List<Integer> positions= identifierPositions(buf, srcName);
|
List<Integer> positions= identifierPositions(buf, srcName);
|
||||||
|
@ -236,7 +236,8 @@ public class ResourceTestHelper {
|
||||||
return project;
|
return project;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IProject createProjectFromZip(Plugin installationPlugin, String projectZip, String projectName) throws IOException, ZipException, CoreException {
|
public static IProject createProjectFromZip(Plugin installationPlugin, String projectZip, String projectName)
|
||||||
|
throws IOException, ZipException, CoreException {
|
||||||
String workspacePath= ResourcesPlugin.getWorkspace().getRoot().getLocation().toString() + "/";
|
String workspacePath= ResourcesPlugin.getWorkspace().getRoot().getLocation().toString() + "/";
|
||||||
FileTool.unzip(new ZipFile(FileTool.getFileInPlugin(installationPlugin, new Path(projectZip))), new File(workspacePath));
|
FileTool.unzip(new ZipFile(FileTool.getFileInPlugin(installationPlugin, new Path(projectZip))), new File(workspacePath));
|
||||||
return createExistingProject(projectName);
|
return createExistingProject(projectName);
|
||||||
|
|
Loading…
Add table
Reference in a new issue