Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests.optimizers/src/org/eclipse/equinox/p2/tests/artifact/optimizers/Pack200OptimizerTest.java')
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.optimizers/src/org/eclipse/equinox/p2/tests/artifact/optimizers/Pack200OptimizerTest.java50
1 files changed, 25 insertions, 25 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests.optimizers/src/org/eclipse/equinox/p2/tests/artifact/optimizers/Pack200OptimizerTest.java b/bundles/org.eclipse.equinox.p2.tests.optimizers/src/org/eclipse/equinox/p2/tests/artifact/optimizers/Pack200OptimizerTest.java
index 2401e14c3..9a12a4163 100644
--- a/bundles/org.eclipse.equinox.p2.tests.optimizers/src/org/eclipse/equinox/p2/tests/artifact/optimizers/Pack200OptimizerTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests.optimizers/src/org/eclipse/equinox/p2/tests/artifact/optimizers/Pack200OptimizerTest.java
@@ -10,40 +10,36 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.artifact.optimizers;
+import static org.junit.Assert.assertTrue;
+
import java.io.*;
import java.util.Arrays;
-import junit.framework.TestCase;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.artifact.optimizers.pack200.Pack200OptimizerStep;
import org.eclipse.equinox.internal.p2.core.helpers.FileUtils;
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing.ProcessingStep;
import org.eclipse.equinox.p2.tests.optimizers.TestActivator;
+import org.junit.Test;
import org.osgi.framework.Bundle;
-public class Pack200OptimizerTest extends TestCase {
-
- public Pack200OptimizerTest(String name) {
- super(name);
- }
-
- public Pack200OptimizerTest() {
- super("");
- }
+public class Pack200OptimizerTest {
- // public void testPrepare() throws IOException {
- // // Setup the step
- // ProcessingStep step = new Pack200OptimizerStep();
- // FileOutputStream destination = new FileOutputStream("c:/packed.pack.gz");
- // step.link(destination, new NullProgressMonitor());
+ // public void testPrepare() throws IOException {
+ // // Setup the step
+ // ProcessingStep step = new Pack200OptimizerStep();
+ // FileOutputStream destination = new FileOutputStream("c:/packed.pack.gz");
+ // step.link(destination, new NullProgressMonitor());
//
- // // drive the source data through the step
- // Bundle bundle = TestActivator.getContext().getBundle();
- // InputStream inputStream = bundle.getEntry("testData/optimizers/org.eclipse.equinox.app_1.0.100.v20071015.jar").openStream();
- // FileUtils.copyStream(inputStream, true, step, true);
+ // // drive the source data through the step
+ // Bundle bundle = TestActivator.getContext().getBundle();
+ // InputStream inputStream =
+ // bundle.getEntry("testData/optimizers/org.eclipse.equinox.app_1.0.100.v20071015.jar").openStream();
+ // FileUtils.copyStream(inputStream, true, step, true);
//
- // destination.close();
- // }
+ // destination.close();
+ // }
+ @Test
public void testPack() throws IOException {
// Setup the step
ProcessingStep step = new Pack200OptimizerStep();
@@ -52,7 +48,8 @@ public class Pack200OptimizerTest extends TestCase {
// drive the source data through the step
Bundle bundle = TestActivator.getContext().getBundle();
- InputStream inputStream = bundle.getEntry("testData/optimizers/org.eclipse.equinox.app_1.0.100.v20071015.jar").openStream();
+ InputStream inputStream = bundle.getEntry("testData/optimizers/org.eclipse.equinox.app_1.0.100.v20071015.jar")
+ .openStream();
FileUtils.copyStream(inputStream, true, step, true);
assertTrue("Failure: " + step.getStatus().getMessage(), step.getStatus().isOK());
@@ -60,12 +57,15 @@ public class Pack200OptimizerTest extends TestCase {
// Get the test data. The Sun 1.6.0_01 JRE produces a different packed file
// then the IBM V5 JRE, so both versions of the test data are maintained.
// TODO: investigate this? Is the difference spurious? Are there differences
- // in the pack200 results for other JREs? Do we need a more general
- // solution to the problem?
+ // in the pack200 results for other JREs? Do we need a more general
+ // solution to the problem?
String javaVersion = System.getProperty("java.version");
boolean is1_6 = javaVersion.compareTo("1.6") > 0;
- inputStream = bundle.getEntry(is1_6 ? "testData/optimizers/1_6/org.eclipse.equinox.app_1.0.100.v20071015.jar.pack.gz" : "testData/optimizers/org.eclipse.equinox.app_1.0.100.v20071015.jar.pack.gz").openStream();
+ inputStream = bundle
+ .getEntry(is1_6 ? "testData/optimizers/1_6/org.eclipse.equinox.app_1.0.100.v20071015.jar.pack.gz"
+ : "testData/optimizers/org.eclipse.equinox.app_1.0.100.v20071015.jar.pack.gz")
+ .openStream();
ByteArrayOutputStream expected = new ByteArrayOutputStream();
FileUtils.copyStream(inputStream, true, expected, true);

Back to the top