This project has retired. For details please refer to its Attic page.
JUDDI_200_GUI_IntegrationTest xref
View Javadoc
1   /*
2    * Copyright 2014 The Apache Software Foundation.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.apache.juddi.v3.tck;
17  
18  import org.apache.commons.configuration.ConfigurationException;
19  import org.apache.commons.logging.Log;
20  import org.apache.commons.logging.LogFactory;
21  import org.apache.http.HttpResponse;
22  import org.apache.http.client.HttpClient;
23  import org.apache.http.client.methods.HttpGet;
24  import org.apache.http.impl.client.DefaultHttpClient;
25  import org.apache.juddi.v3.client.config.TokenResolver;
26  import org.apache.juddi.v3.client.config.UDDIClerk;
27  import org.apache.juddi.v3.client.config.UDDIClient;
28  import org.junit.AfterClass;
29  import org.junit.Assert;
30  import org.junit.Assume;
31  import org.junit.BeforeClass;
32  import org.junit.Test;
33  
34  /**
35   *
36   * @author Alex O'Ree
37   */
38  public class JUDDI_200_GUI_IntegrationTest {
39  
40          private static final Log logger = LogFactory.getLog(JUDDI_200_GUI_IntegrationTest.class);
41          private static UDDIClient manager;
42          private static UDDIClerk clerk;
43          private static String baseurl = null;
44  
45          @AfterClass
46          public static void stopManager() throws ConfigurationException {
47  
48          }
49  
50          @BeforeClass
51          public static void startManager() throws ConfigurationException {
52  
53                   if (!TckPublisher.isEnabled()) return;
54                  manager = new UDDIClient();
55                  baseurl = manager.getClientConfig().getConfiguration().getString("client.nodes.node(0).juddigui");
56                  if (baseurl != null) {
57                          if (!baseurl.endsWith("/")) {
58                                  baseurl = baseurl + "/";
59                                  
60                          }
61                          baseurl = TokenResolver.replaceTokens(baseurl, manager.getClientConfig().getUDDINode("default").getProperties());
62                  }
63                  JUDDI_300_MultiNodeIntegrationTest.testSetupReplicationConfig();
64          }
65  
66          @Test
67          public void Test001() throws Exception {
68                  runTest(baseurl + "home.jsp");
69          }
70  
71          @Test
72          public void Test002() throws Exception {
73                  runTest(baseurl + "about.jsp");
74          }
75  
76          @Test
77          public void Test003() throws Exception {
78                  runTest(baseurl + "advanced.jsp");
79          }
80  
81          @Test
82          public void Test004() throws Exception {
83                  runTest(baseurl + "assertions.jsp");
84          }
85  
86          @Test
87          public void Test005() throws Exception {
88                  runTest(baseurl + "bindingChooser.jsp");
89          }
90  
91          @Test
92          public void Test006() throws Exception {
93                  runTest(baseurl + "businessBrowse.jsp");
94          }
95  
96          @Test
97          public void Test007() throws Exception {
98                  runTest(baseurl + "businessChooser.jsp");
99          }
100 
101         @Test
102         public void Test008() throws Exception {
103                 runTest(baseurl + "businessEditor2.jsp");
104         }
105 
106         @Test
107         public void Test009() throws Exception {
108                 runTest(baseurl + "editSubscription.jsp");
109         }
110 
111         @Test
112         public void Test0010() throws Exception {
113                 runTest(baseurl + "error.jsp");
114         }
115 
116         @Test
117         public void Test0011() throws Exception {
118                 runTest(baseurl + "header-top.jsp");
119         }
120 
121         @Test
122         public void Test0012() throws Exception {
123                 runTest(baseurl + "home.jsp");
124         }
125 
126         @Test
127         public void Test0013() throws Exception {
128                 runTest(baseurl + "importFromWadl.jsp");
129         }
130 
131         @Test
132         public void Test0014() throws Exception {
133                 runTest(baseurl + "importFromWsdl.jsp");
134         }
135 
136         @Test
137         public void Test0015() throws Exception {
138                 runTest(baseurl + "index.jsp");
139         }
140 
141         //@Test
142         public void Test0016() throws Exception {
143                 runTest(baseurl + "reginfo.jsp");
144         }
145 
146         @Test
147         public void Test0017() throws Exception {
148                 runTest(baseurl + "search.jsp");
149         }
150 
151         @Test
152         public void Test0018() throws Exception {
153                 runTest(baseurl + "serviceBrowse.jsp");
154         }
155 
156        // @Test expect redirect
157         public void Test0019() throws Exception {
158                 runTest(baseurl + "serviceEditor.jsp?id=uddi:juddi.apache.org:services-inquiry-rest");
159         }
160 
161         //@Test auth req
162         public void Test0020() throws Exception {
163                 runTest(baseurl + "settings.jsp");
164         }
165 
166         @Test
167         public void Test0021() throws Exception {
168                 runTest(baseurl + "signer.jsp");
169         }
170 
171         @Test
172         public void Test0022() throws Exception {
173                 runTest(baseurl + "subscriptionFeed.jsp");
174         }
175 
176         @Test
177         public void Test0023() throws Exception {
178                 runTest(baseurl + "tmodelBrowse.jsp");
179         }
180 
181         @Test 
182         public void Test0024() throws Exception {
183                 runTest(baseurl + "tmodelEditor.jsp?id=uddi:uddi.org:sortorder:binarysort");
184         }
185 
186         @Test
187         public void Test0025() throws Exception {
188                 runTest(baseurl + "tmodelPartitions.jsp");
189         }
190 
191         @Test
192         public void Test0026() throws Exception {
193                 runTest(baseurl + "transfer.jsp");
194         }
195 
196         @Test
197         public void Test0027() throws Exception {
198                 runTest(baseurl + "viewSubscriptions.jsp");
199         }
200 
201         private void runTest(String url) throws Exception {
202                 Assume.assumeTrue(TckPublisher.isJUDDI());
203                 Assume.assumeTrue(baseurl != null && baseurl.length() >= 5);
204                 HttpClient client = new DefaultHttpClient();
205                 HttpGet httpGet = new HttpGet(url);
206                 logger.info("Fetching " + httpGet.getURI());
207                 HttpResponse response = client.execute(httpGet);
208                 client.getConnectionManager().shutdown();
209                 Assert.assertTrue(response.getStatusLine().getStatusCode() + " " + response.getStatusLine().getReasonPhrase(), response.getStatusLine().getStatusCode() == 200);
210         }
211 }