romanmostyka@2032
|
1 |
/*
|
romanmostyka@2032
|
2 |
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
romanmostyka@2032
|
3 |
*
|
jglick@2928
|
4 |
* Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
|
jglick@2928
|
5 |
*
|
jglick@2928
|
6 |
* Oracle and Java are registered trademarks of Oracle and/or its affiliates.
|
jglick@2928
|
7 |
* Other names may be trademarks of their respective owners.
|
romanmostyka@2032
|
8 |
*
|
romanmostyka@2032
|
9 |
* The contents of this file are subject to the terms of either the GNU
|
romanmostyka@2032
|
10 |
* General Public License Version 2 only ("GPL") or the Common
|
romanmostyka@2032
|
11 |
* Development and Distribution License("CDDL") (collectively, the
|
romanmostyka@2032
|
12 |
* "License"). You may not use this file except in compliance with the
|
romanmostyka@2032
|
13 |
* License. You can obtain a copy of the License at
|
romanmostyka@2032
|
14 |
* http://www.netbeans.org/cddl-gplv2.html
|
romanmostyka@2032
|
15 |
* or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
|
romanmostyka@2032
|
16 |
* specific language governing permissions and limitations under the
|
romanmostyka@2032
|
17 |
* License. When distributing the software, include this License Header
|
romanmostyka@2032
|
18 |
* Notice in each file and include the License file at
|
jglick@2928
|
19 |
* nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
|
romanmostyka@2032
|
20 |
* particular file as subject to the "Classpath" exception as provided
|
jglick@2928
|
21 |
* by Oracle in the GPL Version 2 section of the License file that
|
romanmostyka@2032
|
22 |
* accompanied this code. If applicable, add the following below the
|
romanmostyka@2032
|
23 |
* License Header, with the fields enclosed by brackets [] replaced by
|
romanmostyka@2032
|
24 |
* your own identifying information:
|
romanmostyka@2032
|
25 |
* "Portions Copyrighted [year] [name of copyright owner]"
|
romanmostyka@2032
|
26 |
*
|
romanmostyka@2032
|
27 |
* Contributor(s):
|
romanmostyka@2032
|
28 |
*
|
romanmostyka@2032
|
29 |
* The Original Software is NetBeans. The Initial Developer of the Original
|
romanmostyka@2032
|
30 |
* Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
|
romanmostyka@2032
|
31 |
* Microsystems, Inc. All Rights Reserved.
|
romanmostyka@2032
|
32 |
*
|
romanmostyka@2032
|
33 |
* If you wish your version of this file to be governed by only the CDDL
|
romanmostyka@2032
|
34 |
* or only the GPL Version 2, indicate your decision by adding
|
romanmostyka@2032
|
35 |
* "[Contributor] elects to include this software in this distribution
|
romanmostyka@2032
|
36 |
* under the [CDDL or GPL Version 2] license." If you do not indicate a
|
romanmostyka@2032
|
37 |
* single choice of license, a recipient has the option to distribute
|
romanmostyka@2032
|
38 |
* your version of this file under either the CDDL, the GPL Version 2 or
|
romanmostyka@2032
|
39 |
* to extend the choice of license to its licensees as provided above.
|
romanmostyka@2032
|
40 |
* However, if you add GPL Version 2 code and therefore, elected the GPL
|
romanmostyka@2032
|
41 |
* Version 2 license, then the option applies only if the new code is
|
romanmostyka@2032
|
42 |
* made subject to such option by the copyright holder.
|
romanmostyka@2032
|
43 |
*/
|
romanmostyka@2032
|
44 |
|
romanmostyka@2032
|
45 |
package org.netbeans.test.websvcmgr;
|
romanmostyka@2032
|
46 |
|
romanmostyka@2032
|
47 |
import org.netbeans.jemmy.operators.*;
|
romanmostyka@2032
|
48 |
import org.netbeans.junit.NbTestSuite;
|
romanmostyka@2032
|
49 |
import junit.framework.Test;
|
romanmostyka@2032
|
50 |
|
romanmostyka@2032
|
51 |
import org.netbeans.modules.visualweb.gravy.dataconnectivity.ServerNavigatorOperator;
|
romanmostyka@2032
|
52 |
import org.netbeans.modules.visualweb.gravy.dataconnectivity.ServerExplorerOperator;
|
romanmostyka@2032
|
53 |
import org.netbeans.modules.visualweb.gravy.designer.DesignerPaneOperator;
|
romanmostyka@2032
|
54 |
import org.netbeans.modules.visualweb.gravy.plugins.PluginsOperator;
|
romanmostyka@2032
|
55 |
import org.netbeans.modules.visualweb.gravy.actions.FindAction;
|
romanmostyka@2032
|
56 |
import org.netbeans.modules.visualweb.gravy.websvc.*;
|
romanmostyka@2032
|
57 |
import org.netbeans.modules.visualweb.gravy.model.project.components.*;
|
romanmostyka@2032
|
58 |
import org.netbeans.modules.visualweb.gravy.model.project.*;
|
romanmostyka@2032
|
59 |
import org.netbeans.modules.visualweb.gravy.model.components.*;
|
romanmostyka@2032
|
60 |
import org.netbeans.modules.visualweb.gravy.model.deployment.*;
|
romanmostyka@2032
|
61 |
import org.netbeans.modules.visualweb.gravy.model.*;
|
romanmostyka@2032
|
62 |
import org.netbeans.modules.visualweb.gravy.*;
|
romanmostyka@2032
|
63 |
|
romanmostyka@2032
|
64 |
import java.util.Properties;
|
romanmostyka@2032
|
65 |
import java.awt.event.KeyEvent;
|
romanmostyka@2032
|
66 |
import java.awt.Point;
|
romanmostyka@2032
|
67 |
import java.io.File;
|
romanmostyka@2032
|
68 |
import java.io.FileInputStream;
|
romanmostyka@2032
|
69 |
|
romanmostyka@2032
|
70 |
/**
|
romanmostyka@2032
|
71 |
*
|
romanmostyka@2032
|
72 |
* @author Roman Mostyka
|
romanmostyka@2032
|
73 |
*/
|
romanmostyka@2032
|
74 |
|
romanmostyka@2032
|
75 |
public class WebServiceAcceptanceTest extends RaveTestCase {
|
romanmostyka@2032
|
76 |
|
romanmostyka@2032
|
77 |
private static String addBindingAttribute = Bundle.getStringTrimmed("org.netbeans.modules.visualweb.insync.action.Bundle","LBL_AddBindingAttributeActionName");
|
romanmostyka@2032
|
78 |
private static String sep = File.separator;
|
romanmostyka@2032
|
79 |
private static String wsPath = "Web Services|";
|
romanmostyka@2032
|
80 |
private static String deletePopup = "Delete";
|
romanmostyka@2032
|
81 |
private static String reformatPopup = "Format";
|
romanmostyka@2032
|
82 |
private static String addToPagePopup = "Add to Page";
|
romanmostyka@2483
|
83 |
private static String menuCopy = "Edit|Copy";
|
romanmostyka@2483
|
84 |
private static String menuPaste = "Edit|Paste";
|
romanmostyka@2032
|
85 |
private static String testMethod = "Test Method";
|
romanmostyka@2032
|
86 |
private static String dlgQuestion = "Question";
|
romanmostyka@2032
|
87 |
private static String dlgTestMethod = "Test Web Service Method";
|
romanmostyka@2032
|
88 |
private static String btnYes = "Yes";
|
romanmostyka@2032
|
89 |
private static String btnSubmit = "Submit";
|
romanmostyka@2032
|
90 |
private static String _wsProjectName = "AcceptanceWSProject";
|
romanmostyka@2032
|
91 |
private static String _projectPath = System.getProperty("xtest.workdir") + sep + "projects" + sep;
|
romanmostyka@2032
|
92 |
private static String wsURL = "URL";
|
romanmostyka@2032
|
93 |
private static String wsName = "PATH";
|
romanmostyka@2032
|
94 |
private static String wsMethod = "METHOD";
|
romanmostyka@2032
|
95 |
private static String wsMethodParameter = "PARAMETER";
|
romanmostyka@2032
|
96 |
private static String pluginName = "Visual Web JSF Backwards Compatibility Kit";
|
romanmostyka@2032
|
97 |
private static String javaCode = "CODE";
|
romanmostyka@2032
|
98 |
private static String wsResponse = "RESPONSE";
|
romanmostyka@2032
|
99 |
private static String serverType = "GlassFish V2";
|
romanmostyka@2032
|
100 |
|
romanmostyka@2032
|
101 |
private static Project prj, J2EE14prj, JavaEE5prj;
|
romanmostyka@2032
|
102 |
private static DeploymentTargetDescriptor dtd;
|
romanmostyka@2032
|
103 |
private static DeploymentTarget dt;
|
romanmostyka@2032
|
104 |
private static ApplicationServer as;
|
romanmostyka@2032
|
105 |
private static Properties properties;
|
romanmostyka@2032
|
106 |
|
romanmostyka@2032
|
107 |
private ServerNavigatorOperator server;
|
romanmostyka@2032
|
108 |
private JTreeOperator sntree;
|
romanmostyka@2032
|
109 |
|
romanmostyka@2032
|
110 |
/** constructor required by JUnit
|
romanmostyka@2032
|
111 |
* @param testName method name to be used as testcase
|
romanmostyka@2032
|
112 |
*/
|
romanmostyka@2032
|
113 |
public WebServiceAcceptanceTest(String testName) {
|
romanmostyka@2032
|
114 |
super(testName);
|
romanmostyka@2032
|
115 |
}
|
romanmostyka@2032
|
116 |
|
romanmostyka@2032
|
117 |
public static Test suite() {
|
romanmostyka@2032
|
118 |
NbTestSuite suite = new NbTestSuite("Web Service Consumption Acceptance Tests");
|
romanmostyka@2032
|
119 |
suite.addTest(new WebServiceAcceptanceTest("testPreparation"));
|
romanmostyka@2032
|
120 |
suite.addTest(new WebServiceAcceptanceTest("testAddWebService"));
|
romanmostyka@2032
|
121 |
suite.addTest(new WebServiceAcceptanceTest("testTestMethodDialog"));
|
romanmostyka@2032
|
122 |
suite.addTest(new WebServiceAcceptanceTest("testAddWebServiceToJ2EE14Project"));
|
romanmostyka@2032
|
123 |
suite.addTest(new WebServiceAcceptanceTest("testDeployJ2EE14Project"));
|
romanmostyka@2032
|
124 |
suite.addTest(new WebServiceAcceptanceTest("testAddWebServiceToJavaEE5Project"));
|
romanmostyka@2032
|
125 |
suite.addTest(new WebServiceAcceptanceTest("testDeployJavaEE5Project"));
|
romanmostyka@2032
|
126 |
suite.addTest(new WebServiceAcceptanceTest("testRemoveWebService"));
|
romanmostyka@2032
|
127 |
return suite;
|
romanmostyka@2032
|
128 |
}
|
romanmostyka@2032
|
129 |
|
romanmostyka@2032
|
130 |
/** method called before each testcase
|
romanmostyka@2032
|
131 |
*/
|
romanmostyka@2032
|
132 |
protected void setUp() {
|
romanmostyka@2032
|
133 |
}
|
romanmostyka@2032
|
134 |
|
romanmostyka@2032
|
135 |
public void testPreparation() {
|
romanmostyka@2032
|
136 |
properties = new Properties();
|
romanmostyka@2032
|
137 |
try {
|
romanmostyka@2032
|
138 |
properties.load(new FileInputStream(System.getProperty("xtest.ws-properties.file")));
|
romanmostyka@2032
|
139 |
} catch(Exception e) {
|
romanmostyka@2032
|
140 |
System.out.println("Properties can not be loaded!");
|
romanmostyka@2032
|
141 |
System.out.println("e=" + e.toString());
|
romanmostyka@2032
|
142 |
return;
|
romanmostyka@2032
|
143 |
}
|
romanmostyka@2032
|
144 |
PluginsOperator.getInstance().installAvailablePlugins(pluginName);
|
romanmostyka@2032
|
145 |
dtd = new DeploymentTargetDescriptor();
|
romanmostyka@2032
|
146 |
dtd.load();
|
romanmostyka@2032
|
147 |
if (serverType != null) dtd.setProperty(dtd.SERVER_TYPE_KEY, serverType);
|
romanmostyka@2032
|
148 |
dt = IDE.getIDE().addDeploymentTarget(dtd);
|
romanmostyka@2032
|
149 |
as = (ApplicationServer) dt;
|
romanmostyka@2032
|
150 |
as.start();
|
romanmostyka@2032
|
151 |
TestUtils.wait(1000);
|
romanmostyka@2032
|
152 |
}
|
romanmostyka@2032
|
153 |
|
romanmostyka@2032
|
154 |
public void testAddWebService() {
|
romanmostyka@2032
|
155 |
server = ServerNavigatorOperator.showNavigatorOperator();
|
romanmostyka@2032
|
156 |
server.pushPopup("Web Services", "Add Web Service...");
|
romanmostyka@2032
|
157 |
AddWebServiceOperator wsOp = new AddWebServiceOperator();
|
romanmostyka@2032
|
158 |
wsOp.addWebService(properties.get(wsURL).toString());
|
romanmostyka@2032
|
159 |
TestUtils.wait(2000);
|
romanmostyka@2032
|
160 |
}
|
romanmostyka@2032
|
161 |
|
romanmostyka@2032
|
162 |
public void testTestMethodDialog(){
|
romanmostyka@2032
|
163 |
server = ServerNavigatorOperator.showNavigatorOperator();
|
romanmostyka@2032
|
164 |
TestUtils.wait(4000);
|
romanmostyka@2032
|
165 |
server.pushPopup(wsPath + properties.get(wsMethod).toString(), testMethod);
|
romanmostyka@2032
|
166 |
TestUtils.wait(1000);
|
romanmostyka@2032
|
167 |
JDialogOperator jdo = new JDialogOperator(dlgTestMethod);
|
romanmostyka@2032
|
168 |
TestUtils.wait(1000);
|
romanmostyka@2032
|
169 |
JTableOperator jto1 = new JTableOperator(jdo, 0);
|
romanmostyka@2032
|
170 |
TestUtils.wait(1000);
|
romanmostyka@2032
|
171 |
jto1.changeCellObject(0, 2, properties.get(wsMethodParameter).toString());
|
romanmostyka@2032
|
172 |
TestUtils.wait(1000);
|
romanmostyka@2032
|
173 |
new JButtonOperator(jdo, btnSubmit).push();
|
romanmostyka@2483
|
174 |
TestUtils.wait(10000);
|
romanmostyka@2032
|
175 |
JTableOperator jto2 = new JTableOperator(jdo, 1);
|
romanmostyka@2032
|
176 |
if (jto2.getValueAt(0, 1).toString().indexOf(properties.get(wsResponse).toString()) == -1) {
|
romanmostyka@2032
|
177 |
fail("There is no needed string in response!");
|
romanmostyka@2032
|
178 |
jdo.close();
|
romanmostyka@2032
|
179 |
}
|
romanmostyka@2032
|
180 |
jdo.close();
|
romanmostyka@2032
|
181 |
}
|
romanmostyka@2032
|
182 |
|
romanmostyka@2032
|
183 |
public void testAddWebServiceToJ2EE14Project() {
|
romanmostyka@2032
|
184 |
J2EE14prj = createProject(ProjectDescriptor.J2EE14);
|
romanmostyka@2032
|
185 |
addComponentToProject(J2EE14prj);
|
romanmostyka@2032
|
186 |
addWebServiceToProject();
|
romanmostyka@2032
|
187 |
editPrerenderMethod(properties.get(javaCode).toString());
|
romanmostyka@2032
|
188 |
}
|
romanmostyka@2032
|
189 |
|
romanmostyka@2032
|
190 |
public void testDeployJ2EE14Project() {
|
romanmostyka@2032
|
191 |
DeployAndCheckProject(J2EE14prj);
|
romanmostyka@2032
|
192 |
verifyHTTP(J2EE14prj, wsResponse);
|
romanmostyka@2032
|
193 |
projectUndeployAndClose(J2EE14prj);
|
romanmostyka@2032
|
194 |
}
|
romanmostyka@2032
|
195 |
|
romanmostyka@2032
|
196 |
public void testAddWebServiceToJavaEE5Project() {
|
romanmostyka@2032
|
197 |
JavaEE5prj = createProject(ProjectDescriptor.JavaEE5);
|
romanmostyka@2032
|
198 |
addComponentToProject(JavaEE5prj);
|
romanmostyka@2032
|
199 |
addWebServiceToProject();
|
romanmostyka@2032
|
200 |
editPrerenderMethod(properties.get(javaCode).toString());
|
romanmostyka@2032
|
201 |
}
|
romanmostyka@2032
|
202 |
|
romanmostyka@2032
|
203 |
public void testDeployJavaEE5Project() {
|
romanmostyka@2032
|
204 |
DeployAndCheckProject(JavaEE5prj);
|
romanmostyka@2032
|
205 |
verifyHTTP(JavaEE5prj, wsResponse);
|
romanmostyka@2032
|
206 |
projectUndeployAndClose(JavaEE5prj);
|
romanmostyka@2032
|
207 |
as.stop();
|
romanmostyka@2032
|
208 |
}
|
romanmostyka@2032
|
209 |
|
romanmostyka@2032
|
210 |
public void testRemoveWebService() {
|
romanmostyka@2032
|
211 |
server = ServerNavigatorOperator.showNavigatorOperator();
|
romanmostyka@2032
|
212 |
TestUtils.wait(4000);
|
romanmostyka@2032
|
213 |
String wsClientPath = properties.get(wsName).toString();
|
romanmostyka@2032
|
214 |
String realPath = wsPath +
|
romanmostyka@2032
|
215 |
wsClientPath.substring(0, wsClientPath.indexOf("|"));
|
romanmostyka@2032
|
216 |
server.pushPopup(realPath, deletePopup);
|
romanmostyka@2032
|
217 |
new JButtonOperator(new DialogOperator(dlgQuestion), btnYes).push();
|
romanmostyka@2032
|
218 |
TestUtils.wait(2000);
|
romanmostyka@2032
|
219 |
}
|
romanmostyka@2032
|
220 |
|
romanmostyka@2032
|
221 |
private Project createProject(String J2EEVersion) {
|
romanmostyka@2032
|
222 |
String J2EEVersion_PREF = J2EEVersion.replace(' ', '_').replace('.', '_');
|
romanmostyka@2032
|
223 |
ProjectDescriptor pd = new ProjectDescriptor(_wsProjectName + "_" + J2EEVersion_PREF, _projectPath, J2EEVersion, as.getName());
|
romanmostyka@2032
|
224 |
Project prj = IDE.getIDE().createProject(pd);
|
romanmostyka@2032
|
225 |
TestUtils.disableBrowser(prj.getName(), true);
|
romanmostyka@2032
|
226 |
TestUtils.wait(1000);
|
romanmostyka@2032
|
227 |
return prj;
|
romanmostyka@2032
|
228 |
}
|
romanmostyka@2032
|
229 |
|
romanmostyka@2032
|
230 |
private void addComponentToProject(Project prj) {
|
romanmostyka@2032
|
231 |
WebPageFolder wpf = prj.getRoot().getWebPageRootFolder();
|
romanmostyka@2032
|
232 |
WebPage wp = wpf.getWebPage("Page1");
|
romanmostyka@2032
|
233 |
VisualComponent vcmp = (VisualComponent)
|
romanmostyka@2032
|
234 |
wp.add((WebComponent)
|
romanmostyka@2032
|
235 |
IDE.getIDE().getDefaultComponentSet().getComponent(StaticTextComponent.STATIC_TEXT_ID),
|
romanmostyka@2032
|
236 |
new Point(48, 48));
|
romanmostyka@2032
|
237 |
addBindingAttribute(wp.getName(), "page1|html1|body1|form1|" + vcmp.getName());
|
romanmostyka@2032
|
238 |
}
|
romanmostyka@2032
|
239 |
|
romanmostyka@2032
|
240 |
private void addWebServiceToProject() {
|
romanmostyka@2032
|
241 |
server = ServerNavigatorOperator.showNavigatorOperator();
|
romanmostyka@2032
|
242 |
TestUtils.wait(4000);
|
romanmostyka@2032
|
243 |
sntree = server.getTree();
|
romanmostyka@2483
|
244 |
server.selectPath(wsPath + properties.get(wsName).toString());
|
romanmostyka@2483
|
245 |
Util.getMainMenu().pushMenu(menuCopy);
|
romanmostyka@2483
|
246 |
WebPageFolder wpf = prj.getRoot().getWebPageRootFolder();
|
romanmostyka@2483
|
247 |
WebPage wp = wpf.getWebPage("Page1");
|
romanmostyka@2483
|
248 |
wp.open();
|
romanmostyka@2483
|
249 |
TestUtils.wait(1000);
|
romanmostyka@2483
|
250 |
Util.getMainMenu().pushMenu(menuPaste);
|
romanmostyka@2032
|
251 |
TestUtils.wait(30000);
|
romanmostyka@2032
|
252 |
}
|
romanmostyka@2032
|
253 |
|
romanmostyka@2032
|
254 |
private void editPrerenderMethod(String code) {
|
romanmostyka@2032
|
255 |
DesignerPaneOperator designer = new DesignerPaneOperator(RaveWindowOperator.getDefaultRave());
|
romanmostyka@2032
|
256 |
designer.switchToJavaSource();
|
romanmostyka@2032
|
257 |
TestUtils.wait(1000);
|
romanmostyka@2032
|
258 |
EditorOperator editor = new EditorOperator(RaveWindowOperator.getDefaultRave(), "Page1.java");
|
romanmostyka@2032
|
259 |
TestUtils.wait(2000);
|
romanmostyka@2032
|
260 |
new FindAction().performShortcut();
|
romanmostyka@2032
|
261 |
TestUtils.wait(2000);
|
romanmostyka@2032
|
262 |
JComboBoxOperator jcbo = new JComboBoxOperator(editor);
|
romanmostyka@2032
|
263 |
TestUtils.wait(500);
|
romanmostyka@2032
|
264 |
jcbo.clearText();
|
romanmostyka@2032
|
265 |
TestUtils.wait(500);
|
romanmostyka@2032
|
266 |
jcbo.enterText("prerender() {");
|
romanmostyka@2032
|
267 |
TestUtils.wait(500);
|
romanmostyka@2032
|
268 |
jcbo.pressKey(KeyEvent.VK_ESCAPE);
|
romanmostyka@2032
|
269 |
TestUtils.wait(500);
|
romanmostyka@2032
|
270 |
jcbo.pressKey(KeyEvent.VK_RIGHT);
|
romanmostyka@2032
|
271 |
TestUtils.wait(500);
|
romanmostyka@2032
|
272 |
editor.setCaretPositionToEndOfLine(editor.getLineNumber());
|
romanmostyka@2032
|
273 |
TestUtils.wait(500);
|
romanmostyka@2032
|
274 |
editor.pressKey(KeyEvent.VK_ENTER);
|
romanmostyka@2032
|
275 |
TestUtils.wait(2000);
|
romanmostyka@2032
|
276 |
editor.txtEditorPane().typeText(code);
|
romanmostyka@2032
|
277 |
editor.txtEditorPane().clickForPopup();
|
romanmostyka@2032
|
278 |
JPopupMenuOperator epm = new JPopupMenuOperator();
|
romanmostyka@2032
|
279 |
TestUtils.wait(1000);
|
romanmostyka@2032
|
280 |
new JMenuItemOperator(epm, reformatPopup).push();
|
romanmostyka@2032
|
281 |
TestUtils.wait(2000);
|
romanmostyka@2032
|
282 |
}
|
romanmostyka@2032
|
283 |
|
romanmostyka@2032
|
284 |
private void DeployAndCheckProject(Project prj) {
|
romanmostyka@2032
|
285 |
Util.getMainWindow().deploy();
|
romanmostyka@2032
|
286 |
TestUtils.wait(20000);
|
romanmostyka@2032
|
287 |
server = ServerNavigatorOperator.showNavigatorOperator();
|
romanmostyka@2032
|
288 |
TestUtils.wait(4000);
|
romanmostyka@2032
|
289 |
sntree = server.getTree();
|
romanmostyka@2032
|
290 |
server.pushPopup(ServerExplorerOperator.STR_SERVERS_PATH + as.web_applications_path, as.REFRESH);
|
romanmostyka@2032
|
291 |
TestUtils.wait(1000);
|
romanmostyka@2032
|
292 |
try {
|
romanmostyka@2032
|
293 |
sntree.selectPath(sntree.findPath(ServerExplorerOperator.STR_SERVERS_PATH + as.web_applications_path + "|" + as.app_pref + prj.getName()));
|
romanmostyka@2032
|
294 |
}
|
romanmostyka@2032
|
295 |
catch (Exception e) {
|
romanmostyka@2032
|
296 |
fail("There is no " + prj.getName() + " application in Deployed Components node!");
|
romanmostyka@2032
|
297 |
}
|
romanmostyka@2032
|
298 |
TestUtils.wait(1000);
|
romanmostyka@2032
|
299 |
}
|
romanmostyka@2032
|
300 |
|
romanmostyka@2032
|
301 |
private void verifyHTTP(Project prj, String verificationString) {
|
jglick@3213
|
302 |
/* XXX httpunit not available anywhere
|
romanmostyka@2032
|
303 |
try {
|
romanmostyka@2032
|
304 |
WebConversation conversation = new WebConversation();
|
romanmostyka@2032
|
305 |
WebResponse response = null;
|
romanmostyka@2032
|
306 |
System.out.println("requestPrefix=" + as.requestPrefix);
|
romanmostyka@2032
|
307 |
response = conversation.getResponse(as.requestPrefix + prj.getName());
|
romanmostyka@2032
|
308 |
if (response.getText().indexOf(properties.get(wsResponse).toString()) == -1) fail("There is no needed string in response!");
|
romanmostyka@2032
|
309 |
} catch (Exception e) {
|
romanmostyka@2032
|
310 |
System.out.println("Exception occured: ");
|
romanmostyka@2032
|
311 |
e.printStackTrace();
|
romanmostyka@2032
|
312 |
fail("Excetion in HTTP check : " + e);
|
romanmostyka@2032
|
313 |
}
|
jglick@3213
|
314 |
*/
|
romanmostyka@2032
|
315 |
}
|
romanmostyka@2032
|
316 |
|
romanmostyka@2032
|
317 |
private void projectUndeployAndClose(Project prj) {
|
romanmostyka@2032
|
318 |
TestUtils.wait(1000);
|
romanmostyka@2032
|
319 |
Util.saveAllAPICall();
|
romanmostyka@2032
|
320 |
server.pushPopup(ServerExplorerOperator.STR_SERVERS_PATH + as.web_applications_path, as.REFRESH);
|
romanmostyka@2032
|
321 |
TestUtils.wait(1000);
|
romanmostyka@2032
|
322 |
server.pushPopup(ServerExplorerOperator.STR_SERVERS_PATH + as.web_applications_path + "|" + as.app_pref + prj.getName(), as.APPLICATION_UNDEPLOY);
|
romanmostyka@2032
|
323 |
TestUtils.wait(1000);
|
romanmostyka@2032
|
324 |
prj.close();
|
romanmostyka@2032
|
325 |
TestUtils.wait(1000);
|
romanmostyka@2032
|
326 |
}
|
romanmostyka@2032
|
327 |
|
romanmostyka@2032
|
328 |
public void addBindingAttribute(String page, String full_component_path) {
|
romanmostyka@2032
|
329 |
DocumentOutlineOperator outline = new DocumentOutlineOperator(RaveWindowOperator.getDefaultRave());
|
romanmostyka@2032
|
330 |
TestUtils.wait(1000);
|
romanmostyka@2032
|
331 |
JTreeOperator aotree = outline.getStructTreeOperator();
|
romanmostyka@2032
|
332 |
aotree.callPopupOnPath(aotree.findPath(page + "|" + full_component_path));
|
romanmostyka@2032
|
333 |
TestUtils.wait(1000);
|
romanmostyka@2032
|
334 |
JPopupMenuOperator aopm = new JPopupMenuOperator();
|
romanmostyka@2032
|
335 |
TestUtils.wait(1000);
|
romanmostyka@2032
|
336 |
new JMenuItemOperator(aopm, addBindingAttribute).pushNoBlock();
|
romanmostyka@2032
|
337 |
TestUtils.wait(1000);
|
romanmostyka@2032
|
338 |
}
|
romanmostyka@2032
|
339 |
}
|
romanmostyka@2032
|
340 |
|