Author: pnedonosko
Date: 2009-10-26 12:27:16 -0400 (Mon, 26 Oct 2009)
New Revision: 402
Added:
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jbosscache/
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jbosscache/JBossCacheServiceTest.java
Modified:
jcr/branches/1.12.0-JBC/component/core/pom.xml
jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/exojcr-jboss-cache-conf.xml
Log:
EXOJCR-200: jboss cache service test
Modified: jcr/branches/1.12.0-JBC/component/core/pom.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/pom.xml 2009-10-26 16:26:48 UTC (rev 401)
+++ jcr/branches/1.12.0-JBC/component/core/pom.xml 2009-10-26 16:27:16 UTC (rev 402)
@@ -562,6 +562,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
+ <forkMode>${exo.test.forkMode}</forkMode>
<phase>test</phase>
<goals>
<goal>test</goal>
@@ -575,7 +576,8 @@
<includes>
<include>**/**/TestErrorMultithreading__.java</include>
<include>**/**/TestConcurrentItems__.java</include>
- <include>**/**/TestInvalidItemState__.java</include>
+
+ <include>**/**/JBossCacheServiceTest.java</include>
</includes>
</configuration>
</plugin>
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/exojcr-jboss-cache-conf.xml
===================================================================
---
jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/exojcr-jboss-cache-conf.xml 2009-10-26
16:26:48 UTC (rev 401)
+++
jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/exojcr-jboss-cache-conf.xml 2009-10-26
16:27:16 UTC (rev 402)
@@ -1,30 +1,10 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- This is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-
--->
+<?xml version="1.0" encoding="UTF-8"?>
<jbosscache
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="urn:jboss:jbosscache-core:config:3.1">
+ xmlns="urn:jboss:jbosscache-core:config:3.1">
- <!-- Configure the TransactionManager -->
- <transaction
- transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"
/>
+ <!-- Configure the TransactionManager -->
+ <transaction
+
transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"
/>
<clustering mode="replication">
@@ -71,15 +51,34 @@
<!-- <async /> -->
</clustering>
- <loaders passivation="false" shared="true">
- <loader class="org.jboss.cache.loader.FileCacheLoader"
async="false"
- fetchPersistentState="true" ignoreModifications="false"
- purgeOnStartup="false">
- <properties>
- location=/tmp/test-jboss-cache/proxy
- </properties>
- </loader>
- </loaders>
+ <loaders passivation="false" shared="false">
+ <loader class="org.jboss.cache.loader.FileCacheLoader"
async="false"
+ fetchPersistentState="true" ignoreModifications="false"
+ purgeOnStartup="false">
+ <properties>
+ location=/tmp/test-jboss-cache/proxy
+ </properties>
+ </loader>
+
+ <!-- loader class="org.jboss.cache.loader.JDBCCacheLoader"
async="false" fetchPersistentState="true"
+ ignoreModifications="false" purgeOnStartup="false">
+ <properties>
+ cache.jdbc.table.name=jdbcjcr
+ cache.jdbc.table.create=true
+ cache.jdbc.table.drop=true
+ cache.jdbc.table.primarykey=exojcr_pk
+ cache.jdbc.fqn.column=fqn
+ cache.jdbc.fqn.type=VARCHAR(512)
+ cache.jdbc.node.column=node
+ cache.jdbc.node.type=BLOB
+ cache.jdbc.parent.column=parent
+ cache.jdbc.driver=org.hsqldb.jdbcDriver
+ cache.jdbc.url=jdbc:hsqldb:file:target/temp/data/exojcr
+ cache.jdbc.user=sa
+ cache.jdbc.password=
+ </properties>
+ </loader -->
+ </loaders>
<!-- Enable batching -->
<invocationBatching enabled="true"/>
Added:
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jbosscache/JBossCacheServiceTest.java
===================================================================
---
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jbosscache/JBossCacheServiceTest.java
(rev 0)
+++
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jbosscache/JBossCacheServiceTest.java 2009-10-26
16:27:16 UTC (rev 402)
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.exoplatform.services.jbosscache;
+
+import junit.framework.TestCase;
+
+import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.container.xml.ValueParam;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * <br/>Date: 26.10.2009
+ *
+ * @author <a href="mailto:peter.nedonosko@exoplatform.com.ua">Peter
Nedonosko</a>
+ * @version $Id: JBossCacheServiceTest.java 111 2008-11-11 11:11:11Z pnedonosko $
+ */
+public class JBossCacheServiceTest extends TestCase
+{
+
+ private InitParams params;
+
+ /**
+ * {@inheritDoc}
+ */
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+
+ params = new InitParams();
+ params.addParam(new ValueParam()
+ {
+
+ @Override
+ public String getValue()
+ {
+ return "target/classes/conf/portal/exojcr-jboss-cache-conf.xml";
+ }
+
+ @Override
+ public String getDescription()
+ {
+ return "JBossCache config path";
+ }
+
+ @Override
+ public String getName()
+ {
+ return "jboss-cache-configuration";
+ }
+ });
+ }
+
+ public void testJBossCacheService()
+ {
+ JBossCacheService jbcService = new JBossCacheService(params);
+
+ assertNotNull(jbcService.getCache());
+
+ assertEquals("replication",
jbcService.getCache().getConfiguration().getClusterName());
+ }
+
+}
Property changes on:
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jbosscache/JBossCacheServiceTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain