1 package jalview.ws.rest;
3 import static org.testng.AssertJUnit.assertEquals;
5 import jalview.bin.Cache;
7 import java.util.Vector;
9 import org.testng.annotations.Test;
11 public class RestClientTest
14 * Refactored 'as is' from main method
16 @Test(groups ={ "Functional" })
17 public void testGetRestClient()
20 * Load test properties file (readonly) so as not to overwrite the real one
22 Cache.loadProperties("test/jalview/io/testProps.jvprops");
24 RestClient[] clients = RestClient.getRestClients();
25 System.out.println("Got " + clients.length + " clients.");
27 Vector<String> urls = new Vector<String>();
28 for (RestClient cl : clients)
30 System.out.println("" + (++i) + ": " + cl.service.toString());
31 urls.add(cl.service.toString());
33 RestClient.setRsbsServices(urls);
35 RestClient[] restClients = RestClient.getRestClients();
36 assertEquals("", clients.length, restClients.length);
39 * Check the two lists hold 'equal' (albeit different) objects. Ordering
40 * should be the same as getRestClients returns the list in the same order
41 * as setRsbsServices sets it.
43 for (i = 0; i < clients.length; i++)
46 * RestServiceDescription.equals() compares numerous fields
48 assertEquals(clients[i].getRestDescription(),
49 restClients[i].getRestDescription());