@@ -0,0 +1,2786 @@
+/*%0A * Copyright (c) 2010, 2011 The University of Manchester, UK.%0A *%0A * All rights reserved.%0A *%0A * Redistribution and use in source and binary forms, with or without%0A * modification, are permitted provided that the following conditions are met:%0A *%0A * * Redistributions of source code must retain the above copyright notice,%0A *   this list of conditions and the following disclaimer.%0A *%0A * * Redistributions in binary form must reproduce the above copyright notice,%0A *   this list of conditions and the following disclaimer in the documentation%0A *   and/or other materials provided with the distribution.%0A *%0A * * Neither the names of The University of Manchester nor the names of its%0A *   contributors may be used to endorse or promote products derived from this%0A *   software without specific prior written permission. %0A *%0A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS %22AS IS%22%0A * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE%0A * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE%0A * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE%0A * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR%0A * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF%0A * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS%0A * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN%0A * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)%0A * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE%0A * POSSIBILITY OF SUCH DAMAGE.%0A */%0A%0Apackage uk.org.taverna.server.client;%0A%0Aimport static org.junit.Assert.assertNotNull;%0Aimport static org.junit.Assert.assertSame;%0A%0Aimport java.net.URI;%0Aimport java.net.URISyntaxException;%0A%0Aimport org.junit.Before;%0Aimport org.junit.BeforeClass;%0Aimport org.junit.Test;%0A%0Apublic class TestServer %7B%0A%0A%09private static String address;%0A%09private URI uri1;%0A%09private URI uri2;%0A%09private Server server;%0A%0A%09@BeforeClass%0A%09public static void getAddress() %7B%0A%09%09address = System.getProperty(%22T2SERVER%22);%0A%0A%09%09if (address == null) %7B%0A%09%09%09throw new RuntimeException(%0A%09%09%09%09%09%22Invalid configuration. Make sure T2SERVER is set.%22);%0A%09%09%7D%0A%09%7D%0A%0A%09@Before%0A%09public void setup() %7B%0A%09%09try %7B%0A%09%09%09uri1 = new URI(address);%0A%09%09%09uri2 = new URI(address);%0A%09%09%7D catch (URISyntaxException e) %7B%0A%09%09%09// TODO Auto-generated catch block%0A%09%09%09e.printStackTrace();%0A%09%09%7D%0A%09%7D%0A%0A%09@Test%0A%09public void testConnect() %7B%0A%09%09server = Server.connect(uri1);%0A%09%09Server other = Server.connect(uri2);%0A%09%09Server third = null;%0A%09%09try %7B%0A%09%09%09third = Server.connect(address);%0A%09%09%7D catch (URISyntaxException e) %7B%0A%09%09%09// TODO Auto-generated catch block%0A%09%09%09e.printStackTrace();%0A%09%09%7D%0A%0A%09%09assertNotNull(server);%0A%09%09assertSame(server, other);%0A%09%09assertSame(server, third);%0A%09%7D%0A%7D%0A

Add a minimal test suite for the Server class.