Skip to content
Snippets Groups Projects
Commit 08fdd06d authored by Vincent Massol's avatar Vincent Massol
Browse files

[Misc] Removed deprecated method and classes

parent a24ea767
No related branches found
No related tags found
No related merge requests found
Showing with 8 additions and 113 deletions
......@@ -20,10 +20,11 @@
package org.xwiki.panels.test.ui;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.xwiki.panels.test.po.NewPagePanel;
import org.xwiki.test.ui.AbstractGuestTest;
import org.xwiki.test.ui.AbstractStandardUserAuthenticatedTest;
import org.xwiki.test.ui.AbstractTest;
import org.xwiki.test.ui.AuthenticationRule;
import org.xwiki.test.ui.browser.IgnoreBrowser;
import org.xwiki.test.ui.browser.IgnoreBrowsers;
import org.xwiki.test.ui.po.editor.WYSIWYGEditPage;
......@@ -34,8 +35,12 @@
* @version $Id$
* @since 2.5RC1
*/
public class NewPagePanelTest extends AbstractStandardUserAuthenticatedTest
public class NewPagePanelTest extends AbstractTest
{
@Rule
public AuthenticationRule authenticationRule =
new AuthenticationRule("TestUser", "TestPassword", getUtil(), getDriver());
/**
* Tests if a new page can be created using the create page panel.
*/
......
......@@ -21,7 +21,6 @@
import org.junit.*;
import org.xwiki.administration.test.po.AdministrationPage;
import org.xwiki.test.ui.AbstractAdminAuthenticatedTest;
import org.xwiki.test.ui.AbstractTest;
import org.xwiki.test.ui.SuperAdminAuthenticationRule;
......
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.xwiki.test.ui;
import org.junit.Before;
/**
* Helper class to be extended by tests requiring an Admin user logged in.
*
* @version $Id$
* @since 3.2M3
*/
public abstract class AbstractAdminAuthenticatedTest extends AbstractTest
{
@Before
public void setUp() throws Exception
{
loginAdminUser();
}
/**
* @since 4.3M2
*/
public static void loginAdminUser()
{
if (!"Admin".equals(getUtil().getLoggedInUserName())) {
// Log in and direct to a non existent page so that it loads very fast and we don't incur the time cost of
// going to the home page for example.
getDriver().get(getUtil().getURLToLoginAsAdminAndGotoPage(getUtil().getURLToNonExistentPage()));
getUtil().recacheSecretToken();
}
}
}
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.xwiki.test.ui;
import org.junit.Before;
/**
* Helper class to be extended by tests requiring a standard user logged in.
*
* @version $Id$
* @since 5.0M2
*/
public abstract class AbstractStandardUserAuthenticatedTest extends AbstractTest
{
@Before
public void setUp() throws Exception
{
loginStandardUser();
}
public static void loginStandardUser()
{
if (!"TestUser".equals(getUtil().getLoggedInUserName())) {
// Log in and direct to a non existent page so that it loads very fast and we don't incur the time cost of
// going to the home page for example.
getUtil().registerLoginAndGotoPage("TestUser", "TestPassword", getUtil().getURLToNonExistentPage());
getUtil().recacheSecretToken();
}
}
}
......@@ -26,7 +26,6 @@
*
* @version $Id$
* @since 5.1M1
* @todo decide if we want this way of authenticating to replace {@link AbstractAdminAuthenticatedTest}
*/
public class AdminAuthenticationRule extends AuthenticationRule
{
......
......@@ -29,7 +29,6 @@
*
* @version $Id$
* @since 5.1M1
* @todo decide if we want this way of authenticating to replace {@link AbstractStandardUserAuthenticatedTest}
*/
public class AuthenticationRule implements MethodRule
{
......
......@@ -327,16 +327,6 @@ public void createUser(final String username, final String password, String redi
}
}
/**
* @deprecated starting with 5.0M2 use {@link #createUserAndLogin(String, String, Object...)} instead
*/
@Deprecated
public void registerLoginAndGotoPage(final String username, final String password, final String pageURL)
{
createUserAndLogin(username, password);
getDriver().get(pageURL);
}
public ViewPage gotoPage(String space, String page)
{
gotoPage(space, page, "view");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment