diff options
author | sliebig | 2007-11-16 07:56:32 +0000 |
---|---|---|
committer | sliebig | 2007-11-16 07:56:32 +0000 |
commit | 7af48d3e8d65f292caa9c37f6be0dce23f29406c (patch) | |
tree | f1874dc715372aba2488ee82ecd64d538ff020b5 /bundles/ie.wombat.jbdiff.test | |
parent | f8c14cfa32ea58449a8ecf8c64497a4b0204795b (diff) | |
download | rt.equinox.p2-7af48d3e8d65f292caa9c37f6be0dce23f29406c.tar.gz rt.equinox.p2-7af48d3e8d65f292caa9c37f6be0dce23f29406c.tar.xz rt.equinox.p2-7af48d3e8d65f292caa9c37f6be0dce23f29406c.zip |
Replaced usage of Apache Ant's BZip2 with java's GZIP
Diffstat (limited to 'bundles/ie.wombat.jbdiff.test')
-rw-r--r-- | bundles/ie.wombat.jbdiff.test/src/org/apache/tools/bzip2/test/Activator.java | 34 | ||||
-rw-r--r-- | bundles/ie.wombat.jbdiff.test/src/org/apache/tools/bzip2/test/CBZip2OutputStreamTest.java | 180 |
2 files changed, 0 insertions, 214 deletions
diff --git a/bundles/ie.wombat.jbdiff.test/src/org/apache/tools/bzip2/test/Activator.java b/bundles/ie.wombat.jbdiff.test/src/org/apache/tools/bzip2/test/Activator.java deleted file mode 100644 index b393a9691..000000000 --- a/bundles/ie.wombat.jbdiff.test/src/org/apache/tools/bzip2/test/Activator.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 compeople AG 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: - * compeople AG (Stefan Liebig) - initial API and implementation - *******************************************************************************/ -package org.apache.tools.bzip2.test; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -public class Activator implements BundleActivator { - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext context) throws Exception { - } - -} diff --git a/bundles/ie.wombat.jbdiff.test/src/org/apache/tools/bzip2/test/CBZip2OutputStreamTest.java b/bundles/ie.wombat.jbdiff.test/src/org/apache/tools/bzip2/test/CBZip2OutputStreamTest.java deleted file mode 100644 index 7cfc8bebb..000000000 --- a/bundles/ie.wombat.jbdiff.test/src/org/apache/tools/bzip2/test/CBZip2OutputStreamTest.java +++ /dev/null @@ -1,180 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 compeople AG 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: - * compeople AG (Stefan Liebig) - initial API and implementation - *******************************************************************************/ -package org.apache.tools.bzip2.test; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; - -import junit.framework.TestCase; - -import org.apache.tools.bzip2.CBZip2InputStream; -import org.apache.tools.bzip2.CBZip2OutputStream; - -public class CBZip2OutputStreamTest extends TestCase { - - /** - * @throws IOException - */ - public void testEmtpyOutputShouldNotFail() throws IOException { - ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); - CBZip2OutputStream outputStream = new CBZip2OutputStream( - byteArrayOutputStream); - outputStream.close(); - ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream( - byteArrayOutputStream.toByteArray()); - - CBZip2InputStream inputStream = new CBZip2InputStream( - byteArrayInputStream); - assertEquals(-1, inputStream.read()); - } - - /** - * @throws IOException - */ - public void testOneByteOutputAndOneByteIn() throws IOException { - ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); - CBZip2OutputStream outputStream = new CBZip2OutputStream( - byteArrayOutputStream); - outputStream.write(42); - outputStream.close(); - ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream( - byteArrayOutputStream.toByteArray()); - - CBZip2InputStream inputStream = new CBZip2InputStream( - byteArrayInputStream); - assertEquals(42, inputStream.read()); - assertEquals(-1, inputStream.read()); - } - - /** - * @throws IOException - */ - public void testWriteFinishAndClose() throws IOException { - ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); - CBZip2OutputStream outputStream = new CBZip2OutputStream( - byteArrayOutputStream); - outputStream.flush(); - int len = byteArrayOutputStream.toByteArray().length; - - outputStream.write(42); - outputStream.finish(); - - int lenAfterWrite = byteArrayOutputStream.toByteArray().length; - assertTrue(len != lenAfterWrite); - - outputStream.close(); - int lenAfterClose = byteArrayOutputStream.toByteArray().length; - assertTrue(lenAfterWrite == lenAfterClose); - - ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream( - byteArrayOutputStream.toByteArray()); - - CBZip2InputStream inputStream = new CBZip2InputStream( - byteArrayInputStream); - assertEquals(42, inputStream.read()); - assertEquals(-1, inputStream.read()); - } - - /** - * @throws IOException - */ - public void testWriteFinishFinishAndClose() throws IOException { - ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); - CBZip2OutputStream outputStream = new CBZip2OutputStream( - byteArrayOutputStream); - outputStream.flush(); - int len = byteArrayOutputStream.toByteArray().length; - - outputStream.write(42); - outputStream.finish(); - outputStream.finish(); - - int lenAfterWrite = byteArrayOutputStream.toByteArray().length; - assertTrue(len != lenAfterWrite); - - outputStream.close(); - int lenAfterClose = byteArrayOutputStream.toByteArray().length; - assertTrue(lenAfterWrite == lenAfterClose); - - ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream( - byteArrayOutputStream.toByteArray()); - - CBZip2InputStream inputStream = new CBZip2InputStream( - byteArrayInputStream); - assertEquals(42, inputStream.read()); - assertEquals(-1, inputStream.read()); - } - - /** - * @throws IOException - */ - public void testWriteFinishAndCloseClose() throws IOException { - ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); - CBZip2OutputStream outputStream = new CBZip2OutputStream( - byteArrayOutputStream); - outputStream.flush(); - int len = byteArrayOutputStream.toByteArray().length; - - outputStream.write(42); - outputStream.finish(); - - int lenAfterWrite = byteArrayOutputStream.toByteArray().length; - assertTrue(len != lenAfterWrite); - - outputStream.close(); - int lenAfterClose1 = byteArrayOutputStream.toByteArray().length; - assertTrue(lenAfterWrite == lenAfterClose1); - outputStream.close(); - int lenAfterClose2 = byteArrayOutputStream.toByteArray().length; - assertTrue(lenAfterWrite == lenAfterClose2); - - ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream( - byteArrayOutputStream.toByteArray()); - - CBZip2InputStream inputStream = new CBZip2InputStream( - byteArrayInputStream); - assertEquals(42, inputStream.read()); - assertEquals(-1, inputStream.read()); - } - - /** - * @throws IOException - */ - public void testWriteFinishWriteClose() throws IOException { - ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); - CBZip2OutputStream outputStream = new CBZip2OutputStream( - byteArrayOutputStream); - outputStream.flush(); - int len = byteArrayOutputStream.toByteArray().length; - - outputStream.write(42); - outputStream.finish(); - outputStream.write(21); - outputStream.finish(); - - int lenAfterWrite = byteArrayOutputStream.toByteArray().length; - assertTrue(len != lenAfterWrite); - - outputStream.close(); - int lenAfterClose = byteArrayOutputStream.toByteArray().length; - assertTrue(lenAfterWrite == lenAfterClose); - - ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream( - byteArrayOutputStream.toByteArray()); - - CBZip2InputStream inputStream = new CBZip2InputStream( - byteArrayInputStream); - assertEquals(42, inputStream.read()); - assertEquals(-1, inputStream.read()); - } - -} |