Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault2008-05-08 14:29:43 -0400
committerPascal Rapicault2008-05-08 14:29:43 -0400
commit6d4f225e64a2c881ada9f1228d1329de779d6f82 (patch)
tree7e3c285cbb66e950b586d504d1d60fb406656d4e /bundles/org.eclipse.equinox.p2.tests.optimizers
parent667dd46432a339522efbd0fde4aa257e021b3cfa (diff)
downloadrt.equinox.p2-6d4f225e64a2c881ada9f1228d1329de779d6f82.tar.gz
rt.equinox.p2-6d4f225e64a2c881ada9f1228d1329de779d6f82.tar.xz
rt.equinox.p2-6d4f225e64a2c881ada9f1228d1329de779d6f82.zip
Bug 224710 - Need to better handle problem files on server
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests.optimizers')
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.optimizers/src/org/eclipse/equinox/p2/tests/artifact/processors/Pack200ProcessorTest.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests.optimizers/src/org/eclipse/equinox/p2/tests/artifact/processors/Pack200ProcessorTest.java b/bundles/org.eclipse.equinox.p2.tests.optimizers/src/org/eclipse/equinox/p2/tests/artifact/processors/Pack200ProcessorTest.java
index 12b765095..7b7440e99 100644
--- a/bundles/org.eclipse.equinox.p2.tests.optimizers/src/org/eclipse/equinox/p2/tests/artifact/processors/Pack200ProcessorTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests.optimizers/src/org/eclipse/equinox/p2/tests/artifact/processors/Pack200ProcessorTest.java
@@ -49,4 +49,19 @@ public class Pack200ProcessorTest extends TestCase {
// Compare
assertTrue(Arrays.equals(expected.toByteArray(), destination.toByteArray()));
}
+
+ public void testUnpackFailsBecauseOfZeroLengthPackedFile() throws IOException {
+ // Setup the processor
+ ProcessingStep step = new Pack200ProcessorStep();
+ ByteArrayOutputStream destination = new ByteArrayOutputStream();
+ step.link(destination, new NullProgressMonitor());
+
+ // drive the source data (zero length) through the step
+ InputStream inputStream = new ByteArrayInputStream(new byte[0]);
+ FileUtils.copyStream(inputStream, true, step, true);
+
+ // This must fail, i.e. the status is not ok!
+ assertFalse(step.getStatus().isOK());
+ }
+
}

Back to the top