01: /*
02: * Copyright 2001 Sun Microsystems, Inc. All rights reserved.
03: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
04: */
05:
06: package com.sun.portal.search.soif;
07:
08: import java.util.*;
09:
10: /**
11: * AVPair test routines
12: */
13: class TestAVPair {
14:
15: public static void main(String args[]) {
16: AVPair[] a = { new AVPair("att", "val"),
17: new AVPair("att", "val", 1),
18: new AVPair("att", "val", 2),
19: new AVPair("att", new byte[0]),
20: new AVPair("att", new byte[2]),
21: new AVPair("att", new byte[2], 2), };
22: for (int i = 0; i < a.length; ++i) {
23: System.out.println("" + a[i]);
24: }
25: AVPair av = new AVPair();
26: av.setAttribute("test att");
27: av.replace("xyzzy", 3);
28: byte[] b = { 'a', 'b', 'c', };
29: av.replace(b, 5);
30: System.out.println(av);
31:
32: av.replace("plugh", 3);
33: b[0] = 'X';
34: av.replace(b, 5);
35: System.out.println(av);
36:
37: av.replace(b, 3);
38: System.out.println(av);
39:
40: av.replace("frodo", 5);
41: System.out.println(av);
42:
43: av.remove(5);
44: System.out.println(av);
45:
46: av.remove(3);
47: System.out.println(av);
48: }
49:
50: }
|