Revision 8802
Added by ben leinfelder almost 10 years ago
MetaCatServletTest.java | ||
---|---|---|
28 | 28 |
|
29 | 29 |
import edu.ucsb.nceas.MCTestCase; |
30 | 30 |
import edu.ucsb.nceas.metacat.IdentifierManager; |
31 |
import edu.ucsb.nceas.metacat.client.MetacatClient; |
|
32 |
import edu.ucsb.nceas.metacat.client.MetacatFactory; |
|
33 |
import edu.ucsb.nceas.metacat.client.MetacatInaccessibleException; |
|
31 | 34 |
import edu.ucsb.nceas.metacat.properties.PropertyService; |
32 |
import edu.ucsb.nceas.utilities.HttpMessage; |
|
33 | 35 |
import edu.ucsb.nceas.utilities.PropertyNotFoundException; |
34 | 36 |
|
35 | 37 |
import junit.framework.Test; |
... | ... | |
45 | 47 |
*/ |
46 | 48 |
public class MetaCatServletTest extends MCTestCase { |
47 | 49 |
private static String metacatURL; |
50 |
private MetacatClient metacat = null; |
|
48 | 51 |
private String serialNumber; |
49 | 52 |
|
50 | 53 |
/* Initialize properties */ |
... | ... | |
82 | 85 |
* Establish a testing framework by initializing appropriate objects |
83 | 86 |
*/ |
84 | 87 |
public void setUp() { |
88 |
try { |
|
89 |
metacat = (MetacatClient) MetacatFactory.createMetacatConnection(metacatURL); |
|
90 |
} catch (MetacatInaccessibleException e) { |
|
91 |
fail("Could not initialize MetacatClient: " + e.getMessage()); |
|
92 |
e.printStackTrace(); |
|
93 |
} |
|
85 | 94 |
|
86 | 95 |
} |
87 | 96 |
|
... | ... | |
496 | 505 |
|
497 | 506 |
String response = getMetacatString(prop); |
498 | 507 |
debug("Logout Message: " + response); |
499 |
HttpMessage.setCookie(null); |
|
500 | 508 |
|
501 | 509 |
if (response.indexOf("<logout>") != -1) { |
502 | 510 |
disConnected = true; |
... | ... | |
629 | 637 |
// Now contact metacat and send the request |
630 | 638 |
try { |
631 | 639 |
|
632 |
URL url = new URL(metacatURL); |
|
633 |
HttpMessage msg = new HttpMessage(url); |
|
634 |
returnStream = msg.sendPostMessage(prop); |
|
640 |
returnStream = metacat.sendParameters(prop); |
|
635 | 641 |
return returnStream; |
636 | 642 |
} catch (Exception e) { |
637 | 643 |
e.printStackTrace(System.err); |
Also available in: Unified diff
remove dependency on HttpMessage that was in the utilities project but is now removed in favor of newer (standard) http client library code.