1 package org.paneris.bibliomania.metasearch;
2
3 import java.io.File;
4 import java.util.Enumeration;
5
6 import org.paneris.bibliomania.BookStocking;
7
8
9
10
11
12
13
14 public class Test {
15
16
17
18
19
20
21
22
23
24
25 public static void main(String args[]) throws Exception {
26 if (args[0].equals("search")) {
27 BookshopBackend b;
28 if (args[1].equals("bol"))
29 b = new org.paneris.bibliomania.metasearch.bol.Backend(new File("/tmp"),
30 65536);
31 else if (args[1].equals("bob"))
32 b = new org.paneris.bibliomania.metasearch.bob.Backend(new File("/tmp"),
33 65536);
34 else if (args[1].equals("ama"))
35 b = new org.paneris.bibliomania.metasearch.amazon.Backend(
36 new File("/tmp"), 65536);
37 else
38 throw new IllegalArgumentException();
39
40
41 BookStockingFactory dummy =
42 new BookStockingFactory() {
43 public BookStocking newStocking() {
44 return new BookStocking();
45 }
46 };
47
48 for (Enumeration e = b.booksMatching(dummy,
49 args[2], args[3], "", "", null);
50 e.hasMoreElements();) {
51 BookStocking s = (BookStocking)e.nextElement();
52 b.resolve(s);
53 s.dump(System.err);
54 System.err.println("-");
55 }
56 System.err.println("Done");
57 }
58 }
59 }