You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2006/02/13 10:36:27 UTC

svn commit: r377327 - in /lenya/trunk/src/modules: jcr/java/src/org/apache/lenya/cms/jcr/JCRSession.java repository/java/test/org/apache/lenya/cms/repo/ContentTest.java

Author: andreas
Date: Mon Feb 13 01:36:25 2006
New Revision: 377327

URL: http://svn.apache.org/viewcvs?rev=377327&view=rev
Log:
Fixed bug -> throw exception when publication already exists, added corresponding test

Modified:
    lenya/trunk/src/modules/jcr/java/src/org/apache/lenya/cms/jcr/JCRSession.java
    lenya/trunk/src/modules/repository/java/test/org/apache/lenya/cms/repo/ContentTest.java

Modified: lenya/trunk/src/modules/jcr/java/src/org/apache/lenya/cms/jcr/JCRSession.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/modules/jcr/java/src/org/apache/lenya/cms/jcr/JCRSession.java?rev=377327&r1=377326&r2=377327&view=diff
==============================================================================
--- lenya/trunk/src/modules/jcr/java/src/org/apache/lenya/cms/jcr/JCRSession.java (original)
+++ lenya/trunk/src/modules/jcr/java/src/org/apache/lenya/cms/jcr/JCRSession.java Mon Feb 13 01:36:25 2006
@@ -169,7 +169,7 @@
     public Publication addPublication(String id)
             throws org.apache.lenya.cms.repo.RepositoryException {
         initPublications();
-        if (this.publications.keySet().contains("id")) {
+        if (this.publications.keySet().contains(id)) {
             throw new org.apache.lenya.cms.repo.RepositoryException("The publication [" + id
                     + "]ĂŠalready exists.");
         } else {

Modified: lenya/trunk/src/modules/repository/java/test/org/apache/lenya/cms/repo/ContentTest.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/modules/repository/java/test/org/apache/lenya/cms/repo/ContentTest.java?rev=377327&r1=377326&r2=377327&view=diff
==============================================================================
--- lenya/trunk/src/modules/repository/java/test/org/apache/lenya/cms/repo/ContentTest.java (original)
+++ lenya/trunk/src/modules/repository/java/test/org/apache/lenya/cms/repo/ContentTest.java Mon Feb 13 01:36:25 2006
@@ -39,6 +39,14 @@
         Publication pub = session.addPublication(PUBLICATION_ID);
         assertSame(pub, session.getPublication(PUBLICATION_ID));
 
+        Exception ex = null;
+        try {
+            pub = session.addPublication(PUBLICATION_ID);
+        } catch (Exception e) {
+            ex = e;
+        }
+        assertNotNull(ex);
+
         doTestMetaData(pub);
 
         assertFalse(pub.existsArea(AREA_ID));



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org