From portal-commits at lists.jboss.org Wed May 27 06:41:31 2009 Content-Type: multipart/mixed; boundary="===============3233660269651003872==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r13416 - in branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test: selenium and 1 other directory. Date: Wed, 27 May 2009 06:33:50 -0400 Message-ID: --===============3233660269651003872== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: vrockai Date: 2009-05-27 06:33:48 -0400 (Wed, 27 May 2009) New Revision: 13416 Added: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal= /test/selenium/XssTestCase.java Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal= /test/ant/FileCreate.java branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal= /test/selenium/JBossPortalSeleniumTestCase.java Log: [selenium] - ajax timeout, ant task javadoc, xss testcase preview Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss= /portal/test/ant/FileCreate.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/porta= l/test/ant/FileCreate.java 2009-05-27 09:11:34 UTC (rev 13415) +++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/porta= l/test/ant/FileCreate.java 2009-05-27 10:33:48 UTC (rev 13416) @@ -6,6 +6,38 @@ import org.apache.tools.ant.Project; import org.apache.tools.ant.Task; = +/** + * @author vrockai + * FileCreate task is responsible for creating specified number of files o= f random content and of specified name and size. + *

Parameters

+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * = + * + *
AttributeDescription
filenameThe prefix of name of file(s) to be generated.
suffixWhen more then one file is about to be created (set by the count at= tribute) the filename then consist of the string set by the filename attrib= e + "[i]" string + the suffix string set by the suffix attribute.
sizeThe size of individual file to be generated in bytes. When more fil= es are generated (set by count attribute), each file has specified size. + *
countThe number of files to be generated. The filename then consist of t= he string set by the filename attribe + "[i]" string + the suffix string se= t by the suffix attribute.
+ * + */ public class FileCreate extends Task { = String filename; Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss= /portal/test/selenium/JBossPortalSeleniumTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/porta= l/test/selenium/JBossPortalSeleniumTestCase.java 2009-05-27 09:11:34 UTC (r= ev 13415) +++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/porta= l/test/selenium/JBossPortalSeleniumTestCase.java 2009-05-27 10:33:48 UTC (r= ev 13416) @@ -57,7 +57,7 @@ */ public static String PAGE_LOAD =3D "180000"; /** Generic timeout in miliseconds used for AJAX timeouts } */ - public static long AJAX_LOAD =3D 3000; + public static long AJAX_LOAD =3D 6000; = // protected static final String PAGE_LOAD =3D "60000"; // protected static final long AJAX_LOAD =3D 2000; Added: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/po= rtal/test/selenium/XssTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/porta= l/test/selenium/XssTestCase.java (rev 0) +++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/porta= l/test/selenium/XssTestCase.java 2009-05-27 10:33:48 UTC (rev 13416) @@ -0,0 +1,142 @@ +package org.jboss.portal.test.selenium; + +import java.text.MessageFormat; + +import org.testng.Assert; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +/** + * XssTestCase is responsible for testing the security of JBoss Portal rel= ated + * to XSS attacks. Each test is running with user "admin" logged in. + * = + * @author Viliam Rockai + */ +(a)Test(groups =3D { "xss" }, enabled =3D true, description =3D "XSS issue= s test case.") +public class XssTestCase extends JBossPortalSeleniumTestCase { + + /** prefix for locator properties =3D dash. */ + public String casePfx =3D "xss."; + + private final String TAB_PORTALOBJ_ID =3D getLoc("portal.admin." + + "tab.portalobj.id", "Link=3DAdmin"); + private final String LINK_PORTALS_ID =3D getLoc("portal.admin." + + "link.portals.id", "link=3D*Portal Objects*"); + private final String LNK_PROPERTIES =3D getLoc("portal.admin." + + "lnk.properties", + "//a[contains(@id,'edit-context-form:object-link')]"); + private final String INP_POR_REDIR =3D getLoc("portal.admin." + + "inp.por.redir", + "//input[contains(@id,'common-edit-portal-error-form:portal-res-input')= ]"); + private final String SUB_POR_REDIR =3D getLoc("portal.admin." + + "sub.por.redir", + "//input[contains(@id,'common-edit-portal-error-form:update')]"); + private final String INP_PAG_REDIR =3D getLoc("portal.admin." + + "inp.pag.redir", + "//input[contains(@id,'common-edit-page-error-form:page-res-select')]"); + private final String SUB_PAG_REDIR =3D getLoc("portal.admin." + + "sub.pag.redir", + "//input[contains(@id,'common-edit-page-error-form:update')]"); + + private final String URL_EXC_TEST =3D "/portal/auth/portal/default/Test/E= xception+test"; + private final String LNK_POR_EXC =3D "link=3D*render PortletException*"; + + private String XSS_S1 =3D "/Dave