| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
|
| 20 |
|
|
| 21 |
|
package jalview.ws.jabaws; |
| 22 |
|
|
| 23 |
|
import jalview.gui.JvOptionPane; |
| 24 |
|
import jalview.ws.jws2.Jws2Discoverer; |
| 25 |
|
|
| 26 |
|
import java.util.Vector; |
| 27 |
|
|
| 28 |
|
import org.testng.Assert; |
| 29 |
|
import org.testng.annotations.AfterClass; |
| 30 |
|
import org.testng.annotations.BeforeClass; |
| 31 |
|
import org.testng.annotations.Test; |
| 32 |
|
|
| |
|
| 0% |
Uncovered Elements: 28 (28) |
Complexity: 8 |
Complexity Density: 0.4 |
|
| 33 |
|
public class JalviewJabawsTestUtils |
| 34 |
|
{ |
| 35 |
|
|
| |
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 36 |
0 |
@BeforeClass(alwaysRun = true)... |
| 37 |
|
public void setUpJvOptionPane() |
| 38 |
|
{ |
| 39 |
0 |
JvOptionPane.setInteractiveMode(false); |
| 40 |
0 |
JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); |
| 41 |
|
} |
| 42 |
|
|
| |
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 43 |
0 |
@BeforeClass(alwaysRun = true)... |
| 44 |
|
public static void setUpBeforeClass() throws Exception |
| 45 |
|
{ |
| 46 |
|
} |
| 47 |
|
|
| |
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 48 |
0 |
@AfterClass(alwaysRun = true)... |
| 49 |
|
public static void tearDownAfterClass() throws Exception |
| 50 |
|
{ |
| 51 |
|
} |
| 52 |
|
|
| 53 |
|
|
| 54 |
|
|
| 55 |
|
|
| 56 |
|
private static String[] serviceUrls = new String[] { |
| 57 |
|
"http://localhost:8080/jabaws", |
| 58 |
|
"http://www.compbio.dundee.ac.uk/jabaws" }; |
| 59 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
4-
|
|
| 60 |
0 |
@Test(groups = { "Functional" }, enabled = false)... |
| 61 |
|
public void testAnnotExport() |
| 62 |
|
{ |
| 63 |
0 |
Assert.fail("Not yet implemented"); |
| 64 |
|
} |
| 65 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 66 |
0 |
public static jalview.ws.jws2.Jws2Discoverer getJabawsDiscoverer()... |
| 67 |
|
{ |
| 68 |
0 |
return getJabawsDiscoverer(true); |
| 69 |
|
} |
| 70 |
|
|
| 71 |
|
|
| 72 |
|
|
| 73 |
|
|
| 74 |
|
|
| 75 |
|
|
| 76 |
|
|
| 77 |
|
|
| 78 |
|
|
| 79 |
|
|
| 80 |
|
|
| 81 |
|
|
| 82 |
|
@param |
| 83 |
|
@return |
| 84 |
|
|
| |
|
| 0% |
Uncovered Elements: 18 (18) |
Complexity: 3 |
Complexity Density: 0.19 |
|
| 85 |
0 |
public static Jws2Discoverer getJabawsDiscoverer(boolean localhost)... |
| 86 |
|
{ |
| 87 |
0 |
jalview.ws.jws2.Jws2Discoverer disc = jalview.ws.jws2.Jws2Discoverer |
| 88 |
|
.getDiscoverer(); |
| 89 |
0 |
String svcurls = ""; |
| 90 |
0 |
if (localhost) |
| 91 |
|
{ |
| 92 |
0 |
int p = 0; |
| 93 |
0 |
Vector<String> services = new Vector<String>(); |
| 94 |
0 |
for (String url : JalviewJabawsTestUtils.serviceUrls) |
| 95 |
|
{ |
| 96 |
0 |
svcurls += url + "; "; |
| 97 |
0 |
services.add(url); |
| 98 |
|
} |
| 99 |
0 |
; |
| 100 |
0 |
Jws2Discoverer.getDiscoverer().setServiceUrls(services); |
| 101 |
|
} |
| 102 |
0 |
try |
| 103 |
|
{ |
| 104 |
0 |
disc.run(); |
| 105 |
|
} catch (Exception e) |
| 106 |
|
{ |
| 107 |
0 |
e.printStackTrace(); |
| 108 |
0 |
Assert.fail( |
| 109 |
|
"Aborting. Problem discovering services. Tried " + svcurls); |
| 110 |
|
} |
| 111 |
0 |
Assert.assertTrue(disc.getServices().size() > 0, |
| 112 |
|
"Failed to discover any services at "); |
| 113 |
0 |
return disc; |
| 114 |
|
} |
| 115 |
|
|
| 116 |
|
} |