Author: julien_viet
Date: 2011-08-31 17:46:45 -0400 (Wed, 31 Aug 2011)
New Revision: 7267
Added:
portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/AbstractAPITestCase.java
Modified:
portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/portal/NavigationTestCase.java
Log:
abstract unit test
Added:
portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/AbstractAPITestCase.java
===================================================================
---
portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/AbstractAPITestCase.java
(rev 0)
+++
portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/AbstractAPITestCase.java 2011-08-31
21:46:45 UTC (rev 7267)
@@ -0,0 +1,57 @@
+package org.gatein.portal.api.impl;
+
+import org.exoplatform.container.PortalContainer;
+import org.exoplatform.portal.AbstractPortalTest;
+import org.exoplatform.portal.mop.navigation.NavigationService;
+import org.exoplatform.portal.pom.config.POMSessionManager;
+import org.exoplatform.portal.pom.data.ModelDataStorage;
+import org.exoplatform.web.application.RequestContext;
+import org.gatein.api.GateIn;
+
+/** @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a> */
+public class AbstractAPITestCase extends AbstractPortalTest
+{
+
+ /** . */
+ protected POMSessionManager mgr;
+
+ /** . */
+ protected NavigationService navService;
+
+ /** . */
+ protected ModelDataStorage storage;
+
+ /** . */
+ protected GateIn gatein;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+
+ //
+ PortalContainer container = getContainer();
+ POMSessionManager mgr =
(POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
+ NavigationService navService =
(NavigationService)container.getComponentInstanceOfType(NavigationService.class);
+ GateInImpl gatein = new GateInImpl(container.getContext(), null, null, null);
+
+ //
+ gatein.start();
+
+ // Clear the cache for each test
+ // navService.clearCache();
+
+ //
+ this.gatein = gatein;
+ this.mgr = mgr;
+ this.navService = navService;
+ this.storage =
(ModelDataStorage)container.getComponentInstanceOfType(ModelDataStorage.class);
+
+ //
+ begin();
+
+ //
+ RequestContext.setCurrentInstance(new SimpleRequestContext(null));
+ }
+
+}
Modified:
portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/portal/NavigationTestCase.java
===================================================================
---
portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/portal/NavigationTestCase.java 2011-08-31
19:22:42 UTC (rev 7266)
+++
portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/portal/NavigationTestCase.java 2011-08-31
21:46:45 UTC (rev 7267)
@@ -22,6 +22,7 @@
import org.gatein.api.portal.Navigation;
import org.gatein.api.portal.Page;
import org.gatein.api.portal.Site;
+import org.gatein.portal.api.impl.AbstractAPITestCase;
import org.gatein.portal.api.impl.GateInImpl;
import org.gatein.portal.api.impl.SimpleRequestContext;
@@ -34,51 +35,9 @@
@ConfigurationUnit(scope = ContainerScope.PORTAL, path =
"conf/exo.portal.component.identity-configuration.xml"),
@ConfigurationUnit(scope = ContainerScope.PORTAL, path =
"conf/exo.portal.component.portal-configuration.xml")
})
-public class NavigationTestCase extends AbstractPortalTest
+public class NavigationTestCase extends AbstractAPITestCase
{
- /** . */
- protected POMSessionManager mgr;
-
- /** . */
- protected NavigationService navService;
-
- /** . */
- protected ModelDataStorage storage;
-
- /** . */
- protected GateIn gatein;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- //
- PortalContainer container = getContainer();
- POMSessionManager mgr =
(POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
- NavigationService navService =
(NavigationService)container.getComponentInstanceOfType(NavigationService.class);
- GateInImpl gatein = new GateInImpl(container.getContext(), null, null, null);
-
- //
- gatein.start();
-
- // Clear the cache for each test
- // navService.clearCache();
-
- //
- this.gatein = gatein;
- this.mgr = mgr;
- this.navService = navService;
- this.storage =
(ModelDataStorage)container.getComponentInstanceOfType(ModelDataStorage.class);
-
- //
- begin();
-
- //
- RequestContext.setCurrentInstance(new SimpleRequestContext(null));
- }
-
private NodeContext createSite(SiteType type, String name)
{
try