Author: julien(a)jboss.com
Date: 2007-04-22 13:39:33 -0400 (Sun, 22 Apr 2007)
New Revision: 7021
Added:
trunk/theme/src/main/org/jboss/portal/test/theme/dyna/tests/refresh/FormGetRefreshIsNotPartialWindowTest.java
Removed:
trunk/theme/src/main/org/jboss/portal/test/theme/dyna/tests/refresh/FormGetIsNotPartialWindowTest.java
Modified:
trunk/theme/src/main/org/jboss/portal/test/theme/TestServlet.java
Log:
improved name for test
Modified: trunk/theme/src/main/org/jboss/portal/test/theme/TestServlet.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/test/theme/TestServlet.java 2007-04-22 16:37:29
UTC (rev 7020)
+++ trunk/theme/src/main/org/jboss/portal/test/theme/TestServlet.java 2007-04-22 17:39:33
UTC (rev 7021)
@@ -26,7 +26,7 @@
import org.jboss.mx.util.MBeanProxy;
import org.jboss.portal.common.test.driver.TestDriverContainer;
import org.jboss.portal.test.theme.model.WindowObject;
-import org.jboss.portal.test.theme.dyna.tests.refresh.FormGetIsNotPartialWindowTest;
+import
org.jboss.portal.test.theme.dyna.tests.refresh.FormGetRefreshIsNotPartialWindowTest;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@@ -75,15 +75,15 @@
// addTest(new FormPartialRefreshWindowTest("H", null, Boolean.FALSE,
false));
// addTest(new FormPartialRefreshWindowTest("I", null, null, false));
- addTest(new FormGetIsNotPartialWindowTest("A", Boolean.TRUE,
Boolean.TRUE));
- addTest(new FormGetIsNotPartialWindowTest("B", Boolean.TRUE,
Boolean.FALSE));
- addTest(new FormGetIsNotPartialWindowTest("C", Boolean.TRUE, null));
- addTest(new FormGetIsNotPartialWindowTest("D", Boolean.FALSE,
Boolean.TRUE));
- addTest(new FormGetIsNotPartialWindowTest("E", Boolean.FALSE,
Boolean.FALSE));
- addTest(new FormGetIsNotPartialWindowTest("F", Boolean.FALSE, null));
- addTest(new FormGetIsNotPartialWindowTest("G", null, Boolean.TRUE));
- addTest(new FormGetIsNotPartialWindowTest("H", null, Boolean.FALSE));
- addTest(new FormGetIsNotPartialWindowTest("I", null, null));
+ addTest(new FormGetRefreshIsNotPartialWindowTest("A", Boolean.TRUE,
Boolean.TRUE));
+ addTest(new FormGetRefreshIsNotPartialWindowTest("B", Boolean.TRUE,
Boolean.FALSE));
+ addTest(new FormGetRefreshIsNotPartialWindowTest("C", Boolean.TRUE,
null));
+ addTest(new FormGetRefreshIsNotPartialWindowTest("D", Boolean.FALSE,
Boolean.TRUE));
+ addTest(new FormGetRefreshIsNotPartialWindowTest("E", Boolean.FALSE,
Boolean.FALSE));
+ addTest(new FormGetRefreshIsNotPartialWindowTest("F", Boolean.FALSE,
null));
+ addTest(new FormGetRefreshIsNotPartialWindowTest("G", null,
Boolean.TRUE));
+ addTest(new FormGetRefreshIsNotPartialWindowTest("H", null,
Boolean.FALSE));
+ addTest(new FormGetRefreshIsNotPartialWindowTest("I", null, null));
}
catch (Exception e)
{
Deleted:
trunk/theme/src/main/org/jboss/portal/test/theme/dyna/tests/refresh/FormGetIsNotPartialWindowTest.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/test/theme/dyna/tests/refresh/FormGetIsNotPartialWindowTest.java 2007-04-22
16:37:29 UTC (rev 7020)
+++
trunk/theme/src/main/org/jboss/portal/test/theme/dyna/tests/refresh/FormGetIsNotPartialWindowTest.java 2007-04-22
17:39:33 UTC (rev 7021)
@@ -1,147 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * 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.jboss.portal.test.theme.dyna.tests.refresh;
-
-import org.jboss.portal.test.theme.DynaTest;
-import org.jboss.portal.test.theme.DynaTestContext;
-import org.jboss.portal.test.theme.RequestContext;
-import org.jboss.portal.test.theme.TestPhase;
-import org.jboss.portal.test.theme.ObjectURL;
-import org.jboss.portal.test.theme.model.PageObject;
-import org.jboss.portal.test.theme.model.RegionObject;
-import org.jboss.portal.test.theme.model.WindowObject;
-import org.jboss.portal.test.theme.model.RenderedObject;
-import org.jboss.portal.test.framework.driver.web.response.PerformClickResponse;
-import org.jboss.portal.theme.impl.render.dynamic.DynaRenderOptions;
-import org.jboss.portal.common.test.driver.DriverResponse;
-import org.jboss.portal.common.test.driver.response.EndTestResponse;
-import org.jboss.portal.common.util.MapBuilder;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class FormGetIsNotPartialWindowTest extends DynaTest
-{
-
- /** . */
- private DynaTestContext dynaTestContext;
-
- /** . */
- private final Boolean regionPartialRefresh;
-
- /** . */
- private final Boolean windowPartialRefresh;
-
- public FormGetIsNotPartialWindowTest(
- String id,
- Boolean regionPartialRefresh,
- Boolean windowPartialRefresh
- )
- {
- super(id);
-
- //
- this.regionPartialRefresh = regionPartialRefresh;
- this.windowPartialRefresh = windowPartialRefresh;
- }
-
- public void init(DynaTestContext dynaTestContext)
- {
- PageObject page = dynaTestContext.getPage();
-
- //
- RegionObject regionA = page.createRegion("RegionA");
- regionA.setRenderOptions(DynaRenderOptions.getOptions(null,
regionPartialRefresh));
-
- //
- WindowObject window0 = regionA.addWindow("0");
- window0.setRenderOptions(DynaRenderOptions.getOptions(null,
windowPartialRefresh));
-
- //
- this.dynaTestContext = dynaTestContext;
- }
-
- public DriverResponse invoke(RequestContext requestContext)
- {
- TestPhase phase = requestContext.getPhase();
- if (phase.getLifeCycle() == TestPhase.RENDER_LIFE_CYCLE)
- {
- switch(phase.getCount())
- {
- case 0:
- WindowObject window = dynaTestContext.getPage().getWindow("0");
- ObjectURL url = requestContext.createURL(window);
- String markup = "<form action=\"" + url + "\"
method=\"get\">" +
- "<input type=\"hidden\" name=\"foo\"
value=\"foo_value_1\">" +
- "<input id=\"link\"
type=\"submit\">" +
- "</form>";
- window.setMarkup(markup);
- return new PerformClickResponse("link");
- case 1:
- window = dynaTestContext.getPage().getWindow("0");
- url = requestContext.createURL(window);
- url.setParameter("bar", "bar_value_2");
- markup = "<form action=\"" + url + "\"
method=\"get\">" +
- "<input type=\"hidden\" name=\"foo\"
value=\"foo_value_2\">" +
- "<input id=\"link\"
type=\"submit\">" +
- "</form>";
- window.setMarkup(markup);
- return new PerformClickResponse("link");
- case 2:
- return new EndTestResponse();
- default:
- fail();
- }
- }
- else
- {
- switch(phase.getCount())
- {
- case 1:
- RenderedObject target = requestContext.getTarget();
- assertNotNull(target);
- assertTrue(target instanceof WindowObject);
- WindowObject window = (WindowObject)target;
- assertEquals("0", window.getId());
- assertEquals(false, requestContext.isAsync());
- assertEquals("foo_value_1",
requestContext.getParameterMap().get("foo"));
- return null;
- case 2:
- target = requestContext.getTarget();
- assertNotNull(target);
- assertTrue(target instanceof WindowObject);
- window = (WindowObject)target;
- assertEquals("0", window.getId());
- assertEquals(false, requestContext.isAsync());
- assertEquals("foo_value_2",
requestContext.getParameterMap().get("foo"));
- return null;
- default:
- fail();
- }
- }
-
- //
- return new EndTestResponse();
- }
-}
Copied:
trunk/theme/src/main/org/jboss/portal/test/theme/dyna/tests/refresh/FormGetRefreshIsNotPartialWindowTest.java
(from rev 7020,
trunk/theme/src/main/org/jboss/portal/test/theme/dyna/tests/refresh/FormGetIsNotPartialWindowTest.java)
===================================================================
---
trunk/theme/src/main/org/jboss/portal/test/theme/dyna/tests/refresh/FormGetRefreshIsNotPartialWindowTest.java
(rev 0)
+++
trunk/theme/src/main/org/jboss/portal/test/theme/dyna/tests/refresh/FormGetRefreshIsNotPartialWindowTest.java 2007-04-22
17:39:33 UTC (rev 7021)
@@ -0,0 +1,147 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.jboss.portal.test.theme.dyna.tests.refresh;
+
+import org.jboss.portal.test.theme.DynaTest;
+import org.jboss.portal.test.theme.DynaTestContext;
+import org.jboss.portal.test.theme.RequestContext;
+import org.jboss.portal.test.theme.TestPhase;
+import org.jboss.portal.test.theme.ObjectURL;
+import org.jboss.portal.test.theme.model.PageObject;
+import org.jboss.portal.test.theme.model.RegionObject;
+import org.jboss.portal.test.theme.model.WindowObject;
+import org.jboss.portal.test.theme.model.RenderedObject;
+import org.jboss.portal.test.framework.driver.web.response.PerformClickResponse;
+import org.jboss.portal.theme.impl.render.dynamic.DynaRenderOptions;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.util.MapBuilder;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class FormGetRefreshIsNotPartialWindowTest extends DynaTest
+{
+
+ /** . */
+ private DynaTestContext dynaTestContext;
+
+ /** . */
+ private final Boolean regionPartialRefresh;
+
+ /** . */
+ private final Boolean windowPartialRefresh;
+
+ public FormGetRefreshIsNotPartialWindowTest(
+ String id,
+ Boolean regionPartialRefresh,
+ Boolean windowPartialRefresh
+ )
+ {
+ super(id);
+
+ //
+ this.regionPartialRefresh = regionPartialRefresh;
+ this.windowPartialRefresh = windowPartialRefresh;
+ }
+
+ public void init(DynaTestContext dynaTestContext)
+ {
+ PageObject page = dynaTestContext.getPage();
+
+ //
+ RegionObject regionA = page.createRegion("RegionA");
+ regionA.setRenderOptions(DynaRenderOptions.getOptions(null,
regionPartialRefresh));
+
+ //
+ WindowObject window0 = regionA.addWindow("0");
+ window0.setRenderOptions(DynaRenderOptions.getOptions(null,
windowPartialRefresh));
+
+ //
+ this.dynaTestContext = dynaTestContext;
+ }
+
+ public DriverResponse invoke(RequestContext requestContext)
+ {
+ TestPhase phase = requestContext.getPhase();
+ if (phase.getLifeCycle() == TestPhase.RENDER_LIFE_CYCLE)
+ {
+ switch(phase.getCount())
+ {
+ case 0:
+ WindowObject window = dynaTestContext.getPage().getWindow("0");
+ ObjectURL url = requestContext.createURL(window);
+ String markup = "<form action=\"" + url + "\"
method=\"get\">" +
+ "<input type=\"hidden\" name=\"foo\"
value=\"foo_value_1\">" +
+ "<input id=\"link\"
type=\"submit\">" +
+ "</form>";
+ window.setMarkup(markup);
+ return new PerformClickResponse("link");
+ case 1:
+ window = dynaTestContext.getPage().getWindow("0");
+ url = requestContext.createURL(window);
+ url.setParameter("bar", "bar_value_2");
+ markup = "<form action=\"" + url + "\"
method=\"get\">" +
+ "<input type=\"hidden\" name=\"foo\"
value=\"foo_value_2\">" +
+ "<input id=\"link\"
type=\"submit\">" +
+ "</form>";
+ window.setMarkup(markup);
+ return new PerformClickResponse("link");
+ case 2:
+ return new EndTestResponse();
+ default:
+ fail();
+ }
+ }
+ else
+ {
+ switch(phase.getCount())
+ {
+ case 1:
+ RenderedObject target = requestContext.getTarget();
+ assertNotNull(target);
+ assertTrue(target instanceof WindowObject);
+ WindowObject window = (WindowObject)target;
+ assertEquals("0", window.getId());
+ assertEquals(false, requestContext.isAsync());
+ assertEquals("foo_value_1",
requestContext.getParameterMap().get("foo"));
+ return null;
+ case 2:
+ target = requestContext.getTarget();
+ assertNotNull(target);
+ assertTrue(target instanceof WindowObject);
+ window = (WindowObject)target;
+ assertEquals("0", window.getId());
+ assertEquals(false, requestContext.isAsync());
+ assertEquals("foo_value_2",
requestContext.getParameterMap().get("foo"));
+ return null;
+ default:
+ fail();
+ }
+ }
+
+ //
+ return new EndTestResponse();
+ }
+}