Author: julien_viet
Date: 2011-09-01 10:51:53 -0400 (Thu, 01 Sep 2011)
New Revision: 7278
Modified:
portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/content/ContentRegistryTestCase.java
portal/branches/api/component/api-impl/src/test/resources/org/gatein/portal/api/impl/configuration.xml
Log:
improve unit test for content
Modified:
portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/content/ContentRegistryTestCase.java
===================================================================
---
portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/content/ContentRegistryTestCase.java 2011-09-01
14:42:08 UTC (rev 7277)
+++
portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/content/ContentRegistryTestCase.java 2011-09-01
14:51:53 UTC (rev 7278)
@@ -1,6 +1,7 @@
package org.gatein.portal.api.impl.content;
import org.exoplatform.portal.mop.SiteType;
+import org.gatein.api.content.Category;
import org.gatein.api.content.ContentRegistry;
import org.gatein.portal.api.impl.AbstractAPITestCase;
@@ -11,14 +12,24 @@
public class ContentRegistryTestCase extends AbstractAPITestCase
{
- public void testFoo()
+ public void testCategory()
{
createSite(SiteType.PORTAL, "classic");
//
ContentRegistry registry = gatein.getDefaultPortal().getContentRegistry();
+
+ //
Set<String> names = registry.getCategoryNames();
assertEquals(Collections.singleton("administration"), names);
+
+ //
+ Category administration = registry.getCategory("administration");
+ assertNotNull(administration);
+ assertEquals("administration", administration.getName());
+ assertEquals("Administration", administration.getDisplayName());
+ assertEquals("Application for administration",
administration.getDescription());
+ Category.Id id = administration.getId();
+ assertEquals("administration", id.getName());
}
-
}
Modified:
portal/branches/api/component/api-impl/src/test/resources/org/gatein/portal/api/impl/configuration.xml
===================================================================
---
portal/branches/api/component/api-impl/src/test/resources/org/gatein/portal/api/impl/configuration.xml 2011-09-01
14:42:08 UTC (rev 7277)
+++
portal/branches/api/component/api-impl/src/test/resources/org/gatein/portal/api/impl/configuration.xml 2011-09-01
14:51:53 UTC (rev 7278)
@@ -41,10 +41,10 @@
<string>administration</string>
</field>
<field name="displayName">
- <string>administration</string>
+ <string>Administration</string>
</field>
<field name="description">
- <string>application for administration</string>
+ <string>Application for administration</string>
</field>
<field name="accessPermissions">
<collection type="java.util.ArrayList"
item-type="java.lang.String">
Show replies by date