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.io.*;
09: import java.util.*;
10:
11: /**
12: * SOIF test routines.
13: */
14: class TestSOIF {
15:
16: static public void main(String[] args) throws Exception {
17: //byte[] b = new byte[0];
18: //SOIF x = new SOIF(b);
19: String fname = "d:/small37.dat";
20: if (args.length > 0)
21: fname = args[args.length - 1];
22: SOIFInputStream sp = new SOIFInputStream(new DataInputStream(
23: new BufferedInputStream(new FileInputStream(fname))));
24: SOIF s;
25: while (false && (s = sp.readSOIF()) != null) {
26: System.out.println("*** " + s.contentSize() + " "
27: + s.getAttributes());
28: System.out.println(s);
29: }
30: s = new SOIF();
31: s.insert("x", "y");
32: System.out.println(s);
33: System.out.println("clone:" + s.clone());
34: s.squeezeMV();
35: System.out.println(s);
36: s.remove("x");
37: System.out.println(s);
38: s.insert("x", "y", 2);
39: System.out.println(s);
40: s.squeezeMV();
41: System.out.println(s);
42: s.remove("x", 2);
43: System.out.println(s);
44: s.insert("x", "z", 0);
45: System.out.println(s);
46: s.replace("x", "z", 0);
47: System.out.println(s);
48: s.replace("x", "q", 12);
49: System.out.println(s);
50: s.insert("x", "y", 3);
51: System.out.println(s);
52: s.squeezeMV();
53: System.out.println(s);
54: s.squeezeMV();
55: System.out.println(s);
56: }
57:
58: }
|