Remove unnecessary Services class from all dependent tests for increasing stability (#10858)
* remove unnecessary Services class6.19.x
parent
f9ab7b7760
commit
5c1c08482c
|
|
@ -68,14 +68,17 @@ public class Refactor {
|
|||
private final WebDriverWait redrawUiElementWait;
|
||||
private final WebDriverWait loadPageWait;
|
||||
private final WebDriverWait elementWait;
|
||||
private final ProjectExplorer projectExplorer;
|
||||
|
||||
@Inject
|
||||
public Refactor(SeleniumWebDriver seleniumWebDriver, Loader loader) {
|
||||
public Refactor(
|
||||
SeleniumWebDriver seleniumWebDriver, Loader loader, ProjectExplorer projectExplorer) {
|
||||
this.seleniumWebDriver = seleniumWebDriver;
|
||||
this.loader = loader;
|
||||
this.redrawUiElementWait = new WebDriverWait(seleniumWebDriver, REDRAW_UI_ELEMENTS_TIMEOUT_SEC);
|
||||
this.loadPageWait = new WebDriverWait(seleniumWebDriver, LOAD_PAGE_TIMEOUT_SEC);
|
||||
this.elementWait = new WebDriverWait(seleniumWebDriver, ELEMENT_TIMEOUT_SEC);
|
||||
this.projectExplorer = projectExplorer;
|
||||
PageFactory.initElements(seleniumWebDriver, this);
|
||||
}
|
||||
|
||||
|
|
@ -698,6 +701,12 @@ public class Refactor {
|
|||
loadPageWait.until(attributeToBe(element, "value", expectedText));
|
||||
}
|
||||
|
||||
public void invokeRefactorWizardForProjectExplorerItem(String pathThToItem) {
|
||||
projectExplorer.waitAndSelectItem(pathThToItem);
|
||||
projectExplorer.launchRefactorByKeyboard();
|
||||
waitRenameCompilationUnitFormIsOpen();
|
||||
}
|
||||
|
||||
private void waitExpectedText(By locator, String expectedText) {
|
||||
loadPageWait.until(
|
||||
(ExpectedCondition<Boolean>)
|
||||
|
|
|
|||
|
|
@ -1,79 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2012-2018 Red Hat, Inc.
|
||||
* This program and the accompanying materials are made
|
||||
* available under the terms of the Eclipse Public License 2.0
|
||||
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Red Hat, Inc. - initial API and implementation
|
||||
*/
|
||||
package org.eclipse.che.selenium.refactor;
|
||||
|
||||
import org.eclipse.che.selenium.pageobject.NotificationsPopupPanel;
|
||||
import org.eclipse.che.selenium.pageobject.ProjectExplorer;
|
||||
import org.eclipse.che.selenium.pageobject.Refactor;
|
||||
|
||||
/**
|
||||
* //
|
||||
*
|
||||
* @author Musienko Maxim
|
||||
*/
|
||||
public class Services {
|
||||
private final ProjectExplorer projectExplorer;
|
||||
private final NotificationsPopupPanel notificationsPopupPanel;
|
||||
private final Refactor refactor;
|
||||
|
||||
public Services(
|
||||
ProjectExplorer projectExplorer,
|
||||
NotificationsPopupPanel notificationsPopupPanel,
|
||||
Refactor refactor) {
|
||||
|
||||
this.projectExplorer = projectExplorer;
|
||||
this.notificationsPopupPanel = notificationsPopupPanel;
|
||||
this.refactor = refactor;
|
||||
}
|
||||
|
||||
public void expandRenameTypesProject(String nameOfProject) {
|
||||
expandToJavaPath(nameOfProject);
|
||||
projectExplorer.waitItem(nameOfProject + "/src" + "/main" + "/java" + "/renametype");
|
||||
projectExplorer.openItemByPath(nameOfProject + "/src" + "/main" + "/java" + "/renametype");
|
||||
}
|
||||
|
||||
/** @param nameOfProject name of project to expand */
|
||||
private void expandToJavaPath(String nameOfProject) {
|
||||
projectExplorer.openItemByPath(nameOfProject);
|
||||
projectExplorer.waitItem(nameOfProject + "/src");
|
||||
projectExplorer.openItemByPath(nameOfProject + "/src");
|
||||
projectExplorer.waitItem(nameOfProject + "/src" + "/main");
|
||||
projectExplorer.openItemByPath(nameOfProject + "/src" + "/main");
|
||||
projectExplorer.waitItem(nameOfProject + "/src" + "/main" + "/java");
|
||||
projectExplorer.openItemByPath(nameOfProject + "/src" + "/main" + "/java");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param nameOfProject
|
||||
* @param rootPackage
|
||||
*/
|
||||
public void expandRenamePrivateMethodProject(String nameOfProject, String rootPackage) {
|
||||
expandToJavaPath(nameOfProject);
|
||||
projectExplorer.waitItem(nameOfProject + "/src" + "/main" + "/java" + "/" + rootPackage);
|
||||
projectExplorer.openItemByPath(nameOfProject + "/src" + "/main" + "/java" + "/" + rootPackage);
|
||||
}
|
||||
|
||||
/** @param projectName */
|
||||
public void expandSpringProjectNodes(String projectName) {
|
||||
projectExplorer.openItemByPath(projectName);
|
||||
notificationsPopupPanel.waitProgressPopupPanelClose();
|
||||
projectExplorer.openItemByPath(projectName + "/src");
|
||||
projectExplorer.openItemByPath(projectName + "/src" + "/main");
|
||||
projectExplorer.openItemByPath(projectName + "/src" + "/main" + "/java");
|
||||
}
|
||||
|
||||
public void invokeRefactorWizardForProjectExplorerItem(String pathThToItem) {
|
||||
projectExplorer.waitAndSelectItem(pathThToItem);
|
||||
projectExplorer.launchRefactorByKeyboard();
|
||||
refactor.waitRenameCompilationUnitFormIsOpen();
|
||||
}
|
||||
}
|
||||
|
|
@ -27,7 +27,6 @@ import org.eclipse.che.selenium.pageobject.Loader;
|
|||
import org.eclipse.che.selenium.pageobject.NotificationsPopupPanel;
|
||||
import org.eclipse.che.selenium.pageobject.ProjectExplorer;
|
||||
import org.eclipse.che.selenium.pageobject.Refactor;
|
||||
import org.eclipse.che.selenium.refactor.Services;
|
||||
import org.openqa.selenium.Keys;
|
||||
import org.testng.annotations.AfterMethod;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
|
|
@ -63,8 +62,7 @@ public class RenameNotPrivateFieldTest {
|
|||
ide.open(workspace);
|
||||
projectExplorer.waitProjectExplorer();
|
||||
projectExplorer.waitItem(PROJECT_NAME);
|
||||
new Services(projectExplorer, notificationsPopupPanel, refactor)
|
||||
.expandSpringProjectNodes(PROJECT_NAME);
|
||||
projectExplorer.quickExpandWithJavaScript();
|
||||
}
|
||||
|
||||
@AfterMethod
|
||||
|
|
@ -81,7 +79,6 @@ public class RenameNotPrivateFieldTest {
|
|||
public void checkRenameNotPrivateField0() throws Exception {
|
||||
setFieldsForTest("test0");
|
||||
projectExplorer.scrollAndSelectItem(pathToCurrentPackage);
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage);
|
||||
projectExplorer.waitVisibleItem(pathToCurrentPackage + "/A.java");
|
||||
projectExplorer.sendToItemDownArrowKey();
|
||||
projectExplorer.sendToItemEnterKey();
|
||||
|
|
@ -102,7 +99,6 @@ public class RenameNotPrivateFieldTest {
|
|||
@Test
|
||||
public void checkRenameNotPrivateField1() throws Exception {
|
||||
setFieldsForTest("test1");
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage);
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage + "/A.java");
|
||||
editor.waitActive();
|
||||
editor.waitTextIntoEditor(contentFromInA);
|
||||
|
|
@ -121,7 +117,6 @@ public class RenameNotPrivateFieldTest {
|
|||
@Test
|
||||
public void checkRenameNotPrivateField2() throws Exception {
|
||||
setFieldsForTest("test2");
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage);
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage + "/A.java");
|
||||
editor.waitActive();
|
||||
editor.waitTextIntoEditor(contentFromInA);
|
||||
|
|
@ -137,7 +132,6 @@ public class RenameNotPrivateFieldTest {
|
|||
@Test
|
||||
public void checkRenameNotPrivateField3() throws Exception {
|
||||
setFieldsForTest("test3");
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage);
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage + "/A.java");
|
||||
editor.waitActive();
|
||||
editor.waitTextIntoEditor(contentFromInA);
|
||||
|
|
@ -156,7 +150,6 @@ public class RenameNotPrivateFieldTest {
|
|||
public void checkRenameNotPrivateField4() throws Exception {
|
||||
setFieldsForTest("test4");
|
||||
projectExplorer.scrollAndSelectItem(pathToCurrentPackage);
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage);
|
||||
projectExplorer.waitVisibleItem(pathToCurrentPackage + "/A.java");
|
||||
projectExplorer.sendToItemDownArrowKey();
|
||||
projectExplorer.sendToItemEnterKey();
|
||||
|
|
@ -177,7 +170,6 @@ public class RenameNotPrivateFieldTest {
|
|||
public void checkRenameNotPrivateField5() throws Exception {
|
||||
setFieldsForTest("test5");
|
||||
projectExplorer.scrollAndSelectItem(pathToCurrentPackage);
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage);
|
||||
projectExplorer.waitVisibleItem(pathToCurrentPackage + "/A.java");
|
||||
projectExplorer.sendToItemDownArrowKey();
|
||||
projectExplorer.sendToItemEnterKey();
|
||||
|
|
@ -198,7 +190,6 @@ public class RenameNotPrivateFieldTest {
|
|||
public void checkRenameNotPrivateField6() throws Exception {
|
||||
setFieldsForTest("test6");
|
||||
projectExplorer.scrollAndSelectItem(pathToCurrentPackage);
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage);
|
||||
projectExplorer.waitVisibleItem(pathToCurrentPackage + "/A.java");
|
||||
projectExplorer.sendToItemDownArrowKey();
|
||||
projectExplorer.sendToItemEnterKey();
|
||||
|
|
@ -220,7 +211,6 @@ public class RenameNotPrivateFieldTest {
|
|||
public void checkRenameNotPrivateField7() throws Exception {
|
||||
setFieldsForTest("test7");
|
||||
projectExplorer.scrollAndSelectItem(pathToCurrentPackage);
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage);
|
||||
projectExplorer.waitVisibleItem(pathToCurrentPackage + "/A.java");
|
||||
projectExplorer.sendToItemDownArrowKey();
|
||||
projectExplorer.sendToItemEnterKey();
|
||||
|
|
@ -244,7 +234,6 @@ public class RenameNotPrivateFieldTest {
|
|||
public void checkRenameNotPrivateField8() throws Exception {
|
||||
setFieldsForTest("test8");
|
||||
projectExplorer.scrollAndSelectItem(pathToCurrentPackage);
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage);
|
||||
projectExplorer.waitVisibleItem(pathToCurrentPackage + "/A.java");
|
||||
projectExplorer.sendToItemDownArrowKey();
|
||||
projectExplorer.sendToItemEnterKey();
|
||||
|
|
@ -268,7 +257,6 @@ public class RenameNotPrivateFieldTest {
|
|||
public void checkRenameNotPrivateField9() throws Exception {
|
||||
setFieldsForTest("test9");
|
||||
projectExplorer.scrollAndSelectItem(pathToCurrentPackage);
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage);
|
||||
projectExplorer.waitVisibleItem(pathToCurrentPackage + "/A.java");
|
||||
projectExplorer.sendToItemDownArrowKey();
|
||||
projectExplorer.sendToItemEnterKey();
|
||||
|
|
@ -288,7 +276,6 @@ public class RenameNotPrivateFieldTest {
|
|||
@Test
|
||||
public void checkRenameNotPrivateField10() throws Exception {
|
||||
setFieldsForTest("test10");
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage);
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage + "/A.java");
|
||||
editor.waitActive();
|
||||
editor.waitTextIntoEditor(contentFromInA);
|
||||
|
|
@ -306,7 +293,6 @@ public class RenameNotPrivateFieldTest {
|
|||
@Test
|
||||
public void checkRenameAnnotation24() throws Exception {
|
||||
setFieldsForTest("test24");
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage);
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage + "/A.java");
|
||||
editor.waitActive();
|
||||
editor.waitTextIntoEditor(contentFromInA);
|
||||
|
|
@ -323,7 +309,6 @@ public class RenameNotPrivateFieldTest {
|
|||
@Test
|
||||
public void checkRenameAnnotation25() throws Exception {
|
||||
setFieldsForTest("test25");
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage);
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage + "/A.java");
|
||||
editor.waitActive();
|
||||
editor.waitTextIntoEditor(contentFromInA);
|
||||
|
|
@ -339,7 +324,6 @@ public class RenameNotPrivateFieldTest {
|
|||
@Test
|
||||
public void checkBugFiveEightTwoOne26() throws Exception {
|
||||
setFieldsForTest("test26");
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage);
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage + "/A.java");
|
||||
editor.waitActive();
|
||||
editor.waitTextIntoEditor(contentFromInA);
|
||||
|
|
@ -355,7 +339,6 @@ public class RenameNotPrivateFieldTest {
|
|||
@Test
|
||||
public void checkRenameDelegate28() throws Exception {
|
||||
setFieldsForTest("test28");
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage);
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage + "/A.java");
|
||||
editor.waitActive();
|
||||
editor.waitTextIntoEditor(contentFromInA);
|
||||
|
|
@ -374,7 +357,6 @@ public class RenameNotPrivateFieldTest {
|
|||
public void checkRenameEnumField31() throws Exception {
|
||||
setFieldsForTest("test31");
|
||||
projectExplorer.scrollAndSelectItem(pathToCurrentPackage);
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage);
|
||||
projectExplorer.waitVisibleItem(pathToCurrentPackage + "/A.java");
|
||||
projectExplorer.sendToItemDownArrowKey();
|
||||
projectExplorer.sendToItemEnterKey();
|
||||
|
|
@ -395,7 +377,6 @@ public class RenameNotPrivateFieldTest {
|
|||
public void checkRenameGenerics32() throws Exception {
|
||||
setFieldsForTest("test32");
|
||||
projectExplorer.scrollAndSelectItem(pathToCurrentPackage);
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage);
|
||||
projectExplorer.waitVisibleItem(pathToCurrentPackage + "/A.java");
|
||||
projectExplorer.sendToItemDownArrowKey();
|
||||
projectExplorer.sendToItemEnterKey();
|
||||
|
|
@ -416,7 +397,6 @@ public class RenameNotPrivateFieldTest {
|
|||
public void checkRenameGenerics33() throws Exception {
|
||||
setFieldsForTest("test33");
|
||||
projectExplorer.scrollAndSelectItem(pathToCurrentPackage);
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage);
|
||||
projectExplorer.waitVisibleItem(pathToCurrentPackage + "/A.java");
|
||||
projectExplorer.sendToItemDownArrowKey();
|
||||
projectExplorer.sendToItemEnterKey();
|
||||
|
|
@ -437,7 +417,6 @@ public class RenameNotPrivateFieldTest {
|
|||
public void checkRenameGenerics36() throws Exception {
|
||||
setFieldsForTest("test36");
|
||||
projectExplorer.scrollAndSelectItem(pathToCurrentPackage);
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage);
|
||||
projectExplorer.waitVisibleItem(pathToCurrentPackage + "/A.java");
|
||||
projectExplorer.sendToItemDownArrowKey();
|
||||
projectExplorer.sendToItemEnterKey();
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ import org.eclipse.che.selenium.pageobject.Loader;
|
|||
import org.eclipse.che.selenium.pageobject.NotificationsPopupPanel;
|
||||
import org.eclipse.che.selenium.pageobject.ProjectExplorer;
|
||||
import org.eclipse.che.selenium.pageobject.Refactor;
|
||||
import org.eclipse.che.selenium.refactor.Services;
|
||||
import org.openqa.selenium.Keys;
|
||||
import org.openqa.selenium.TimeoutException;
|
||||
import org.testng.annotations.AfterMethod;
|
||||
|
|
@ -68,8 +67,7 @@ public class RenamePrivateFieldTest {
|
|||
ide.open(workspace);
|
||||
projectExplorer.waitProjectExplorer();
|
||||
projectExplorer.waitItem(PROJECT_NAME);
|
||||
new Services(projectExplorer, notificationsPopupPanel, refactor)
|
||||
.expandSpringProjectNodes(PROJECT_NAME);
|
||||
projectExplorer.quickExpandWithJavaScript();
|
||||
}
|
||||
|
||||
@AfterMethod
|
||||
|
|
@ -85,7 +83,6 @@ public class RenamePrivateFieldTest {
|
|||
@Test
|
||||
public void checkRenamePrivateField0() throws Exception {
|
||||
setFieldsForTest("test0");
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage);
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage + "/A.java");
|
||||
editor.waitActive();
|
||||
editor.waitTextIntoEditor(contentFromInA);
|
||||
|
|
@ -106,7 +103,6 @@ public class RenamePrivateFieldTest {
|
|||
@Test
|
||||
public void checkRenamePrivateField1() throws Exception {
|
||||
setFieldsForTest("test1");
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage);
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage + "/A.java");
|
||||
editor.waitActive();
|
||||
editor.waitTextIntoEditor(contentFromInA);
|
||||
|
|
@ -127,7 +123,6 @@ public class RenamePrivateFieldTest {
|
|||
@Test
|
||||
public void checkRenamePrivateField2() throws Exception {
|
||||
setFieldsForTest("test2");
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage);
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage + "/A.java");
|
||||
editor.waitActive();
|
||||
editor.waitTextIntoEditor(contentFromInA);
|
||||
|
|
@ -148,7 +143,6 @@ public class RenamePrivateFieldTest {
|
|||
@Test
|
||||
public void checkRenamePrivateField3() throws Exception {
|
||||
setFieldsForTest("test3");
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage);
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage + "/A.java");
|
||||
editor.waitActive();
|
||||
editor.waitTextIntoEditor(contentFromInA);
|
||||
|
|
@ -172,7 +166,6 @@ public class RenamePrivateFieldTest {
|
|||
@Test
|
||||
public void checkRenamePrivateField4() throws Exception {
|
||||
setFieldsForTest("test4");
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage);
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage + "/A.java");
|
||||
editor.waitActive();
|
||||
editor.waitTextIntoEditor(contentFromInA);
|
||||
|
|
@ -196,7 +189,6 @@ public class RenamePrivateFieldTest {
|
|||
@Test
|
||||
public void checkRenamePrivateField5() throws Exception {
|
||||
setFieldsForTest("test5");
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage);
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage + "/A.java");
|
||||
editor.waitActive();
|
||||
editor.waitTextIntoEditor(contentFromInA);
|
||||
|
|
@ -219,7 +211,6 @@ public class RenamePrivateFieldTest {
|
|||
@Test
|
||||
public void checkRenamePrivateField6() throws Exception {
|
||||
setFieldsForTest("test6");
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage);
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage + "/A.java");
|
||||
editor.waitActive();
|
||||
editor.waitTextIntoEditor(contentFromInA);
|
||||
|
|
@ -242,7 +233,6 @@ public class RenamePrivateFieldTest {
|
|||
@Test
|
||||
public void checkRenamePrivateField7() throws Exception {
|
||||
setFieldsForTest("test7");
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage);
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage + "/A.java");
|
||||
editor.waitActive();
|
||||
editor.waitTextIntoEditor(contentFromInA);
|
||||
|
|
@ -265,7 +255,6 @@ public class RenamePrivateFieldTest {
|
|||
@Test
|
||||
public void checkRenamePrivateField8() throws Exception {
|
||||
setFieldsForTest("test8");
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage);
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage + "/A.java");
|
||||
editor.waitActive();
|
||||
editor.waitTextIntoEditor(contentFromInA);
|
||||
|
|
@ -286,7 +275,6 @@ public class RenamePrivateFieldTest {
|
|||
@Test
|
||||
public void checkRenamePrivateField9() throws Exception {
|
||||
setFieldsForTest("test9");
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage);
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage + "/A.java");
|
||||
editor.waitActive();
|
||||
editor.waitTextIntoEditor(contentFromInA);
|
||||
|
|
@ -307,7 +295,6 @@ public class RenamePrivateFieldTest {
|
|||
@Test
|
||||
public void checkRenamePrivateField10() throws Exception {
|
||||
setFieldsForTest("test10");
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage);
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage + "/A.java");
|
||||
editor.waitActive();
|
||||
editor.waitTextIntoEditor(contentFromInA);
|
||||
|
|
@ -331,7 +318,6 @@ public class RenamePrivateFieldTest {
|
|||
@Test
|
||||
public void checkRenamePrivateField11() throws Exception {
|
||||
setFieldsForTest("test11");
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage);
|
||||
consoles.closeProcessesArea();
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage + "/A.java");
|
||||
editor.waitActive();
|
||||
|
|
@ -356,7 +342,6 @@ public class RenamePrivateFieldTest {
|
|||
@Test
|
||||
public void checkRenameUnicode12() throws Exception {
|
||||
setFieldsForTest("test12");
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage);
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage + "/A.java");
|
||||
editor.waitActive();
|
||||
editor.waitTextIntoEditor(contentFromInA);
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import java.nio.charset.Charset;
|
|||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import org.eclipse.che.commons.lang.NameGenerator;
|
||||
import org.eclipse.che.selenium.core.client.TestProjectServiceClient;
|
||||
import org.eclipse.che.selenium.core.project.ProjectTemplates;
|
||||
import org.eclipse.che.selenium.core.workspace.TestWorkspace;
|
||||
|
|
@ -31,7 +31,6 @@ import org.eclipse.che.selenium.pageobject.Loader;
|
|||
import org.eclipse.che.selenium.pageobject.NotificationsPopupPanel;
|
||||
import org.eclipse.che.selenium.pageobject.ProjectExplorer;
|
||||
import org.eclipse.che.selenium.pageobject.Refactor;
|
||||
import org.eclipse.che.selenium.refactor.Services;
|
||||
import org.openqa.selenium.Keys;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
|
@ -43,10 +42,10 @@ import org.testng.annotations.Test;
|
|||
/** @author Musienko Maxim */
|
||||
public class RenameStaticMethodsTest {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(RenameStaticMethodsTest.class);
|
||||
private static final String nameOfProject =
|
||||
RenameStaticMethodsTest.class.getSimpleName() + new Random().nextInt(9999);
|
||||
private static final String NAME_OFP_ROJECT =
|
||||
NameGenerator.generate(RenameStaticMethodsTest.class.getSimpleName(), 3);
|
||||
private static final String pathToPackageInChePrefix =
|
||||
nameOfProject + "/src" + "/main" + "/java" + "/renameStaticMethods";
|
||||
NAME_OFP_ROJECT + "/src" + "/main" + "/java" + "/renameStaticMethods";
|
||||
private static final String testsFail5ErrorMess =
|
||||
"Related method 'm' (declared in 'renameStaticMethods.testFail5.A') is native. Renaming will cause an UnsatisfiedLinkError on runtime.";
|
||||
|
||||
|
|
@ -74,11 +73,11 @@ public class RenameStaticMethodsTest {
|
|||
testProjectServiceClient.importProject(
|
||||
workspace.getId(),
|
||||
Paths.get(resource.toURI()),
|
||||
nameOfProject,
|
||||
NAME_OFP_ROJECT,
|
||||
ProjectTemplates.MAVEN_SIMPLE);
|
||||
ide.open(workspace);
|
||||
new Services(projectExplorer, notificationsPopupPanel, refactor)
|
||||
.expandRenamePrivateMethodProject(nameOfProject, "renameStaticMethods");
|
||||
projectExplorer.waitItem(NAME_OFP_ROJECT);
|
||||
projectExplorer.quickExpandWithJavaScript();
|
||||
consoles.closeProcessesArea();
|
||||
}
|
||||
|
||||
|
|
@ -180,7 +179,6 @@ public class RenameStaticMethodsTest {
|
|||
|
||||
private void prepareProjectForRefactor(int cursorPositionLine, int cursorPositionChar) {
|
||||
projectExplorer.waitItem(pathToPackageInChePrefix);
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage);
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage + "/A.java");
|
||||
editor.waitTextIntoEditor(contentFromInA);
|
||||
editor.goToCursorPositionVisible(cursorPositionLine, cursorPositionChar);
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ import org.eclipse.che.selenium.pageobject.Loader;
|
|||
import org.eclipse.che.selenium.pageobject.NotificationsPopupPanel;
|
||||
import org.eclipse.che.selenium.pageobject.ProjectExplorer;
|
||||
import org.eclipse.che.selenium.pageobject.Refactor;
|
||||
import org.eclipse.che.selenium.refactor.Services;
|
||||
import org.openqa.selenium.Keys;
|
||||
import org.openqa.selenium.WebDriverException;
|
||||
import org.slf4j.Logger;
|
||||
|
|
@ -47,7 +46,6 @@ public class TestFailTest {
|
|||
|
||||
private String renameItem = "B.java";
|
||||
private String pathToCurrentPackage;
|
||||
private Services services;
|
||||
|
||||
@Inject private TestWorkspace workspace;
|
||||
@Inject private Ide ide;
|
||||
|
|
@ -63,8 +61,6 @@ public class TestFailTest {
|
|||
|
||||
@BeforeClass
|
||||
public void setup() throws Exception {
|
||||
services = new Services(projectExplorer, notificationsPopupPanel, refactor);
|
||||
|
||||
URL resource = TestFailTest.this.getClass().getResource("/projects/RenameType");
|
||||
testProjectServiceClient.importProject(
|
||||
workspace.getId(),
|
||||
|
|
@ -105,7 +101,7 @@ public class TestFailTest {
|
|||
loader.waitOnClosed();
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage + "/A.java");
|
||||
editor.waitActive();
|
||||
services.invokeRefactorWizardForProjectExplorerItem(pathToCurrentPackage + "/A.java");
|
||||
refactor.invokeRefactorWizardForProjectExplorerItem(pathToCurrentPackage + "/A.java");
|
||||
doRefactorWithWidget(renameItem);
|
||||
refactorPanel.waitTextInErrorMessage("Compilation unit 'B.java' already exists");
|
||||
refactorPanel.clickCancelButtonRefactorForm();
|
||||
|
|
@ -115,7 +111,7 @@ public class TestFailTest {
|
|||
public void testFail35() {
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage + "/A.java");
|
||||
editor.waitActive();
|
||||
services.invokeRefactorWizardForProjectExplorerItem(pathToCurrentPackage + "/A.java");
|
||||
refactor.invokeRefactorWizardForProjectExplorerItem(pathToCurrentPackage + "/A.java");
|
||||
doRefactorWithWidget(renameItem);
|
||||
askDialog.waitFormToOpen();
|
||||
askDialog.acceptDialogWithText(
|
||||
|
|
@ -127,7 +123,7 @@ public class TestFailTest {
|
|||
public void testFail80() {
|
||||
projectExplorer.openItemByPath(pathToCurrentPackage + "/A.java");
|
||||
editor.waitActive();
|
||||
services.invokeRefactorWizardForProjectExplorerItem(pathToCurrentPackage + "/A.java");
|
||||
refactor.invokeRefactorWizardForProjectExplorerItem(pathToCurrentPackage + "/A.java");
|
||||
doRefactorWithWidget(renameItem);
|
||||
askDialog.waitFormToOpen();
|
||||
askDialog.acceptDialogWithText(
|
||||
|
|
|
|||
Loading…
Reference in New Issue