View Javadoc

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    * Test the Amazon Web Service calls using Apache Axis.
10   * <p>
11   * Copyright (c) 2006
12   * Melloware, Inc. <http://www.melloware.com>
13   * @author Emil A. Lefkof III <info@melloware.com>
14   * @version 4.0
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       * Constructor for AmazonSearchTest.
24       * @param arg0
25       */
26      public AmazonSearchTest(String arg0) {
27          super(arg0);
28      }
29  
30      /*
31       * @see TestCase#setUp()
32       */
33      protected void setUp() throws Exception {
34          super.setUp();
35      }
36  
37      /*
38       * @see TestCase#tearDown()
39       */
40      protected void tearDown() throws Exception {
41          super.tearDown();
42      }
43  
44  
45      /*
46       * Test method for 'com.melloware.jukes.ws.AmazonSearch.findItemsByDisc(String)'
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       * Test method for 'com.melloware.jukes.ws.AmazonSearch.findItemsByArtist(String)'
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       * Test method for 'com.melloware.jukes.ws.AmazonSearch.findItemsByArtistDisc(String, String)'
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       * Test method for 'com.melloware.jukes.ws.AmazonSearch.findItemsByArtistDiscSort(String, String, String)'
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  }