blob: 290d6b81bf91c5f488f657bfe75b354e8de59cc1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
import gnu.javax.net.ssl.provider.CompressionMethod;
import gnu.javax.net.ssl.provider.CompressionMethodList;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.nio.ByteBuffer;
class testCompressionMethodList
{
public static void main (String[] argv)
{
try
{
check ();
}
catch (Exception x)
{
System.out.println ("FAIL: uncaught exception " + x);
x.printStackTrace ();
}
}
static void check () throws Exception
{
ByteBuffer buffer = ByteBuffer.allocate (3);
CompressionMethodList list = new CompressionMethodList (buffer);
list.setSize (2);
list.put (0, CompressionMethod.NULL);
list.put (1, CompressionMethod.ZLIB);
System.err.println (list);
CompressionMethodList list2 = new CompressionMethodList (buffer);
if (list2.equals (list))
System.out.println ("PASS: equals()");
else
System.out.println ("FAIL: equals()");
}
}
|