Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2017-09-06 12:12:32 +0000
committerAlexander Kurtakov2017-09-06 13:49:02 +0000
commitfe53fa1c6a70936fc6ff2f438ea4509a765991eb (patch)
tree0fd7b27b62e317b7694210d7f72ab97f0f55cbbe /bundles/org.eclipse.equinox.frameworkadmin.test
parent6c0135edf1bd792bf107d96a5fa53681dd1ce6f1 (diff)
downloadrt.equinox.p2-fe53fa1c6a70936fc6ff2f438ea4509a765991eb.tar.gz
rt.equinox.p2-fe53fa1c6a70936fc6ff2f438ea4509a765991eb.tar.xz
rt.equinox.p2-fe53fa1c6a70936fc6ff2f438ea4509a765991eb.zip
Bug 521923 - Move org.eclipse.equinox.frameworkadmin.tests to Java 8I20170907-2000I20170906-2000
* Bump BREE. * Bump minor version for the BREE change. * Enable more warnings. * Remove redundant type declarations. * Try-with-resources. * Add missing Override annotations. * Remove tearDown methods simply calling super. * Generify. Change-Id: Ic1edb00e8eab708506c052d893d43d52a394053b Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'bundles/org.eclipse.equinox.frameworkadmin.test')
-rw-r--r--bundles/org.eclipse.equinox.frameworkadmin.test/.classpath2
-rw-r--r--bundles/org.eclipse.equinox.frameworkadmin.test/.settings/org.eclipse.jdt.core.prefs24
-rw-r--r--bundles/org.eclipse.equinox.frameworkadmin.test/META-INF/MANIFEST.MF4
-rw-r--r--bundles/org.eclipse.equinox.frameworkadmin.test/pom.xml2
-rw-r--r--bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/AbstractFwkAdminTest.java71
-rw-r--r--bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/Activator.java4
-rw-r--r--bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/Bug196525.java7
-rw-r--r--bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/CleanupTest.java3
-rw-r--r--bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ManipulatorTests.java8
-rw-r--r--bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/OSGiVersionChange.java3
-rw-r--r--bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ParserUtilsTest.java4
-rw-r--r--bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest1.java6
-rw-r--r--bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest2.java7
-rw-r--r--bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest3.java8
-rw-r--r--bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest4.java8
-rw-r--r--bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest5.java4
-rw-r--r--bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTestBug267850.java7
-rw-r--r--bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTestBug285935.java6
-rw-r--r--bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/RemovingABundle.java3
-rw-r--r--bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/SimpleConfiguratorComingAndGoing.java3
-rw-r--r--bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/TestEclipseDataArea.java10
21 files changed, 69 insertions, 125 deletions
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/.classpath b/bundles/org.eclipse.equinox.frameworkadmin.test/.classpath
index 64c5e31b7..eca7bdba8 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/.classpath
+++ b/bundles/org.eclipse.equinox.frameworkadmin.test/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.frameworkadmin.test/.settings/org.eclipse.jdt.core.prefs
index 5324e5fb1..92d729a81 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.equinox.frameworkadmin.test/.settings/org.eclipse.jdt.core.prefs
@@ -9,13 +9,17 @@ org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@@ -32,7 +36,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=
org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
@@ -49,7 +53,7 @@ org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
@@ -58,7 +62,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
@@ -66,19 +70,21 @@ org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
@@ -94,6 +100,9 @@ org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
+org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
@@ -101,6 +110,7 @@ org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=error
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
@@ -113,7 +123,7 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.frameworkadmin.test/META-INF/MANIFEST.MF
index 8796f7df8..9df57e47c 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.frameworkadmin.test/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Test Plug-in for Framework Admin
Bundle-SymbolicName: org.eclipse.equinox.frameworkadmin.test
-Bundle-Version: 1.1.100.qualifier
+Bundle-Version: 1.2.0.qualifier
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.equinox.frameworkadmin,
org.eclipse.equinox.frameworkadmin.equinox;bundle-version="1.0.100",
@@ -10,6 +10,6 @@ Require-Bundle: org.eclipse.core.runtime,
Bundle-Activator: org.eclipse.equinox.frameworkadmin.tests.Activator
Import-Package: org.osgi.framework;version="1.4.0"
Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: org.eclipse.equinox.frameworkadmin.tests
Eclipse-BundleShape: dir
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/pom.xml b/bundles/org.eclipse.equinox.frameworkadmin.test/pom.xml
index da9e34b95..16062b638 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/pom.xml
+++ b/bundles/org.eclipse.equinox.frameworkadmin.test/pom.xml
@@ -9,6 +9,6 @@
</parent>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.frameworkadmin.test</artifactId>
- <version>1.1.100-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/AbstractFwkAdminTest.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/AbstractFwkAdminTest.java
index ec5646665..cd37493be 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/AbstractFwkAdminTest.java
+++ b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/AbstractFwkAdminTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * Copyright (c) 2007, 2017 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
@@ -88,7 +88,7 @@ public abstract class AbstractFwkAdminTest extends TestCase {
Filter filter;
try {
filter = Activator.getContext().createFilter(filterFwAdmin);
- fwAdminTracker = new ServiceTracker<Object, FrameworkAdmin>(Activator.getContext(), filter, null);
+ fwAdminTracker = new ServiceTracker<>(Activator.getContext(), filter, null);
fwAdminTracker.open();
} catch (InvalidSyntaxException e) {
// never happens
@@ -163,11 +163,9 @@ public abstract class AbstractFwkAdminTest extends TestCase {
if (!file.exists())
fail("File: " + file.toString() + " can't be found.");
try {
- BufferedReader reader = null;
- try {
- String failure = null;
- StringBuilder fileContent = new StringBuilder();
- reader = new BufferedReader(new FileReader(file));
+ String failure = null;
+ StringBuilder fileContent = new StringBuilder();
+ try (BufferedReader reader = new BufferedReader(new FileReader(file)) ){
while (reader.ready()) {
String line = reader.readLine();
fileContent.append(line).append('\n');
@@ -179,9 +177,6 @@ public abstract class AbstractFwkAdminTest extends TestCase {
// dump whole file content
fail((message != null ? message : failure) + "\n" + fileContent);
}
- } finally {
- if (reader != null)
- reader.close();
}
} catch (FileNotFoundException e) {
//ignore, caught before
@@ -206,21 +201,12 @@ public abstract class AbstractFwkAdminTest extends TestCase {
private String getProperty(File file, String property) {
Properties p = new Properties();
- FileInputStream fis = null;
- try {
- fis = new FileInputStream(file);
+ try (FileInputStream fis = new FileInputStream(file)) {
p.load(fis);
} catch (FileNotFoundException e) {
fail("Can't find file " + file);
} catch (IOException e) {
fail("Error reading " + file);
- } finally {
- if (fis != null)
- try {
- fis.close();
- } catch (IOException e) {
- //ignore
- }
}
return p.getProperty(property);
}
@@ -267,9 +253,7 @@ public abstract class AbstractFwkAdminTest extends TestCase {
int idx = 0;
StringBuilder fileContent = new StringBuilder();
try {
- BufferedReader reader = null;
- try {
- reader = new BufferedReader(new FileReader(file));
+ try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
while (reader.ready()) {
String line = reader.readLine();
fileContent.append(line).append('\n');
@@ -278,9 +262,6 @@ public abstract class AbstractFwkAdminTest extends TestCase {
return;
}
}
- } finally {
- if (reader != null)
- reader.close();
}
} catch (FileNotFoundException e) {
//ignore, caught before
@@ -333,11 +314,8 @@ public abstract class AbstractFwkAdminTest extends TestCase {
copy(message, children[i], new File(target, children[i].getName()));
return;
}
- InputStream input = null;
- OutputStream output = null;
- try {
- input = new BufferedInputStream(new FileInputStream(source));
- output = new BufferedOutputStream(new FileOutputStream(target));
+ try (InputStream input = new BufferedInputStream(new FileInputStream(source));
+ OutputStream output = new BufferedOutputStream(new FileOutputStream(target))) {
byte[] buffer = new byte[8192];
int bytesRead = 0;
@@ -345,23 +323,6 @@ public abstract class AbstractFwkAdminTest extends TestCase {
output.write(buffer, 0, bytesRead);
} catch (IOException e) {
fail(message + ": " + e);
- } finally {
- if (input != null) {
- try {
- input.close();
- } catch (IOException e) {
- System.err.println("Exception while trying to close input stream on: " + source.getAbsolutePath());
- e.printStackTrace();
- }
- }
- if (output != null) {
- try {
- output.close();
- } catch (IOException e) {
- System.err.println("Exception while trying to close output stream on: " + target.getAbsolutePath());
- e.printStackTrace();
- }
- }
}
}
@@ -402,9 +363,8 @@ public abstract class AbstractFwkAdminTest extends TestCase {
//This is a dumb helper writing out the values as they have been passed to it.
protected void writeEclipseIni(File location, String[] lines) {
location.getParentFile().mkdirs();
- BufferedWriter bw = null;
- try {
- bw = new BufferedWriter(new FileWriter(location));
+ try (BufferedWriter bw = new BufferedWriter(new FileWriter(location))){
+
for (int j = 0; j < lines.length; j++) {
bw.write(lines[j]);
bw.newLine();
@@ -412,14 +372,7 @@ public abstract class AbstractFwkAdminTest extends TestCase {
bw.flush();
} catch (IOException e) {
- fail("Fail writing eclipse.ini file");
- } finally {
- if (bw != null)
- try {
- bw.close();
- } catch (IOException e) {
- fail("Fail writing eclipse.ini file in " + location);
- }
+ fail("Fail writing eclipse.ini file in " + location);
}
}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/Activator.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/Activator.java
index bed2838eb..03fff806b 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/Activator.java
+++ b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/Activator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * Copyright (c) 2007, 2017 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,11 +16,13 @@ import org.osgi.framework.BundleContext;
public class Activator implements BundleActivator {
private static BundleContext ctx;
+ @Override
public void start(BundleContext context) throws Exception {
ctx = context;
}
+ @Override
public void stop(BundleContext context) throws Exception {
ctx = null;
}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/Bug196525.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/Bug196525.java
index 0d793e474..3310556f6 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/Bug196525.java
+++ b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/Bug196525.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * Copyright (c) 2007, 2017 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
@@ -30,6 +30,7 @@ public class Bug196525 extends AbstractFwkAdminTest {
super(name);
}
+ @Override
protected void setUp() throws Exception {
startSimpleConfiguratorManipulator();
//create a configuration with osgi and simpleconfigurator in it
@@ -93,8 +94,4 @@ public class Bug196525 extends AbstractFwkAdminTest {
assertContent(bundleTXT, "bundle_1");
}
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/CleanupTest.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/CleanupTest.java
index 8ce8e1ea7..eeec33f50 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/CleanupTest.java
+++ b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/CleanupTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * Copyright (c) 2007, 2017 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
@@ -26,6 +26,7 @@ public class CleanupTest extends FwkAdminAndSimpleConfiguratorTest {
Manipulator m = null;
+ @Override
protected void setUp() throws Exception {
super.setUp();
m = createMinimalConfiguration(CleanupTest.class.getName());
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ManipulatorTests.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ManipulatorTests.java
index 65ecd4f6b..9453cfc7b 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ManipulatorTests.java
+++ b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ManipulatorTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2010 IBM Corporation and others.
+ * Copyright (c) 2008, 2017 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
@@ -38,9 +38,9 @@ public class ManipulatorTests extends AbstractFwkAdminTest {
manipulator.save(false);
Properties configIni = new Properties();
- InputStream in = new BufferedInputStream(new FileInputStream(new File(configurationFolder, "config.ini")));
- configIni.load(in);
- in.close();
+ try (InputStream in = new BufferedInputStream(new FileInputStream(new File(configurationFolder, "config.ini")))) {
+ configIni.load(in);
+ }
String bundles = (String) configIni.get("osgi.bundles");
assertTrue(bundles.indexOf("org.eclipse.osgi") == -1);
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/OSGiVersionChange.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/OSGiVersionChange.java
index 7a43768fc..52f9b5025 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/OSGiVersionChange.java
+++ b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/OSGiVersionChange.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * Copyright (c) 2007, 2017 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
@@ -27,6 +27,7 @@ public class OSGiVersionChange extends FwkAdminAndSimpleConfiguratorTest {
super(name);
}
+ @Override
protected void setUp() throws Exception {
super.setUp();
defaultManipulator = createMinimalConfiguration(workArea);
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ParserUtilsTest.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ParserUtilsTest.java
index 756601770..bbde94e24 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ParserUtilsTest.java
+++ b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ParserUtilsTest.java
@@ -23,7 +23,7 @@ public class ParserUtilsTest extends AbstractFwkAdminTest {
super(name);
}
public void testGetValueForArgument() throws Exception {
- List args = new ArrayList();
+ List<String> args = new ArrayList<>();
args.add("-foo");
args.add("bar");
assertEquals( "bar", ParserUtils.getValueForArgument("-foo", args));
@@ -47,7 +47,7 @@ public class ParserUtilsTest extends AbstractFwkAdminTest {
}
public void testSetValueForArgument() throws Exception {
- List args = new ArrayList();
+ List<String> args = new ArrayList<>();
ParserUtils.setValueForArgument("-foo", "bar", args);
assertTrue(args.size() == 2);
assertEquals(args.get(0), "-foo");
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest1.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest1.java
index 2d71d9c30..bc3a56ca2 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest1.java
+++ b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest1.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * Copyright (c) 2007, 2017 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
@@ -43,8 +43,4 @@ public class ReaderTest1 extends AbstractFwkAdminTest {
assertEquals("bar", manipulator.getConfigData().getProperty("foo"));
}
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest2.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest2.java
index 0fad940f1..2d1432a89 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest2.java
+++ b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest2.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * Copyright (c) 2007, 2017 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
@@ -25,6 +25,7 @@ public class ReaderTest2 extends AbstractFwkAdminTest {
super(name);
}
+ @Override
protected void setUp() throws Exception {
super.setUp();
startSimpleConfiguratorManipulator();
@@ -52,8 +53,4 @@ public class ReaderTest2 extends AbstractFwkAdminTest {
assertEquals("bar", manipulator.getConfigData().getProperty("foo"));
}
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest3.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest3.java
index 46498ce4d..fc1d70423 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest3.java
+++ b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest3.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * Copyright (c) 2007, 2017 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
@@ -23,7 +23,6 @@ public class ReaderTest3 extends AbstractFwkAdminTest {
super(name);
}
-
public void testConfigContent() throws IllegalStateException, FrameworkAdminRuntimeException, IOException, BundleException {
startSimpleConfiguratorManipulator();
@@ -42,9 +41,4 @@ public class ReaderTest3 extends AbstractFwkAdminTest {
assertEquals(new File(installFolder, "configuration"), manipulator.getLauncherData().getFwConfigLocation());
assertEquals("bar", manipulator.getConfigData().getProperty("foo"));
}
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest4.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest4.java
index 34b972e5b..5edb88615 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest4.java
+++ b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest4.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * Copyright (c) 2007, 2017 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
@@ -26,6 +26,7 @@ public class ReaderTest4 extends AbstractFwkAdminTest {
super(name);
}
+ @Override
protected void setUp() throws Exception {
super.setUp();
startSimpleConfiguratorManipulator();
@@ -52,9 +53,4 @@ public class ReaderTest4 extends AbstractFwkAdminTest {
assertEquals(new File(installFolder, "conf"), manipulator.getLauncherData().getFwConfigLocation());
assertEquals("bar", manipulator.getConfigData().getProperty("foo"));
}
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest5.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest5.java
index 39460a9b9..18c11de29 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest5.java
+++ b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest5.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * Copyright (c) 2007, 2017 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
@@ -25,6 +25,7 @@ public class ReaderTest5 extends AbstractFwkAdminTest {
super(name);
}
+ @Override
protected void setUp() throws Exception {
super.setUp();
startSimpleConfiguratorManipulator();
@@ -52,6 +53,7 @@ public class ReaderTest5 extends AbstractFwkAdminTest {
assertEquals("bar", manipulator.getConfigData(). getProperty("foo"));
}
+ @Override
protected void tearDown() throws Exception {
super.tearDown();
}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTestBug267850.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTestBug267850.java
index cffe5de96..562ef1b3f 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTestBug267850.java
+++ b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTestBug267850.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2010 IBM Corporation and others.
+ * Copyright (c) 2009, 2017 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
@@ -23,7 +23,6 @@ public class ReaderTestBug267850 extends AbstractFwkAdminTest {
super(name);
}
-
public void testConfigContent() throws IllegalStateException, FrameworkAdminRuntimeException, IOException, BundleException {
startSimpleConfiguratorManipulator();
@@ -51,8 +50,4 @@ public class ReaderTestBug267850 extends AbstractFwkAdminTest {
assertEquals("256m", args[7]);
}
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTestBug285935.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTestBug285935.java
index df0bc6f63..1ab9b457a 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTestBug285935.java
+++ b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTestBug285935.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2010 IBM Corporation and others.
+ * Copyright (c) 2009, 2017 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
@@ -23,7 +23,6 @@ public class ReaderTestBug285935 extends AbstractFwkAdminTest {
super(name);
}
-
public void testConfigContent() throws IllegalStateException, FrameworkAdminRuntimeException, IOException, BundleException {
startSimpleConfiguratorManipulator();
@@ -43,8 +42,5 @@ public class ReaderTestBug285935 extends AbstractFwkAdminTest {
assertEquals("bar", manipulator.getConfigData().getProperty("foo"));
}
- protected void tearDown() throws Exception {
- super.tearDown();
- }
}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/RemovingABundle.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/RemovingABundle.java
index de37ce3fb..ce55104dc 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/RemovingABundle.java
+++ b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/RemovingABundle.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2010 IBM Corporation and others.
+ * Copyright (c) 2008, 2017 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
@@ -24,6 +24,7 @@ public class RemovingABundle extends FwkAdminAndSimpleConfiguratorTest {
super(name);
}
+ @Override
protected void setUp() throws Exception {
super.setUp();
Manipulator manipulator = createMinimalConfiguration(RemovingABundle.class.getName());
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/SimpleConfiguratorComingAndGoing.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/SimpleConfiguratorComingAndGoing.java
index 2bf739e7e..6781e7390 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/SimpleConfiguratorComingAndGoing.java
+++ b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/SimpleConfiguratorComingAndGoing.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * Copyright (c) 2007, 2017 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
@@ -26,6 +26,7 @@ public class SimpleConfiguratorComingAndGoing extends FwkAdminAndSimpleConfigura
super(name);
}
+ @Override
protected void setUp() throws Exception {
super.setUp();
m = createMinimalConfiguration(SimpleConfiguratorComingAndGoing.class.getName());
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/TestEclipseDataArea.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/TestEclipseDataArea.java
index 9a0babf45..fce17ee5a 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/TestEclipseDataArea.java
+++ b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/TestEclipseDataArea.java
@@ -1,8 +1,9 @@
/*******************************************************************************
- * Copyright (c) 2008 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 http://www.eclipse.org/legal/epl-v10.html
+ * Copyright (c) 2008, 2017 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
+ * http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: IBM Corporation - initial API and implementation
******************************************************************************/
@@ -19,6 +20,7 @@ public class TestEclipseDataArea extends FwkAdminAndSimpleConfiguratorTest {
super(name);
}
+ @Override
protected void setUp() throws Exception {
super.setUp();
m = createMinimalConfiguration(TestEclipseDataArea.class.getName());

Back to the top