Remove the dependency on Java 5 from the Junit4OSGi framework.
Tests can now be run on Foundation (tested on J9)
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@650602 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/examples/junit4osgi/felix-command/pom.xml b/ipojo/examples/junit4osgi/felix-command/pom.xml
index 220d497..98133b6 100644
--- a/ipojo/examples/junit4osgi/felix-command/pom.xml
+++ b/ipojo/examples/junit4osgi/felix-command/pom.xml
@@ -48,8 +48,8 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
- <source>1.5</source>
- <target>1.5</target>
+ <source>1.4</source>
+ <target>1.4</target>
</configuration>
</plugin>
<plugin>
diff --git a/ipojo/examples/junit4osgi/felix-command/src/main/java/org/apache/felix/ipojo/junit4osgi/command/JunitCommand.java b/ipojo/examples/junit4osgi/felix-command/src/main/java/org/apache/felix/ipojo/junit4osgi/command/JunitCommand.java
index a217a9e..1a16e44 100644
--- a/ipojo/examples/junit4osgi/felix-command/src/main/java/org/apache/felix/ipojo/junit4osgi/command/JunitCommand.java
+++ b/ipojo/examples/junit4osgi/felix-command/src/main/java/org/apache/felix/ipojo/junit4osgi/command/JunitCommand.java
@@ -40,8 +40,8 @@
private OSGiJunitRunner runner;
- private List<String> getNamesFromTests(List<Test> list) {
- List<String> names = new ArrayList<String>(list.size());
+ private List getNamesFromTests(List list) {
+ List names = new ArrayList(list.size());
for (int i = 0; i < list.size(); i++) {
if (list.get(i) instanceof TestCase) {
names.add(((TestCase) list.get(i)).getName());
@@ -59,7 +59,7 @@
public void execute(String line, PrintStream out, PrintStream err) {
line = line.substring(getName().length()).trim();
- List<TestResult> tr = null;
+ List tr = null;
if (line.equals("all")) {
if (runner.getTests() == null) {
err.println("No tests to execute");
@@ -71,12 +71,12 @@
} else {
try {
Long bundleId = new Long(line);
- if (runner.getTests(bundleId) == null) {
+ if (runner.getTests(bundleId.longValue()) == null) {
err.println("No tests to execute");
return;
} else {
- out.println("Executing " + getNamesFromTests(runner.getTests(bundleId)));
- tr = runner.run(bundleId);
+ out.println("Executing " + getNamesFromTests(runner.getTests(bundleId.longValue())));
+ tr = runner.run(bundleId.longValue());
}
} catch (NumberFormatException e) {
err.println("Unable to parse id " + line);
@@ -84,9 +84,9 @@
}
}
- ListIterator<TestResult> it = tr.listIterator();
+ ListIterator it = tr.listIterator();
while (it.hasNext()) {
- TestResult result = it.next();
+ TestResult result = (TestResult) it.next();
if (result.failureCount() != 0) {
TestFailure fail = (TestFailure) result.failures().nextElement();
out.println(fail.trace());