This project has retired. For details please refer to its
Attic page.
UDDI_010_PublisherIntegrationTest xref
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package org.apache.juddi.v3.tck;
16
17 import org.apache.commons.configuration.ConfigurationException;
18 import org.apache.commons.logging.Log;
19 import org.apache.commons.logging.LogFactory;
20 import org.apache.juddi.v3.bpel.BPEL_010_IntegrationTest;
21 import org.apache.juddi.v3.client.config.UDDIClient;
22 import org.apache.juddi.v3.client.transport.Transport;
23 import org.junit.AfterClass;
24 import org.junit.Assert;
25 import org.junit.Assume;
26 import org.junit.BeforeClass;
27 import org.junit.Test;
28 import org.uddi.api_v3.AuthToken;
29 import org.uddi.api_v3.GetAuthToken;
30 import org.uddi.v3_service.UDDISecurityPortType;
31
32
33
34
35
36 public class UDDI_010_PublisherIntegrationTest {
37
38 private static Log logger = LogFactory.getLog(UDDI_010_PublisherIntegrationTest.class);
39
40 private static UDDIClient manager;
41
42 @BeforeClass
43 public static void startRegistry() throws ConfigurationException {
44 if (!TckPublisher.isEnabled()) {
45 return;
46 }
47 if (!TckPublisher.isJUDDI()) {
48 return;
49 }
50 manager = new UDDIClient();
51 manager.start();
52 JUDDI_300_MultiNodeIntegrationTest.testSetupReplicationConfig();
53 }
54
55 @AfterClass
56 public static void stopRegistry() throws ConfigurationException {
57 if (!TckPublisher.isEnabled()) {
58 return;
59 }
60 if (!TckPublisher.isJUDDI()) {
61 return;
62 }
63 manager.stop();
64 }
65
66 @Test
67 public void testAuthToken() {
68 Assume.assumeTrue(TckPublisher.isEnabled());
69 Assume.assumeTrue(TckPublisher.isUDDIAuthMode());
70 try {
71 Transport transport = manager.getTransport("uddiv3");
72 UDDISecurityPortType securityService = transport.getUDDISecurityService();
73 GetAuthToken getAuthToken = new GetAuthToken();
74 getAuthToken.setUserID(TckPublisher.getRootPublisherId());
75 getAuthToken.setCred(TckPublisher.getRootPassword());
76 AuthToken authToken = securityService.getAuthToken(getAuthToken);
77
78 Assert.assertNotNull(authToken);
79 } catch (Exception e) {
80 e.printStackTrace();
81 Assert.fail();
82 }
83 }
84
85 }