Methods Summary |
---|
public static void | main(java.lang.String[] args)
if (args.length == 1) {
try {
url = new URL(args[0]);
} catch (Exception e) {
}
}
junit.textui.TestRunner.run(new junit.framework.TestSuite(SalesRankNPrice_ServiceTestCase.class));
|
private void | printit(java.lang.String result)
System.out.println("Result: " + result);
|
private void | printit(SalesRankNPrice1 r)
System.out.println("price: " + r.getPrice());
System.out.println("rank: " + r.getSalesRank());
|
private void | printit(Prices p)
System.out.println(
" Amazon price:" + p.getAmazonPrice() + "\n" +
" BN price:" + p.getBNPrice() );
|
private void | printit(SalesRanks s)
System.out.println(
" Amazon rank:" + s.getAmazonSalesRank() + "\n" +
" BN rank:" + s.getBNSalesRank());
|
private void | printit(All all)
System.out.println(
" Amazon price:" + all.getAmazonPrice() + "\n" +
" Amazon rank:" + all.getAmazonSalesRank() + "\n" +
" BN price:" + all.getBNPrice() + "\n" +
" BN rank:" + all.getBNSalesRank());
|
public void | testFileGen()
String rootDir = "build"+ File.separator + "work" + File.separator +
"test" + File.separator + "wsdl" + File.separator + "literal";
// open up the output directory and check what files exist.
File outputDir = new File(rootDir);
String[] files = outputDir.list();
for (int i=0; i < shouldExist.length; i++) {
File f = new File(rootDir, shouldExist[i]);
assertTrue("File does not exist (and it should): " + shouldExist[i], f.exists());
}
for (int i=0; i < shouldNotExist.length; i++) {
File f = new File(rootDir, shouldNotExist[i]);
assertTrue("File exist (and it should NOT): " + shouldNotExist[i], !f.exists());
}
|
public void | testSalesRankNPriceSoap()
// This is the book to look up...
// "Building Web Services With Java" :)
java.lang.String ISBN = "0672321815";
boolean debug = true;
SalesRankNPriceSoap binding;
try {
if (url != null)
binding = new SalesRankNPriceLocator().getSalesRankNPriceSoap(url);
else
binding = new SalesRankNPriceLocator().getSalesRankNPriceSoap();
} catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre );
}
assertTrue("binding is null", binding != null);
try {
printit(binding.getAmazonSalesRank(ISBN));
printit(binding.getAmazonUKSalesRank(ISBN));
//printit(binding.getBNSalesRank(ISBN));
printit(binding.getAmazonPrice(ISBN));
printit(binding.getAmazonUKPrice(ISBN));
printit(binding.getBNPrice(ISBN));
printit(binding.getAmazonSalesRankNPrice(ISBN));
printit(binding.getBNSalesRankNPrice(ISBN));
printit(binding.getAmazonAndBNSalesRank(ISBN));
printit(binding.getAmazonAndBNPrice(ISBN));
printit(binding.getAll(ISBN));
} catch (java.rmi.RemoteException re) {
if (!(re instanceof AxisFault &&
((((AxisFault) re).detail instanceof java.net.ConnectException)||
(((AxisFault) re).getFaultCode().getLocalPart().equals("HTTP"))))) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re );
} else {
// A connection exception has been detected so report this and make the test succeed.
printit("Connect failure caused some of SalesRankNPrice_ServiceTestCase to be skipped.");
}
}
|