package de.pinyto.ctSESAM;

import android.util.Base64;

import junit.framework.TestCase;

/**
 * Test the Deflater-based Packer
 */
public class PackerTest extends TestCase {

    public void testCompress() {
        Packer p = new Packer();
        byte[] packed_data = p.compress("Some packable information");
        assertEquals(
                "AAAAGXjaC87PTVUoSEzOTkzKSVXIzEvLL8pNLMnMzwMAedUJrg==\n",
                Base64.encodeToString(packed_data, Base64.DEFAULT));
        assertEquals(
                "AAAAAXjaSwQAAGIAYg==\n",
                Base64.encodeToString(p.compress("a"), Base64.DEFAULT));
    }

    public void testDecompress() {
        Packer p = new Packer();
        byte[] compressed = Base64.decode(
                "AAAAGXjaC87PTVUoSEzOTkzKSVXIzEvLL8pNLMnMzwMAedUJrg==",
                Base64.DEFAULT);
        assertEquals("Some packable information", p.decompress(compressed));
    }

}

@@ -207,41 +207,8 @@
 ) %7B%0A
-        Packer p = new Packer();%0A
     
@@ -232,17 +232,22 @@
 _data = 
-p
+Packer
 .compres
@@ -545,17 +545,22 @@
 oString(
-p
+Packer
 .compres
@@ -631,41 +631,8 @@
 ) %7B%0A
-        Packer p = new Packer();%0A
     
@@ -825,17 +825,22 @@
 ation%22, 
-p
+Packer
 .decompr

Test without instance call