[portal-commits] JBoss Portal SVN: r11817 - in branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal: test/core/model/portal/coordination and 1 other directory.
portal-commits at lists.jboss.org
portal-commits at lists.jboss.org
Thu Sep 4 17:04:54 EDT 2008
Author: chris.laprun at jboss.com
Date: 2008-09-04 17:04:54 -0400 (Thu, 04 Sep 2008)
New Revision: 11817
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/coordination/CoordinationService.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/test/core/model/portal/coordination/CoordinationServiceTestCase.java
Log:
- Thought there was an issue with window checking. There isn't as evidenced by added test case.
Modified: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/coordination/CoordinationService.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/coordination/CoordinationService.java 2008-09-04 21:04:10 UTC (rev 11816)
+++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/coordination/CoordinationService.java 2008-09-04 21:04:54 UTC (rev 11817)
@@ -244,7 +244,8 @@
{
if (dw.contains(window))
{
- throw new IllegalCoordinationException("The same window cannot be source and destination of the same explicit wiring");
+ throw new IllegalCoordinationException("The same window '" + window.getName()
+ + "' cannot be source and destination of the same explicit wiring");
}
}
Modified: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/test/core/model/portal/coordination/CoordinationServiceTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/test/core/model/portal/coordination/CoordinationServiceTestCase.java 2008-09-04 21:04:10 UTC (rev 11816)
+++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/test/core/model/portal/coordination/CoordinationServiceTestCase.java 2008-09-04 21:04:54 UTC (rev 11817)
@@ -441,6 +441,34 @@
TransactionAssert.commitTransaction();
}
+ public void testEventWiringSameWindowInBothSourcesAndDestinations() throws IllegalCoordinationException
+ {
+ TransactionAssert.beginTransaction();
+
+ Portal portal1 = container.getContext("").getPortal("Portal_1");
+ Page page1 = portal1.getPage("Page_1");
+
+ Window w1 = page1.getWindow("Window_1");
+
+ Map<Window, QName> s1 = new HashMap<Window, QName>();
+ s1.put(w1, new QName("juju", "foo"));
+
+ Map<Window, QName> d1 = new HashMap<Window, QName>();
+ d1.put(page1.getWindow("Window_1"), new QName("bobo", "bar"));
+
+ try
+ {
+ cos.setEventWiring(s1, d1, "event1");
+ fail("Should have detected that Window_1 is in both sources and destinations!");
+ }
+ catch (IllegalCoordinationException e)
+ {
+ // expected
+ }
+
+ TransactionAssert.commitTransaction();
+ }
+
public void testRenameWindowBinding() throws Exception
{
TransactionAssert.beginTransaction();
More information about the portal-commits
mailing list