1 package com.melloware.jukes.ws;
2
3 import java.util.Collection;
4
5 import com.melloware.jukes.AbstractTestCase;
6 import com.melloware.jukes.exception.WebServiceException;
7
8
9
10
11
12
13
14
15
16 public class AmazonSearchTest extends AbstractTestCase {
17
18 public static void main(String[] args) {
19 junit.textui.TestRunner.run(AmazonSearchTest.class);
20 }
21
22
23
24
25
26 public AmazonSearchTest(String arg0) {
27 super(arg0);
28 }
29
30
31
32
33 protected void setUp() throws Exception {
34 super.setUp();
35 }
36
37
38
39
40 protected void tearDown() throws Exception {
41 super.tearDown();
42 }
43
44
45
46
47
48 public void testFindItemsByDisc() {
49 try {
50 Collection collection = AmazonSearch.findItemsByDisc("Out Of State Plates", "ecs.amazonaws.com");
51 assertNotNull(collection);
52 assertTrue(collection.size() > 0);
53 } catch (WebServiceException ex) {
54 fail("WebServiceException testFindItemsByDisc" + ex.getMessage());
55 }
56 }
57
58
59
60
61 public void testFindItemsByArtist() {
62 try {
63 Collection collection = AmazonSearch.findItemsByArtist("Fountains Of Wayne", "ecs.amazonaws.com");
64 assertNotNull(collection);
65 assertTrue(collection.size() > 0);
66 } catch (WebServiceException ex) {
67 fail("WebServiceException findItemsByArtist" + ex.getMessage());
68 }
69 }
70
71
72
73
74 public void testFindItemsByArtistDisc() {
75 try {
76 Collection collection = AmazonSearch.findItemsByArtistDisc("Fountains","Out Of State Plates", "ecs.amazonaws.com");
77 assertNotNull(collection);
78 assertTrue(collection.size() > 0);
79 } catch (WebServiceException ex) {
80 fail("WebServiceException findItemsByArtist" + ex.getMessage());
81 }
82 }
83
84
85
86
87 public void testFindItemsByArtistDiscSort() {
88 try {
89 Collection collection = AmazonSearch.findItemsByArtistDiscSort("Fountains","Out Of State Plates","ecs.amazonaws.com", AmazonSearch.SORT_DATE);
90 assertNotNull(collection);
91 assertTrue(collection.size() > 0);
92 } catch (WebServiceException ex) {
93 fail("WebServiceException findItemsByArtist" + ex.getMessage());
94 }
95 }
96
97 }