Author: thomas.heute(a)jboss.com
Date: 2008-01-15 09:39:35 -0500 (Tue, 15 Jan 2008)
New Revision: 9512
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java
Log:
Adding a test case that *will* fail.
I know it passes on HSQLDB, i know it fails on MySQL, i'm curious about the other
databases.
I will commit a fix soon after the results (or comment it out if the commit takes longer
than expected)
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java 2008-01-15
14:38:23 UTC (rev 9511)
+++
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java 2008-01-15
14:39:35 UTC (rev 9512)
@@ -114,6 +114,46 @@
TransactionAssert.commitTransaction();
}
+ public void testRegisterObjectWithSameName() throws Exception
+ {
+ TransactionAssert.beginTransaction();
+ PortalContainer ctx = container.getContext();
+ Portal n1 = ctx.createPortal("default");
+ Page n2 = n1.createPage("default");
+ boolean duplicate = false;
+ try
+ {
+ Page n3 = n1.createPage("default");
+ }
+ catch (DuplicatePortalObjectException e)
+ {
+ duplicate = true;
+ }
+ assertTrue(duplicate);
+
+ TransactionAssert.commitTransaction();
+ }
+
+ public void testRegisterObjectWithSameNameCaseInsensitive() throws Exception
+ {
+ TransactionAssert.beginTransaction();
+ PortalContainer ctx = container.getContext();
+ Portal n1 = ctx.createPortal("default");
+ Page n2 = n1.createPage("default");
+ boolean duplicate = true;
+ try
+ {
+ Page n3 = n1.createPage("dEfAuLt");
+ }
+ catch (DuplicatePortalObjectException e)
+ {
+ duplicate = false;
+ }
+ assertTrue(duplicate);
+
+ TransactionAssert.commitTransaction();
+ }
+
public void testPropertyUpdateDoesNotCascadeToDescendantsWhenTheyDeclareIt() throws
Exception
{
TransactionAssert.beginTransaction();
Show replies by date