Author: sergiykarpenko
Date: 2010-09-16 11:35:06 -0400 (Thu, 16 Sep 2010)
New Revision: 3126
Added:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/util/
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/util/jdbc/
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/util/jdbc/TestDBCleanerService.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/util/TesterConfigurationHelper.java
Removed:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/util/ConfigurationHelper.java
Modified:
jcr/trunk/exo.jcr.component.core/pom.xml
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestRepositoryManagement.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestWorkspaceManagement.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestWorkspaceRestore.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/ValueStoragePluginTest.java
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration-sjdbc.xml
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration.xml
Log:
EXOJCR-939: DBCleanerService test added
Modified: jcr/trunk/exo.jcr.component.core/pom.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/pom.xml 2010-09-16 15:32:57 UTC (rev 3125)
+++ jcr/trunk/exo.jcr.component.core/pom.xml 2010-09-16 15:35:06 UTC (rev 3126)
@@ -1,795 +1,797 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.exoplatform.jcr</groupId>
- <artifactId>jcr-parent</artifactId>
- <version>1.14.0-CR1-SNAPSHOT</version>
- </parent>
- <artifactId>exo.jcr.component.core</artifactId>
- <name>eXo JCR :: Component :: Core Service</name>
- <description>eXo JCR Service core component</description>
- <properties>
-
<jcr.test.configuration.file>/conf/standalone/test-configuration.xml</jcr.test.configuration.file>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.exoplatform.jcr</groupId>
+ <artifactId>jcr-parent</artifactId>
+ <version>1.14.0-CR1-SNAPSHOT</version>
+ </parent>
+ <artifactId>exo.jcr.component.core</artifactId>
+ <name>eXo JCR :: Component :: Core Service</name>
+ <description>eXo JCR Service core component</description>
+ <properties>
+
<jcr.test.configuration.file>/conf/standalone/test-configuration.xml</jcr.test.configuration.file>
<jbosscache.shareable>true</jbosscache.shareable>
- </properties>
- <dependencies>
- <dependency>
- <groupId>javax.jcr</groupId>
- <artifactId>jcr</artifactId>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.container</artifactId>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.commons</artifactId>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.commons.test</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.component.command</artifactId>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.component.common</artifactId>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.component.cache</artifactId>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.core</groupId>
- <artifactId>exo.core.component.organization.api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.core</groupId>
- <artifactId>exo.core.component.document</artifactId>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.core</groupId>
- <artifactId>exo.core.component.security.core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.ws</groupId>
- <artifactId>exo.ws.commons</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.jcr</groupId>
- <artifactId>exo.jcr.cluster.testclient</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.lucene</groupId>
- <artifactId>lucene-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.lucene</groupId>
- <artifactId>lucene-spellchecker</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.lucene</groupId>
- <artifactId>lucene-memory</artifactId>
- </dependency>
- <dependency>
- <groupId>com.sun.xml.stream</groupId>
- <artifactId>sjsxp</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-dbcp</groupId>
- <artifactId>commons-dbcp</artifactId>
- <exclusions>
- <exclusion>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>commons-pool</groupId>
- <artifactId>commons-pool</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-chain</groupId>
- <artifactId>commons-chain</artifactId>
- </dependency>
- <dependency>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jibx</groupId>
- <artifactId>jibx-run</artifactId>
- </dependency>
- <dependency>
- <groupId>picocontainer</groupId>
- <artifactId>picocontainer</artifactId>
- </dependency>
- <dependency>
- <groupId>javax.resource</groupId>
- <artifactId>connector-api</artifactId>
- </dependency>
- <dependency>
- <groupId>javax.transaction</groupId>
- <artifactId>jta</artifactId>
- </dependency>
- <dependency>
- <groupId>concurrent</groupId>
- <artifactId>concurrent</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-beanutils</groupId>
- <artifactId>commons-beanutils</artifactId>
- </dependency>
- <dependency>
- <groupId>jgroups</groupId>
- <artifactId>jgroups</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </dependency>
- <dependency>
- <groupId>javax.xml.stream</groupId>
- <artifactId>stax-api</artifactId>
- </dependency>
- <dependency>
- <groupId>xpp3</groupId>
- <artifactId>xpp3</artifactId>
- </dependency>
- <dependency>
- <groupId>jboss.jbossts</groupId>
- <artifactId>jbossjts</artifactId>
- </dependency>
- <dependency>
- <groupId>jboss.jbossts</groupId>
- <artifactId>jbossts-common</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.ws.commons</groupId>
- <artifactId>ws-commons-util</artifactId>
- <exclusions>
- <exclusion>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</artifactId>
- </exclusion>
- <exclusion>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <!-- TCK binaries and deps for repo stub, some eXo API test -->
- <dependency>
- <groupId>org.jboss.cache</groupId>
- <artifactId>jbosscache-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.jackrabbit</groupId>
- <artifactId>jackrabbit-jcr-tests</artifactId>
- <classifier>sources</classifier>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <scope>test</scope>
- </dependency>
- <!-- ===== Databases JDBC support for tests ===== -->
- <dependency>
- <groupId>hsqldb</groupId>
- <artifactId>hsqldb</artifactId>
- <scope>test</scope>
- </dependency>
- <!-- For MySQL support -->
- <dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <version>5.1.8</version>
- <scope>test</scope>
- </dependency>
- <!-- For PostgresSQL support -->
- <dependency>
- <groupId>postgresql</groupId>
- <artifactId>postgresql</artifactId>
- <version>8.3-603.jdbc3</version>
- <scope>test</scope>
- </dependency>
- <!-- For Oracle 10g support (local-jcr repository) -->
- <!-- dependency>
- <groupId>ojdbc</groupId>
- <artifactId>ojdbc</artifactId>
- <version>14</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>ojdbc</groupId>
- <artifactId>orai18n</artifactId>
- <version>14</version>
- <scope>test</scope>
- </dependency -->
- <!-- For IBM DB2 support (local-jcr repository) -->
- <!-- dependency>
- <groupId>com.ibm.db2</groupId>
- <artifactId>db2jcc</artifactId>
- <version>9.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.ibm.db2</groupId>
- <artifactId>db2jcc_license_cu</artifactId>
- <version>9.1</version>
- <scope>test</scope>
- </dependency -->
- <!-- For MS SQL 7/2000/2005 and Sybase ASE/Anywhere support (jTDS driver)
-->
- <!-- dependency>
- <groupId>net.sourceforge.jtds</groupId>
- <artifactId>jtds</artifactId>
- <version>1.2</version>
- <scope>test</scope>
- </dependency -->
- <!-- For MS SQL 2005 support (Microsoft JDBC driver) (local-jcr repository)
-->
- <!-- dependency>
- <groupId>com.microsoft.sqlserver</groupId>
- <artifactId>sqljdbc</artifactId>
- <version>9.0</version>
- <scope>test</scope>
- </dependency -->
- <!-- dependency>
- <groupId>com.microsoft</groupId>
- <artifactId>sqljdbc</artifactId>
- <version>2.0</version>
- <scope>test</scope>
- </dependency -->
- <!-- For Apache Derby support (aka JavaDB) -->
- <!-- dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>derby</artifactId>
- <version>10.2.2.0</version>
- <scope>test</scope>
- </dependency -->
- <!-- H2 Database (not supported now) -->
- <!-- dependency>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
- <version>1.2.132</version>
- </dependency-->
- <!-- Ingres Database (local repository) -->
- <!-- dependency>
- <groupId>com.ingres.jdbc</groupId>
- <artifactId>iijdbc</artifactId>
- <version>9.2</version>
- <scope>test</scope>
- </dependency -->
- <!-- For Sybase ASE/Anywhere support (jConnect driver) (local-jcr repository)
-->
- <!-- dependency>
- <groupId>com.sybase.jdbc3.jdbc</groupId>
- <artifactId>jconn3</artifactId>
- <version>6.05</version>
- <scope>test</scope>
- </dependency -->
- </dependencies>
- <!-- ======================================================================= -->
- <build>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <includes>
- <include>**/*.xml</include>
- <include>**/*.sql</include>
- <include>**/*.dtd</include>
- </includes>
- </resource>
- </resources>
- <testResources>
- <testResource>
- <directory>src/test/resources</directory>
- <includes>
- <include>**/*.properties</include>
- <include>login.conf</include>
- <include>**/*.xml</include>
- <include>**/*.drl</include>
- <include>**/*.vm</include>
- <include>**/*.doc</include>
- <include>**/*.xls</include>
- <include>**/*.ppt</include>
- <include>**/*.txt</include>
- <include>**/*.tiff</include>
- <include>**/*.pdf</include>
- <include>**/*.dtd</include>
- <include>**/*.policy</include>
- </includes>
- </testResource>
- </testResources>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack</id>
- <phase>generate-test-sources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.jackrabbit</groupId>
- <artifactId>jackrabbit-jcr-tests</artifactId>
- <classifier>sources</classifier>
- <type>jar</type>
- <overWrite>false</overWrite>
- </artifactItem>
- </artifactItems>
-
<outputDirectory>${project.build.testSourceDirectory}</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <argLine>${env.MAVEN_OPTS}
-Djava.security.manager=org.exoplatform.commons.test.TestSecurityManager
-Djava.security.policy=${project.build.directory}/test-classes/test.policy</argLine>
- <systemProperties>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>javax.jcr</groupId>
+ <artifactId>jcr</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.container</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.commons</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.commons.test</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.command</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.cache</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.core</groupId>
+ <artifactId>exo.core.component.organization.api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.core</groupId>
+ <artifactId>exo.core.component.document</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.core</groupId>
+ <artifactId>exo.core.component.security.core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.ws</groupId>
+ <artifactId>exo.ws.commons</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.jcr</groupId>
+ <artifactId>exo.jcr.cluster.testclient</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.lucene</groupId>
+ <artifactId>lucene-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.lucene</groupId>
+ <artifactId>lucene-spellchecker</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.lucene</groupId>
+ <artifactId>lucene-memory</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.stream</groupId>
+ <artifactId>sjsxp</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-dbcp</groupId>
+ <artifactId>commons-dbcp</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>commons-pool</groupId>
+ <artifactId>commons-pool</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-chain</groupId>
+ <artifactId>commons-chain</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>stax</groupId>
+ <artifactId>stax-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jibx</groupId>
+ <artifactId>jibx-run</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>picocontainer</groupId>
+ <artifactId>picocontainer</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.resource</groupId>
+ <artifactId>connector-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>concurrent</groupId>
+ <artifactId>concurrent</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>jgroups</groupId>
+ <artifactId>jgroups</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.xml.stream</groupId>
+ <artifactId>stax-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>xpp3</groupId>
+ <artifactId>xpp3</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>jboss.jbossts</groupId>
+ <artifactId>jbossjts</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>jboss.jbossts</groupId>
+ <artifactId>jbossts-common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ws.commons</groupId>
+ <artifactId>ws-commons-util</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <!-- TCK binaries and deps for repo stub, some eXo API test -->
+ <dependency>
+ <groupId>org.jboss.cache</groupId>
+ <artifactId>jbosscache-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.jackrabbit</groupId>
+ <artifactId>jackrabbit-jcr-tests</artifactId>
+ <classifier>sources</classifier>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <!-- ===== Databases JDBC support for tests ===== -->
+ <dependency>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <!-- For MySQL support -->
+ <dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-java</artifactId>
+ <version>5.1.8</version>
+ <scope>test</scope>
+ </dependency>
+ <!-- For PostgresSQL support -->
+ <dependency>
+ <groupId>postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ <version>8.3-603.jdbc3</version>
+ <scope>test</scope>
+ </dependency>
+ <!-- For Oracle 10g support (local-jcr repository) -->
+ <!-- dependency>
+ <groupId>ojdbc</groupId>
+ <artifactId>ojdbc</artifactId>
+ <version>14</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>ojdbc</groupId>
+ <artifactId>orai18n</artifactId>
+ <version>14</version>
+ <scope>test</scope>
+ </dependency -->
+ <!-- For IBM DB2 support (local-jcr repository) -->
+ <!-- dependency>
+ <groupId>com.ibm.db2</groupId>
+ <artifactId>db2jcc</artifactId>
+ <version>9.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.ibm.db2</groupId>
+ <artifactId>db2jcc_license_cu</artifactId>
+ <version>9.1</version>
+ <scope>test</scope>
+ </dependency -->
+ <!-- For MS SQL 7/2000/2005 and Sybase ASE/Anywhere support (jTDS driver)
-->
+ <!-- dependency>
+ <groupId>net.sourceforge.jtds</groupId>
+ <artifactId>jtds</artifactId>
+ <version>1.2</version>
+ <scope>test</scope>
+ </dependency -->
+ <!-- For MS SQL 2005 support (Microsoft JDBC driver) (local-jcr repository)
-->
+ <!-- dependency>
+ <groupId>com.microsoft.sqlserver</groupId>
+ <artifactId>sqljdbc</artifactId>
+ <version>9.0</version>
+ <scope>test</scope>
+ </dependency -->
+ <!-- dependency>
+ <groupId>com.microsoft</groupId>
+ <artifactId>sqljdbc</artifactId>
+ <version>2.0</version>
+ <scope>test</scope>
+ </dependency -->
+ <!-- For Apache Derby support (aka JavaDB) -->
+ <!-- dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>10.2.2.0</version>
+ <scope>test</scope>
+ </dependency -->
+ <!-- H2 Database (not supported now) -->
+ <!-- dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ <version>1.2.132</version>
+ </dependency-->
+ <!-- Ingres Database (local repository) -->
+ <!-- dependency>
+ <groupId>com.ingres.jdbc</groupId>
+ <artifactId>iijdbc</artifactId>
+ <version>9.2</version>
+ <scope>test</scope>
+ </dependency -->
+ <!-- For Sybase ASE/Anywhere support (jConnect driver) (local-jcr repository)
-->
+ <!-- dependency>
+ <groupId>com.sybase.jdbc3.jdbc</groupId>
+ <artifactId>jconn3</artifactId>
+ <version>6.05</version>
+ <scope>test</scope>
+ </dependency -->
+ </dependencies>
+ <!-- ======================================================================= -->
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <includes>
+ <include>**/*.xml</include>
+ <include>**/*.sql</include>
+ <include>**/*.dtd</include>
+ </includes>
+ </resource>
+ </resources>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ <includes>
+ <include>**/*.properties</include>
+ <include>login.conf</include>
+ <include>**/*.xml</include>
+ <include>**/*.drl</include>
+ <include>**/*.vm</include>
+ <include>**/*.doc</include>
+ <include>**/*.xls</include>
+ <include>**/*.ppt</include>
+ <include>**/*.txt</include>
+ <include>**/*.tiff</include>
+ <include>**/*.pdf</include>
+ <include>**/*.dtd</include>
+ <include>**/*.policy</include>
+ </includes>
+ </testResource>
+ </testResources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack</id>
+ <phase>generate-test-sources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.apache.jackrabbit</groupId>
+ <artifactId>jackrabbit-jcr-tests</artifactId>
+ <classifier>sources</classifier>
+ <type>jar</type>
+ <overWrite>false</overWrite>
+ </artifactItem>
+ </artifactItems>
+
<outputDirectory>${project.build.testSourceDirectory}</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <argLine>${env.MAVEN_OPTS}
-Djava.security.manager=org.exoplatform.commons.test.TestSecurityManager
-Djava.security.policy=${project.build.directory}/test-classes/test.policy</argLine>
+ <systemProperties>
+ <property>
+ <name>jcr.test.configuration.file</name>
+ <value>${jcr.test.configuration.file}</value>
+ </property>
+ <property>
+ <name>emma.coverage.out.file</name>
+ <value>target/emma/coverage.ec</value>
+ </property>
<property>
- <name>jcr.test.configuration.file</name>
- <value>${jcr.test.configuration.file}</value>
- </property>
- <property>
- <name>emma.coverage.out.file</name>
- <value>target/emma/coverage.ec</value>
- </property>
- <property>
<name>jbosscache-shareable</name>
<value>${jbosscache.shareable}</value>
</property>
- <!-- Uncomment the line below if you want to enable the statistics -->
- <!--property>
- <name>JDBCWorkspaceDataContainer.statistics.enabled</name>
- <value>true</value>
- </property-->
- </systemProperties>
- <includes>
-
<include>org/exoplatform/services/jcr/api/**/Test*.java</include>
-
<include>org/exoplatform/services/jcr/usecases/**/Test*.java</include>
-
<include>org/exoplatform/services/jcr/usecases/**/*Test.java</include>
-
<include>org/exoplatform/services/jcr/impl/**/Test*.java</include>
- </includes>
- <excludes>
-
<exclude>org/exoplatform/services/jcr/**/TestQueryUsecases.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/TestRollbackBigFiles.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/TestErrorMultithreading.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/api/TestAll.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/api/**/TestSameNameItems.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/api/**/TestVersionRestore.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/api/**/TestSameNameItems.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/api/**/TestVersionRestore.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/impl/**/TestWorkspaceManagement.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/impl/**/TestRepositoryManagement.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/impl/**/TestSaveConfiguration.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/impl/**/ValueStoragePluginTest.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/impl/**/TestWorkspaceRestore.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/impl/**/TestSessionCleaner.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/impl/**/Base*.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/impl/**/TestJCRSerializationStream.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/impl/**/TestJCRSerializationVersionRestore.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/usecases/**/RemoveSameNameSiblingTest.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/usecases/**/TestQueryWithNumberAndSpace.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/usecases/BaseUsecasesTest.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/usecases/**/ExportWorkspaceSystemViewTest.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/impl/**/TestSessionDataManager.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/impl/**/TestLinkedWorkspaceStorageCacheMetrics.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/impl/**/SQLBenchmarkTest.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/impl/**/TestLockPerstistentDataManager.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/impl/**/TestCleanableFileStreamValueData.java</exclude>
- </excludes>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.jibx</groupId>
- <artifactId>maven-jibx-plugin</artifactId>
- <configuration>
- <directory>src/main/resources</directory>
- <includes>
- <includes>binding*.xml</includes>
- </includes>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>bind</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>delete-sources</id>
- <phase>process-sources</phase>
- <configuration>
- <tasks>
- <echo>Remove files that have been customized</echo>
- <delete>
- <fileset
dir="${project.build.directory}/generated-sources/javacc/org/exoplatform/services/jcr/impl/core/query">
- <include name="sql/ASTLiteral.java" />
- <include name="sql/ASTContainsExpression.java"
/>
- <include name="sql/ASTPredicate.java" />
- <include name="sql/ASTIdentifier.java" />
- <include name="xpath/SimpleNode.java" />
- </fileset>
- </delete>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- <execution>
- <id>prepare-test-policy</id>
- <phase>process-test-resources</phase>
- <configuration>
- <tasks>
- <echo>Creating Access Policy for tests</echo>
- <makeurl file="${settings.localRepository}"
property="localRepositoryURL" />
- <makeurl file="${project.build.outputDirectory}"
property="outputDirectoryURL" />
- <makeurl file="${project.build.testOutputDirectory}"
property="testOutputDirectoryURL" />
- <copy todir="${project.build.testOutputDirectory}"
overwrite="true">
- <fileset
dir="${project.basedir}/src/test/resources/">
- <include name="test.policy" />
- </fileset>
- <filterset>
- <filter token="MAVEN_REPO"
value="${localRepositoryURL}" />
- <filter token="MAIN_CLASSES"
value="${outputDirectoryURL}" />
- <filter token="TEST_CLASSES"
value="${testOutputDirectoryURL}" />
- </filterset>
- </copy>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>ant</groupId>
- <artifactId>ant-optional</artifactId>
- <version>1.5.3-1</version>
- </dependency>
- </dependencies>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>javacc-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>fulltext</id>
- <configuration>
-
<sourceDirectory>${basedir}/src/main/javacc/fulltext</sourceDirectory>
- </configuration>
- <goals>
- <goal>jjtree-javacc</goal>
- </goals>
- </execution>
- <execution>
- <id>sql</id>
- <configuration>
-
<sourceDirectory>${basedir}/src/main/javacc/sql</sourceDirectory>
- </configuration>
- <goals>
- <goal>jjtree-javacc</goal>
- </goals>
- </execution>
- <execution>
- <id>xpath</id>
- <configuration>
-
<sourceDirectory>${basedir}/src/main/javacc/xpath</sourceDirectory>
- </configuration>
- <goals>
- <goal>jjtree-javacc</goal>
- </goals>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>net.java.dev.javacc</groupId>
- <artifactId>javacc</artifactId>
- <version>3.2</version>
- </dependency>
- </dependencies>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>taglist-maven-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
- <profiles>
- <!-- *** -->
- <!-- TCK -->
- <!-- *** -->
- <!-- Use "mvn -Prun-tck" to launch only them -->
- <profile>
- <id>run-tck</id>
- <build>
- <testResources>
- <testResource>
- <directory>src/TCK/java</directory>
- <includes>
-
<include>**/org/apache/jackrabbit/test/api/nodetype/spec/*.txt</include>
- </includes>
- </testResource>
- </testResources>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <!-- TAKE CARE TO UPDATE ALSO run-all PROFILE -->
- <argLine>${env.MAVEN_OPTS}
-Djava.security.manager=org.exoplatform.commons.test.TestSecurityManager
-Djava.security.policy=${project.build.directory}/test-classes/test.policy</argLine>
- <systemProperties>
- <property>
- <name>jcr.test.configuration.file</name>
- <value>${jcr.test.configuration.file}</value>
- </property>
- <property>
- <name>emma.coverage.out.file</name>
- <value>target/emma/coverage.ec</value>
- </property>
- <property>
+ <!-- Uncomment the line below if you want to enable the statistics -->
+ <!--property>
+ <name>JDBCWorkspaceDataContainer.statistics.enabled</name>
+ <value>true</value>
+ </property-->
+ </systemProperties>
+ <includes>
+
<include>org/exoplatform/services/jcr/api/**/Test*.java</include>
+
<include>org/exoplatform/services/jcr/usecases/**/Test*.java</include>
+
<include>org/exoplatform/services/jcr/usecases/**/*Test.java</include>
+
<include>org/exoplatform/services/jcr/impl/**/Test*.java</include>
+ </includes>
+ <excludes>
+
<exclude>org/exoplatform/services/jcr/**/TestQueryUsecases.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/TestRollbackBigFiles.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/TestErrorMultithreading.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/api/TestAll.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/api/**/TestSameNameItems.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/api/**/TestVersionRestore.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/api/**/TestSameNameItems.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/api/**/TestVersionRestore.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/impl/**/TestWorkspaceManagement.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/impl/**/TestRepositoryManagement.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/impl/**/TestDBCleanerService.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/impl/**/TestSaveConfiguration.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/impl/**/ValueStoragePluginTest.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/impl/**/TestWorkspaceRestore.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/impl/**/TestSessionCleaner.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/impl/**/Base*.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/impl/**/TestJCRSerializationStream.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/impl/**/TestJCRSerializationVersionRestore.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/usecases/**/RemoveSameNameSiblingTest.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/usecases/**/TestQueryWithNumberAndSpace.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/usecases/BaseUsecasesTest.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/usecases/**/ExportWorkspaceSystemViewTest.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/impl/**/TestSessionDataManager.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/impl/**/TestLinkedWorkspaceStorageCacheMetrics.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/impl/**/SQLBenchmarkTest.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/impl/**/TestLockPerstistentDataManager.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/impl/**/TestCleanableFileStreamValueData.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.jibx</groupId>
+ <artifactId>maven-jibx-plugin</artifactId>
+ <configuration>
+ <directory>src/main/resources</directory>
+ <includes>
+ <includes>binding*.xml</includes>
+ </includes>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>bind</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>delete-sources</id>
+ <phase>process-sources</phase>
+ <configuration>
+ <tasks>
+ <echo>Remove files that have been customized</echo>
+ <delete>
+ <fileset
dir="${project.build.directory}/generated-sources/javacc/org/exoplatform/services/jcr/impl/core/query">
+ <include name="sql/ASTLiteral.java" />
+ <include name="sql/ASTContainsExpression.java"
/>
+ <include name="sql/ASTPredicate.java" />
+ <include name="sql/ASTIdentifier.java" />
+ <include name="xpath/SimpleNode.java" />
+ </fileset>
+ </delete>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>prepare-test-policy</id>
+ <phase>process-test-resources</phase>
+ <configuration>
+ <tasks>
+ <echo>Creating Access Policy for tests</echo>
+ <makeurl file="${settings.localRepository}"
property="localRepositoryURL" />
+ <makeurl file="${project.build.outputDirectory}"
property="outputDirectoryURL" />
+ <makeurl file="${project.build.testOutputDirectory}"
property="testOutputDirectoryURL" />
+ <copy todir="${project.build.testOutputDirectory}"
overwrite="true">
+ <fileset
dir="${project.basedir}/src/test/resources/">
+ <include name="test.policy" />
+ </fileset>
+ <filterset>
+ <filter token="MAVEN_REPO"
value="${localRepositoryURL}" />
+ <filter token="MAIN_CLASSES"
value="${outputDirectoryURL}" />
+ <filter token="TEST_CLASSES"
value="${testOutputDirectoryURL}" />
+ </filterset>
+ </copy>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>ant</groupId>
+ <artifactId>ant-optional</artifactId>
+ <version>1.5.3-1</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>javacc-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>fulltext</id>
+ <configuration>
+
<sourceDirectory>${basedir}/src/main/javacc/fulltext</sourceDirectory>
+ </configuration>
+ <goals>
+ <goal>jjtree-javacc</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>sql</id>
+ <configuration>
+
<sourceDirectory>${basedir}/src/main/javacc/sql</sourceDirectory>
+ </configuration>
+ <goals>
+ <goal>jjtree-javacc</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>xpath</id>
+ <configuration>
+
<sourceDirectory>${basedir}/src/main/javacc/xpath</sourceDirectory>
+ </configuration>
+ <goals>
+ <goal>jjtree-javacc</goal>
+ </goals>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>net.java.dev.javacc</groupId>
+ <artifactId>javacc</artifactId>
+ <version>3.2</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>taglist-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+ <profiles>
+ <!-- *** -->
+ <!-- TCK -->
+ <!-- *** -->
+ <!-- Use "mvn -Prun-tck" to launch only them -->
+ <profile>
+ <id>run-tck</id>
+ <build>
+ <testResources>
+ <testResource>
+ <directory>src/TCK/java</directory>
+ <includes>
+
<include>**/org/apache/jackrabbit/test/api/nodetype/spec/*.txt</include>
+ </includes>
+ </testResource>
+ </testResources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <!-- TAKE CARE TO UPDATE ALSO run-all PROFILE -->
+ <argLine>${env.MAVEN_OPTS}
-Djava.security.manager=org.exoplatform.commons.test.TestSecurityManager
-Djava.security.policy=${project.build.directory}/test-classes/test.policy</argLine>
+ <systemProperties>
+ <property>
+ <name>jcr.test.configuration.file</name>
+ <value>${jcr.test.configuration.file}</value>
+ </property>
+ <property>
+ <name>emma.coverage.out.file</name>
+ <value>target/emma/coverage.ec</value>
+ </property>
+ <property>
<name>jbosscache-shareable</name>
<value>${jbosscache.shareable}</value>
</property>
<property>
- <name>known.issues</name>
-
<value>org.apache.jackrabbit.test.api.SetValueConstraintViolationExceptionTest#testBooleanProperty
-
org.apache.jackrabbit.test.api.SetValueConstraintViolationExceptionTest#testMultipleBooleanProperty
-
org.apache.jackrabbit.test.api.version.RestoreTest#testRestoreName
-
org.apache.jackrabbit.test.api.version.RestoreTest#testRestoreOrder
-
org.apache.jackrabbit.test.api.version.RestoreTest#testRestoreOrder2
-
org.apache.jackrabbit.test.api.nodetype.PropertyDefTest#testIsRequiredType
-
org.apache.jackrabbit.test.api.SetPropertyConstraintViolationExceptionTest#testBooleanProperty
-
org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testShareable
-
org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testSimpleVersionable
-
org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testActivity
-
org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testConfiguration
-
org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testVersionable
-
org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testVersion
-
org.apache.jackrabbit.test.api.NamespaceRegistryTest#testRegisterNamespace</value>
- </property>
- <!-- Uncomment the line below if you want to enable the
statistics -->
- <!--property>
-
<name>JDBCWorkspaceDataContainer.statistics.enabled</name>
- <value>true</value>
- </property-->
- </systemProperties>
- <includes>
-
<include>org/apache/jackrabbit/test/api/*Test.java</include>
-
<include>org/apache/jackrabbit/test/api/observation/*Test.java</include>
-
<include>org/apache/jackrabbit/test/api/lock/*Test.java</include>
-
<include>org/apache/jackrabbit/test/api/nodetype/*Test.java</include>
-
<include>org/apache/jackrabbit/test/api/query/*Test.java</include>
-
<include>org/apache/jackrabbit/test/api/version/*Test.java</include>
- </includes>
- <excludes>
-
<exclude>org/apache/jackrabbit/test/api/TestAll.java</exclude>
-
<exclude>org/apache/jackrabbit/test/api/**/Abstract*.java</exclude>
-
<exclude>org/apache/jackrabbit/test/api/**/FrozenNodeTest.java</exclude>
-
<exclude>org/exoplatform/services/jcr/impl/core/security/Test*.java</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- <!-- *** -->
- <!-- ALL -->
- <!-- *** -->
- <!-- Use "mvn -Prun-all" to launch default tests and TCK -->
- <profile>
- <id>run-all</id>
- <build>
- <testResources>
- <testResource>
- <directory>src/TCK/java</directory>
- <includes>
-
<include>**/org/apache/jackrabbit/test/api/nodetype/spec/*.txt</include>
- </includes>
- </testResource>
- </testResources>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <!-- TAKE CARE TO UPDATE ALSO run-tck PROFILE -->
- <argLine>${env.MAVEN_OPTS}
-Djava.security.manager=org.exoplatform.commons.test.TestSecurityManager
-Djava.security.policy=${project.build.directory}/test-classes/test.policy</argLine>
- <systemProperties>
- <property>
- <name>jcr.test.configuration.file</name>
- <value>${jcr.test.configuration.file}</value>
- </property>
- <property>
- <name>emma.coverage.out.file</name>
- <value>target/emma/coverage.ec</value>
- </property>
- <property>
+ <name>known.issues</name>
+
<value>org.apache.jackrabbit.test.api.SetValueConstraintViolationExceptionTest#testBooleanProperty
+
org.apache.jackrabbit.test.api.SetValueConstraintViolationExceptionTest#testMultipleBooleanProperty
+
org.apache.jackrabbit.test.api.version.RestoreTest#testRestoreName
+
org.apache.jackrabbit.test.api.version.RestoreTest#testRestoreOrder
+
org.apache.jackrabbit.test.api.version.RestoreTest#testRestoreOrder2
+
org.apache.jackrabbit.test.api.nodetype.PropertyDefTest#testIsRequiredType
+
org.apache.jackrabbit.test.api.SetPropertyConstraintViolationExceptionTest#testBooleanProperty
+
org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testShareable
+
org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testSimpleVersionable
+
org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testActivity
+
org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testConfiguration
+
org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testVersionable
+
org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testVersion
+
org.apache.jackrabbit.test.api.NamespaceRegistryTest#testRegisterNamespace</value>
+ </property>
+ <!-- Uncomment the line below if you want to enable the
statistics -->
+ <!--property>
+
<name>JDBCWorkspaceDataContainer.statistics.enabled</name>
+ <value>true</value>
+ </property-->
+ </systemProperties>
+ <includes>
+
<include>org/apache/jackrabbit/test/api/*Test.java</include>
+
<include>org/apache/jackrabbit/test/api/observation/*Test.java</include>
+
<include>org/apache/jackrabbit/test/api/lock/*Test.java</include>
+
<include>org/apache/jackrabbit/test/api/nodetype/*Test.java</include>
+
<include>org/apache/jackrabbit/test/api/query/*Test.java</include>
+
<include>org/apache/jackrabbit/test/api/version/*Test.java</include>
+ </includes>
+ <excludes>
+
<exclude>org/apache/jackrabbit/test/api/TestAll.java</exclude>
+
<exclude>org/apache/jackrabbit/test/api/**/Abstract*.java</exclude>
+
<exclude>org/apache/jackrabbit/test/api/**/FrozenNodeTest.java</exclude>
+
<exclude>org/exoplatform/services/jcr/impl/core/security/Test*.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <!-- *** -->
+ <!-- ALL -->
+ <!-- *** -->
+ <!-- Use "mvn -Prun-all" to launch default tests and TCK -->
+ <profile>
+ <id>run-all</id>
+ <build>
+ <testResources>
+ <testResource>
+ <directory>src/TCK/java</directory>
+ <includes>
+
<include>**/org/apache/jackrabbit/test/api/nodetype/spec/*.txt</include>
+ </includes>
+ </testResource>
+ </testResources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <!-- TAKE CARE TO UPDATE ALSO run-tck PROFILE -->
+ <argLine>${env.MAVEN_OPTS}
-Djava.security.manager=org.exoplatform.commons.test.TestSecurityManager
-Djava.security.policy=${project.build.directory}/test-classes/test.policy</argLine>
+ <systemProperties>
+ <property>
+ <name>jcr.test.configuration.file</name>
+ <value>${jcr.test.configuration.file}</value>
+ </property>
+ <property>
+ <name>emma.coverage.out.file</name>
+ <value>target/emma/coverage.ec</value>
+ </property>
+ <property>
<name>jbosscache-shareable</name>
<value>${jbosscache.shareable}</value>
</property>
<property>
- <name>known.issues</name>
-
<value>org.apache.jackrabbit.test.api.SetValueConstraintViolationExceptionTest#testBooleanProperty
-
org.apache.jackrabbit.test.api.SetValueConstraintViolationExceptionTest#testMultipleBooleanProperty
-
org.apache.jackrabbit.test.api.version.RestoreTest#testRestoreName
-
org.apache.jackrabbit.test.api.version.RestoreTest#testRestoreOrder
-
org.apache.jackrabbit.test.api.version.RestoreTest#testRestoreOrder2
-
org.apache.jackrabbit.test.api.nodetype.PropertyDefTest#testIsRequiredType
-
org.apache.jackrabbit.test.api.SetPropertyConstraintViolationExceptionTest#testBooleanProperty
-
org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testShareable
-
org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testSimpleVersionable
-
org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testActivity
-
org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testConfiguration
-
org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testVersionable
-
org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testVersion
-
org.apache.jackrabbit.test.api.NamespaceRegistryTest#testRegisterNamespace</value>
- </property>
- <!-- Uncomment the line below if you want to enable the
statistics -->
- <!--property>
-
<name>JDBCWorkspaceDataContainer.statistics.enabled</name>
- <value>true</value>
- </property-->
- </systemProperties>
- <includes>
- <!-- From default tests -->
-
<include>org/exoplatform/services/jcr/api/**/Test*.java</include>
-
<include>org/exoplatform/services/jcr/usecases/**/Test*.java</include>
-
<include>org/exoplatform/services/jcr/usecases/**/*Test.java</include>
-
<include>org/exoplatform/services/jcr/impl/**/Test*.java</include>
- <!-- From TCK -->
-
<include>org/apache/jackrabbit/test/api/*Test.java</include>
-
<include>org/apache/jackrabbit/test/api/observation/*Test.java</include>
-
<include>org/apache/jackrabbit/test/api/lock/*Test.java</include>
-
<include>org/apache/jackrabbit/test/api/nodetype/*Test.java</include>
-
<include>org/apache/jackrabbit/test/api/query/*Test.java</include>
-
<include>org/apache/jackrabbit/test/api/version/*Test.java</include>
- </includes>
- <excludes>
- <!-- From default tests -->
-
<exclude>org/exoplatform/services/jcr/**/TestQueryUsecases.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/TestImport.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/TestRollbackBigFiles.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/TestErrorMultithreading.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/api/TestAll.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/api/**/TestSameNameItems.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/api/**/TestVersionRestore.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/api/**/TestSameNameItems.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/api/**/TestVersionRestore.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/impl/**/TestWorkspaceManagement.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/impl/**/TestRepositoryManagement.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/impl/**/TestSaveConfiguration.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/impl/**/ValueStoragePluginTest.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/impl/**/TestWorkspaceRestore.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/impl/**/TestSessionCleaner.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/impl/**/Base*.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/impl/**/TestJCRSerializationStream.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/impl/**/TestJCRSerializationVersionRestore.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/usecases/**/RemoveSameNameSiblingTest.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/usecases/**/TestQueryWithNumberAndSpace.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/usecases/BaseUsecasesTest.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/usecases/**/ExportWorkspaceSystemViewTest.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/impl/**/TestSessionDataManager.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/impl/**/TestLinkedWorkspaceStorageCacheMetrics.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/impl/**/SQLBenchmarkTest.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/impl/**/TestCleanableFileStreamValueData.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/impl/**/TestLockPerstistentDataManager.java</exclude>
- <!-- From TCK -->
-
<exclude>org/apache/jackrabbit/test/api/TestAll.java</exclude>
-
<exclude>org/apache/jackrabbit/test/api/**/Abstract*.java</exclude>
-
<exclude>org/apache/jackrabbit/test/api/**/FrozenNodeTest.java</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <id>run-devtests</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <phase>test</phase>
- <forkMode>never</forkMode>
- <!-- argLine>${env.MAVEN_OPTS}</argLine -->
- <goals>
- <goal>test</goal>
- </goals>
- <systemProperties>
+ <name>known.issues</name>
+
<value>org.apache.jackrabbit.test.api.SetValueConstraintViolationExceptionTest#testBooleanProperty
+
org.apache.jackrabbit.test.api.SetValueConstraintViolationExceptionTest#testMultipleBooleanProperty
+
org.apache.jackrabbit.test.api.version.RestoreTest#testRestoreName
+
org.apache.jackrabbit.test.api.version.RestoreTest#testRestoreOrder
+
org.apache.jackrabbit.test.api.version.RestoreTest#testRestoreOrder2
+
org.apache.jackrabbit.test.api.nodetype.PropertyDefTest#testIsRequiredType
+
org.apache.jackrabbit.test.api.SetPropertyConstraintViolationExceptionTest#testBooleanProperty
+
org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testShareable
+
org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testSimpleVersionable
+
org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testActivity
+
org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testConfiguration
+
org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testVersionable
+
org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testVersion
+
org.apache.jackrabbit.test.api.NamespaceRegistryTest#testRegisterNamespace</value>
+ </property>
+ <!-- Uncomment the line below if you want to enable the
statistics -->
+ <!--property>
+
<name>JDBCWorkspaceDataContainer.statistics.enabled</name>
+ <value>true</value>
+ </property-->
+ </systemProperties>
+ <includes>
+ <!-- From default tests -->
+
<include>org/exoplatform/services/jcr/api/**/Test*.java</include>
+
<include>org/exoplatform/services/jcr/usecases/**/Test*.java</include>
+
<include>org/exoplatform/services/jcr/usecases/**/*Test.java</include>
+
<include>org/exoplatform/services/jcr/impl/**/Test*.java</include>
+ <!-- From TCK -->
+
<include>org/apache/jackrabbit/test/api/*Test.java</include>
+
<include>org/apache/jackrabbit/test/api/observation/*Test.java</include>
+
<include>org/apache/jackrabbit/test/api/lock/*Test.java</include>
+
<include>org/apache/jackrabbit/test/api/nodetype/*Test.java</include>
+
<include>org/apache/jackrabbit/test/api/query/*Test.java</include>
+
<include>org/apache/jackrabbit/test/api/version/*Test.java</include>
+ </includes>
+ <excludes>
+ <!-- From default tests -->
+
<exclude>org/exoplatform/services/jcr/**/TestQueryUsecases.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/TestImport.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/TestRollbackBigFiles.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/TestErrorMultithreading.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/api/TestAll.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/api/**/TestSameNameItems.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/api/**/TestVersionRestore.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/api/**/TestSameNameItems.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/api/**/TestVersionRestore.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/impl/**/TestWorkspaceManagement.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/impl/**/TestRepositoryManagement.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/impl/**/TestDBCleanerService.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/impl/**/TestSaveConfiguration.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/impl/**/ValueStoragePluginTest.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/impl/**/TestWorkspaceRestore.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/impl/**/TestSessionCleaner.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/impl/**/Base*.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/impl/**/TestJCRSerializationStream.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/impl/**/TestJCRSerializationVersionRestore.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/usecases/**/RemoveSameNameSiblingTest.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/usecases/**/TestQueryWithNumberAndSpace.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/usecases/BaseUsecasesTest.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/usecases/**/ExportWorkspaceSystemViewTest.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/impl/**/TestSessionDataManager.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/impl/**/TestLinkedWorkspaceStorageCacheMetrics.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/impl/**/SQLBenchmarkTest.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/impl/**/TestCleanableFileStreamValueData.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/impl/**/TestLockPerstistentDataManager.java</exclude>
+ <!-- From TCK -->
+
<exclude>org/apache/jackrabbit/test/api/TestAll.java</exclude>
+
<exclude>org/apache/jackrabbit/test/api/**/Abstract*.java</exclude>
+
<exclude>org/apache/jackrabbit/test/api/**/FrozenNodeTest.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>run-devtests</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <phase>test</phase>
+ <forkMode>never</forkMode>
+ <!-- argLine>${env.MAVEN_OPTS}</argLine -->
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <systemProperties>
+ <property>
+ <name>jcr.test.configuration.file</name>
+ <value>${jcr.test.configuration.file}</value>
+ </property>
<property>
- <name>jcr.test.configuration.file</name>
- <value>${jcr.test.configuration.file}</value>
- </property>
- <property>
<name>jbosscache-shareable</name>
<value>${jbosscache.shareable}</value>
</property>
- <!-- Uncomment the line below if you want to enable the
statistics -->
- <!--property>
-
<name>JDBCWorkspaceDataContainer.statistics.enabled</name>
- <value>true</value>
- </property-->
- </systemProperties>
- <includes>
- <include>**/**/reading_/Test*.java</include>
- <include>**/**/writing_/Test*.java</include>
-
<include>**/**/TestJBossCacheWorkspaceStorageCache_.java</include>
-
<exclude>**/**/TestCleanableFileStreamValueData.java</exclude>
-
<include>**/**/TestSVNodeDataOptimization_.java</include>
- <include>**/**/TestValueConstraints.java</include>
- </includes>
- <excludes>
-
<exclude>org/exoplatform/services/jcr/impl/core/security/Test*.java</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-</project>
+ <!-- Uncomment the line below if you want to enable the
statistics -->
+ <!--property>
+
<name>JDBCWorkspaceDataContainer.statistics.enabled</name>
+ <value>true</value>
+ </property-->
+ </systemProperties>
+ <includes>
+ <include>**/**/reading_/Test*.java</include>
+ <include>**/**/writing_/Test*.java</include>
+
<include>**/**/TestJBossCacheWorkspaceStorageCache_.java</include>
+
<exclude>**/**/TestCleanableFileStreamValueData.java</exclude>
+
<include>**/**/TestSVNodeDataOptimization_.java</include>
+ <include>**/**/TestValueConstraints.java</include>
+ </includes>
+ <excludes>
+
<exclude>org/exoplatform/services/jcr/impl/core/security/Test*.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestRepositoryManagement.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestRepositoryManagement.java 2010-09-16
15:32:57 UTC (rev 3125)
+++
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestRepositoryManagement.java 2010-09-16
15:35:06 UTC (rev 3126)
@@ -24,7 +24,7 @@
import org.exoplatform.services.jcr.config.RepositoryEntry;
import org.exoplatform.services.jcr.config.WorkspaceEntry;
import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer;
-import org.exoplatform.services.jcr.util.ConfigurationHelper;
+import org.exoplatform.services.jcr.util.TesterConfigurationHelper;
import org.exoplatform.services.jcr.util.IdGenerator;
import javax.jcr.NamespaceException;
@@ -51,12 +51,12 @@
private boolean isDefaultWsMultiDb;
- private final ConfigurationHelper helper;
+ private final TesterConfigurationHelper helper;
public TestRepositoryManagement()
{
super();
- this.helper = ConfigurationHelper.getInstence();
+ this.helper = TesterConfigurationHelper.getInstence();
}
// TODO remove this method
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestWorkspaceManagement.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestWorkspaceManagement.java 2010-09-16
15:32:57 UTC (rev 3125)
+++
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestWorkspaceManagement.java 2010-09-16
15:35:06 UTC (rev 3126)
@@ -25,7 +25,7 @@
import org.exoplatform.services.jcr.config.RepositoryEntry;
import org.exoplatform.services.jcr.config.WorkspaceEntry;
import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer;
-import org.exoplatform.services.jcr.util.ConfigurationHelper;
+import org.exoplatform.services.jcr.util.TesterConfigurationHelper;
import org.exoplatform.services.jcr.util.IdGenerator;
import java.io.File;
@@ -43,14 +43,14 @@
{
private boolean isDefaultWsMultiDb = false;
- private final ConfigurationHelper helper;
+ private final TesterConfigurationHelper helper;
private WorkspaceEntry wsEntry;
public TestWorkspaceManagement()
{
super();
- this.helper = ConfigurationHelper.getInstence();
+ this.helper = TesterConfigurationHelper.getInstence();
}
@Override
@@ -290,7 +290,58 @@
fail();
}
}
+ }
+ catch (RepositoryException e)
+ {
+ e.printStackTrace();
+ fail(e.getLocalizedMessage());
+ }
+ catch (RepositoryConfigurationException e)
+ {
+ fail(e.getLocalizedMessage());
+ }
+ if (defRep != null)
+ {
+ try
+ {
+ Session sess = defRep.getSystemSession(workspaceEntry.getName());
+ fail();
+ }
+ catch (RepositoryException e)
+ {
+ // Ok
+ }
+ }
+ }
+
+ public void testRemoveWorkspaceFromDB() throws Exception
+ {
+ WorkspaceEntry workspaceEntry =
+ helper.getNewWs("wsForRemove", isDefaultWsMultiDb,
wsEntry.getContainer().getParameterValue(
+ JDBCWorkspaceDataContainer.SOURCE_NAME), "target/temp/values/" +
IdGenerator.generate(), wsEntry
+ .getContainer());
+
+ RepositoryService service =
(RepositoryService)container.getComponentInstanceOfType(RepositoryService.class);
+ RepositoryImpl defRep = (RepositoryImpl)service.getDefaultRepository();
+ try
+ {
+ helper.createWorkspace(workspaceEntry, container);
+ doTestOnWorkspace(workspaceEntry.getName());
+ assertTrue(defRep.canRemoveWorkspace(workspaceEntry.getName()));
+ String[] names = service.getDefaultRepository().getWorkspaceNames();
+ service.getDefaultRepository().removeWorkspace(workspaceEntry.getName());
+ String[] namesAfter = service.getDefaultRepository().getWorkspaceNames();
+
+ // remove one
+ assertTrue(names.length == namesAfter.length + 1);
+ for (int i = 0; i < namesAfter.length; i++)
+ {
+ if (workspaceEntry.getName().equals(namesAfter[i]))
+ {
+ fail();
+ }
+ }
}
catch (RepositoryException e)
{
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestWorkspaceRestore.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestWorkspaceRestore.java 2010-09-16
15:32:57 UTC (rev 3125)
+++
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestWorkspaceRestore.java 2010-09-16
15:35:06 UTC (rev 3126)
@@ -23,7 +23,7 @@
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
import org.exoplatform.services.jcr.config.WorkspaceEntry;
import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer;
-import org.exoplatform.services.jcr.util.ConfigurationHelper;
+import org.exoplatform.services.jcr.util.TesterConfigurationHelper;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
@@ -52,7 +52,7 @@
private final Log log =
ExoLogger.getLogger("exo.jcr.component.core.TestWorkspaceRestore");
- private final ConfigurationHelper helper = ConfigurationHelper.getInstence();
+ private final TesterConfigurationHelper helper =
TesterConfigurationHelper.getInstence();
private WorkspaceEntry wsEntry;
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/ValueStoragePluginTest.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/ValueStoragePluginTest.java 2010-09-16
15:32:57 UTC (rev 3125)
+++
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/ValueStoragePluginTest.java 2010-09-16
15:35:06 UTC (rev 3126)
@@ -25,7 +25,7 @@
import org.exoplatform.services.jcr.config.WorkspaceEntry;
import org.exoplatform.services.jcr.impl.core.RepositoryImpl;
import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer;
-import org.exoplatform.services.jcr.util.ConfigurationHelper;
+import org.exoplatform.services.jcr.util.TesterConfigurationHelper;
import org.exoplatform.services.jcr.util.IdGenerator;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
@@ -205,7 +205,7 @@
private String createWs() throws Exception
{
- ConfigurationHelper helper = ConfigurationHelper.getInstence();
+ TesterConfigurationHelper helper = TesterConfigurationHelper.getInstence();
WorkspaceEntry wsEntry =
(WorkspaceEntry)session.getContainer().getComponentInstanceOfType(WorkspaceEntry.class);
boolean isDefaultWsMultiDb = false;
if
("true".equals(wsEntry.getContainer().getParameterValue("multi-db")))
Added:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/util/jdbc/TestDBCleanerService.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/util/jdbc/TestDBCleanerService.java
(rev 0)
+++
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/util/jdbc/TestDBCleanerService.java 2010-09-16
15:35:06 UTC (rev 3126)
@@ -0,0 +1,369 @@
+/*
+ * Copyright (C) 2003-2010 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.services.jcr.impl.util.jdbc;
+
+import org.exoplatform.services.jcr.JcrImplBaseTest;
+import org.exoplatform.services.jcr.RepositoryService;
+import org.exoplatform.services.jcr.config.RepositoryEntry;
+import org.exoplatform.services.jcr.config.WorkspaceEntry;
+import org.exoplatform.services.jcr.impl.core.NodeImpl;
+import org.exoplatform.services.jcr.impl.core.RepositoryImpl;
+import org.exoplatform.services.jcr.impl.core.SessionImpl;
+import org.exoplatform.services.jcr.util.IdGenerator;
+import org.exoplatform.services.jcr.util.TesterConfigurationHelper;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+
+import javax.jcr.Node;
+import javax.jcr.Session;
+import javax.naming.InitialContext;
+import javax.sql.DataSource;
+
+/**
+ * This test uses "testdbcleaner" datasource to create own test repository with
workspace.
+ * So, please, check test-configuration.xml or test-configuration-sjdbc.xml does such
datasource binded.
+ *
+ * Created by The eXo Platform SAS.
+ *
+ * <br/>Date:
+ *
+ * @author <a href="karpenko.sergiy(a)gmail.com">Karpenko Sergiy</a>
+ * @version $Id: TestRemoveWorkspace.java 111 2008-11-11 11:11:11Z serg $
+ */
+public class TestDBCleanerService extends JcrImplBaseTest
+{
+ private final static String DS_NAME = "testdbcleaner";
+
+ private final TesterConfigurationHelper helper;
+
+ private WorkspaceEntry wsEntry;
+
+ public TestDBCleanerService()
+ {
+ super();
+ this.helper = TesterConfigurationHelper.getInstence();
+ }
+
+ @SuppressWarnings("deprecation")
+ @Override
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ wsEntry =
(WorkspaceEntry)session.getContainer().getComponentInstanceOfType(WorkspaceEntry.class);
+ }
+
+ public void tearDown() throws Exception
+ {
+ // drop any table
+ DataSource ds = (DataSource)new InitialContext().lookup(DS_NAME);
+ Connection conn = ds.getConnection();
+ Statement statement = conn.createStatement();
+ try
+ {
+ statement.executeUpdate("drop table JCR_SREF");
+ }
+ catch (SQLException e)
+ {
+ }
+ try
+ {
+ statement.executeUpdate("drop table JCR_SVALUE");
+ }
+ catch (SQLException e)
+ {
+ }
+ try
+ {
+ statement.executeUpdate("drop table JCR_SITEM");
+ }
+ catch (SQLException e)
+ {
+ }
+ try
+ {
+ statement.executeUpdate("drop table JCR_MREF");
+ }
+ catch (SQLException e)
+ {
+ }
+ try
+ {
+ statement.executeUpdate("drop table JCR_MVALUE");
+ }
+ catch (SQLException e)
+ {
+ }
+ try
+ {
+ statement.executeUpdate("drop table JCR_MITEM");
+ }
+ catch (SQLException e)
+ {
+ }
+ try
+ {
+ statement.executeUpdate("drop table JCR_MCONTAINER");
+ }
+ catch (SQLException e)
+ {
+ }
+ try
+ {
+ statement.executeUpdate("drop table JCR_SCONTAINER");
+ }
+ catch (SQLException e)
+ {
+ }
+ if (statement != null)
+ {
+ try
+ {
+ statement.close();
+ }
+ catch (SQLException e)
+ {
+ }
+ }
+ super.tearDown();
+ }
+
+ public void testRemoveRepositoryMultiDB() throws Exception
+ {
+ String repositoryName = "repoTestRemoveMulti";
+
+ RepositoryEntry repositoryEntry = createMultiDB(repositoryName);
+
+ RepositoryService service =
(RepositoryService)container.getComponentInstanceOfType(RepositoryService.class);
+ RepositoryImpl newRepository =
(RepositoryImpl)service.getRepository(repositoryName);
+ assertTrue(service.canRemoveRepository(repositoryName));
+
+ String wsName = repositoryEntry.getWorkspaceEntries().get(0).getName();
+ SessionImpl sess = newRepository.getSystemSession(wsName);
+
+ // add nodes to workspaces and check it via datasource
+ NodeImpl node = (NodeImpl)sess.getRootNode().addNode("testNode");
+ String id = node.getData().getIdentifier();
+ sess.save();
+ sess.logout();
+
+ DataSource ds = (DataSource)new InitialContext().lookup(DS_NAME);
+ Connection conn = ds.getConnection();
+ Statement statement = conn.createStatement();
+ ResultSet res = statement.executeQuery("select * from JCR_MITEM where
ID='" + id + "'");
+ assertTrue(res.next());
+
+ // remove repository;
+ DBCleanerService.removeRepositoryData(repositoryEntry);
+
+ // check - does JCR_SITEM become empty
+ try
+ {
+ res = statement.executeQuery("select * from JCR_MITEM where ID='"
+ id + "'");
+ fail();
+ }
+ catch (SQLException e)
+ {
+ //ok
+ }
+ statement.close();
+
+ service.removeRepository(repositoryName);
+ }
+
+ public void testRemoveRepositorySingleDB() throws Exception
+ {
+ String repositoryName = "repoTestRemoveSingle";
+
+ RepositoryEntry repositoryEntry = createSingleDB(repositoryName);
+
+ RepositoryService service =
(RepositoryService)container.getComponentInstanceOfType(RepositoryService.class);
+ RepositoryImpl newRepository =
(RepositoryImpl)service.getRepository(repositoryName);
+ assertTrue(service.canRemoveRepository(repositoryName));
+
+ String wsName = repositoryEntry.getWorkspaceEntries().get(0).getName();
+ SessionImpl sess = newRepository.getSystemSession(wsName);
+
+ // now add nodes to workspaces and check it via datasource
+ NodeImpl node = (NodeImpl)sess.getRootNode().addNode("testNode");
+ String id = node.getData().getIdentifier();
+ sess.save();
+ sess.logout();
+
+ DataSource ds = (DataSource)new InitialContext().lookup(DS_NAME);
+ Connection conn = ds.getConnection();
+ Statement statement = conn.createStatement();
+ ResultSet res = statement.executeQuery("select * from JCR_SITEM where
ID='" + wsName + id + "'");
+ assertTrue(res.next());
+
+ // remove repository content
+ DBCleanerService.removeRepositoryData(repositoryEntry);
+
+ // check - does JCR_SITEM become empty
+ res = statement.executeQuery("select * from JCR_SITEM where ID='" +
wsName + id + "'");
+ assertFalse(res.next());
+ statement.close();
+
+ service.removeRepository(repositoryName);
+ }
+
+ public void testRemoveWorkspaceMultiDB() throws Exception
+ {
+ String repositoryName = "repoTestRemoveMulti";
+
+ RepositoryEntry repositoryEntry = createMultiDB(repositoryName);
+
+ RepositoryService service =
(RepositoryService)container.getComponentInstanceOfType(RepositoryService.class);
+ RepositoryImpl newRepository =
(RepositoryImpl)service.getRepository(repositoryName);
+ assertTrue(service.canRemoveRepository(repositoryName));
+
+ String wsName = repositoryEntry.getWorkspaceEntries().get(0).getName();
+ SessionImpl sess = newRepository.getSystemSession(wsName);
+
+ // now add nodes to workspaces and check it via datasource
+ NodeImpl node = (NodeImpl)sess.getRootNode().addNode("testNode");
+ String id = node.getData().getIdentifier();
+ sess.save();
+ sess.logout();
+
+ DataSource ds = (DataSource)new InitialContext().lookup(DS_NAME);
+ Connection conn = ds.getConnection();
+ Statement statement = conn.createStatement();
+ ResultSet res = statement.executeQuery("select * from JCR_MITEM where
ID='" + id + "'");
+ assertTrue(res.next());
+
+ // remove workspace data from database
+
DBCleanerService.removeWorkspaceData(repositoryEntry.getWorkspaceEntries().get(0));
+
+ // check - does JCR_SITEM become empty
+ try
+ {
+ res = statement.executeQuery("select * from JCR_MITEM where ID='"
+ id + "'");
+ fail();
+ }
+ catch (SQLException e)
+ {
+ //ok
+ }
+ statement.close();
+
+ service.removeRepository(repositoryName);
+ }
+
+ public void testRemoveWorkspaceSingleDB() throws Exception
+ {
+ String repositoryName = "repoTestRemoveSingle";
+
+ RepositoryEntry repositoryEntry = createSingleDB(repositoryName);
+
+ WorkspaceEntry workspaceEntry = repositoryEntry.getWorkspaceEntries().get(0);
+
+ RepositoryService service =
(RepositoryService)container.getComponentInstanceOfType(RepositoryService.class);
+ Session sess =
((RepositoryImpl)service.getRepository(repositoryName)).getSystemSession(workspaceEntry.getName());
+ Node root2 = sess.getRootNode();
+ assertNotNull(root2);
+
+ NodeImpl n = (NodeImpl)root2.addNode("node1");
+ assertTrue(root2.hasNode("node1"));
+
+ String id = n.getData().getIdentifier();
+
+ sess.save();
+
+ n.setProperty("prop", "some value");
+ n.setProperty("prop2", "some value two");
+ sess.save();
+
+ Node n2 = n.addNode("subnode");
+ n2.setProperty("prop", "some value");
+ n2.addNode("subnode1");
+ n2.addNode("subnode2");
+ n2.addNode("subnode2");
+ sess.save();
+ sess.logout();
+
+ DataSource ds = (DataSource)new InitialContext().lookup(DS_NAME);
+ Connection conn = ds.getConnection();
+ Statement statement = conn.createStatement();
+ ResultSet res =
+ statement.executeQuery("select * from JCR_SITEM where ID='" +
workspaceEntry.getName() + id + "'");
+ assertTrue(res.next());
+
+ // remove workspace data from database
+ DBCleanerService.removeWorkspaceData(workspaceEntry);
+
+ // check - does JCR_SITEM become empty
+ res = statement.executeQuery("select * from JCR_SITEM where ID='" +
workspaceEntry.getName() + id + "'");
+ assertFalse(res.next());
+ statement.close();
+
+ service.removeRepository(repositoryName);
+ }
+
+ private RepositoryEntry createMultiDB(String repositoryName) throws Exception
+ {
+ RepositoryEntry repositoryEntry = new RepositoryEntry();
+
+ repositoryEntry.setName(repositoryName);
+ repositoryEntry.setSessionTimeOut(3600000);
+
repositoryEntry.setAuthenticationPolicy("org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator");
+ repositoryEntry.setSecurityDomain("exo-domain");
+ repositoryEntry.setSystemWorkspaceName(repositoryName + "ws");
+ repositoryEntry.setDefaultWorkspaceName(repositoryName + "ws");
+
+ WorkspaceEntry workspaceEntry =
+ helper.getNewWs(repositoryName + "ws", true, DS_NAME,
"target/temp/values/" + IdGenerator.generate(), wsEntry
+ .getContainer(), false);
+
+ repositoryEntry.addWorkspace(workspaceEntry);
+
+ RepositoryService service =
(RepositoryService)container.getComponentInstanceOfType(RepositoryService.class);
+
+ service.createRepository(repositoryEntry);
+ return repositoryEntry;
+ }
+
+ private RepositoryEntry createSingleDB(String repositoryName) throws Exception
+ {
+ RepositoryEntry repositoryEntry = new RepositoryEntry();
+
+ repositoryEntry.setName(repositoryName);
+ repositoryEntry.setSessionTimeOut(3600000);
+
repositoryEntry.setAuthenticationPolicy("org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator");
+ repositoryEntry.setSecurityDomain("exo-domain");
+ repositoryEntry.setSystemWorkspaceName(repositoryName + "ws");
+ repositoryEntry.setDefaultWorkspaceName(repositoryName + "ws");
+
+ WorkspaceEntry workspaceEntry =
+ helper.getNewWs(repositoryName + "ws", false, DS_NAME,
"target/temp/values/" + IdGenerator.generate(), wsEntry
+ .getContainer(), false);
+
+ repositoryEntry.addWorkspace(workspaceEntry);
+
+ WorkspaceEntry secondWs =
+ helper.getNewWs(repositoryName + "ws2", false, DS_NAME,
"target/temp/values/" + IdGenerator.generate(),
+ wsEntry.getContainer(), false);
+ repositoryEntry.addWorkspace(secondWs);
+
+ RepositoryService service =
(RepositoryService)container.getComponentInstanceOfType(RepositoryService.class);
+
+ service.createRepository(repositoryEntry);
+ return repositoryEntry;
+ }
+}
Deleted:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/util/ConfigurationHelper.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/util/ConfigurationHelper.java 2010-09-16
15:32:57 UTC (rev 3125)
+++
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/util/ConfigurationHelper.java 2010-09-16
15:35:06 UTC (rev 3126)
@@ -1,214 +0,0 @@
-/*
- * 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.
- */
-package org.exoplatform.services.jcr.util;
-
-import org.apache.commons.dbcp.BasicDataSourceFactory;
-import org.exoplatform.container.ExoContainer;
-import org.exoplatform.services.jcr.RepositoryService;
-import org.exoplatform.services.jcr.config.CacheEntry;
-import org.exoplatform.services.jcr.config.ContainerEntry;
-import org.exoplatform.services.jcr.config.LockManagerEntry;
-import org.exoplatform.services.jcr.config.LockPersisterEntry;
-import org.exoplatform.services.jcr.config.QueryHandlerEntry;
-import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
-import org.exoplatform.services.jcr.config.SimpleParameterEntry;
-import org.exoplatform.services.jcr.config.ValueStorageEntry;
-import org.exoplatform.services.jcr.config.ValueStorageFilterEntry;
-import org.exoplatform.services.jcr.config.WorkspaceEntry;
-import org.exoplatform.services.jcr.impl.core.RepositoryImpl;
-import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer;
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
-
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-import javax.jcr.RepositoryException;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.sql.DataSource;
-
-/**
- * Created by The eXo Platform SAS
- *
- * @author <a href="mailto:Sergey.Kabashnyuk@gmail.com">Sergey
Kabashnyuk</a>
- * @version $Id: ConfigurationHelper.java 11907 2008-03-13 15:36:21Z ksm $
- */
-public class ConfigurationHelper
-{
- private static Log log =
ExoLogger.getLogger("exo.jcr.component.core.ConfigurationHelper");
-
- private static ConfigurationHelper instence;
-
- private ConfigurationHelper()
- {
- System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"org.exoplatform.services.naming.SimpleContextFactory");
- }
-
- public void createWorkspace(WorkspaceEntry workspaceEntry, ExoContainer container)
- throws RepositoryConfigurationException, RepositoryException
- {
- RepositoryService service =
(RepositoryService)container.getComponentInstanceOfType(RepositoryService.class);
- RepositoryImpl defRep;
-
- defRep = (RepositoryImpl)service.getDefaultRepository();
- defRep.configWorkspace(workspaceEntry);
- defRep.createWorkspace(workspaceEntry.getName());
-
- }
-
- public String getNewDataSource(String type) throws Exception
- {
-
- String newDS = IdGenerator.generate();
- Properties properties = new Properties();
-
- properties.setProperty("driverClassName",
"org.hsqldb.jdbcDriver");
- String newurl = "jdbc:hsqldb:file:target/temp/data/" + newDS;
-
- log.info("New url " + newurl);
-
- properties.setProperty("url", newurl);
- properties.setProperty("username", "sa");
- properties.setProperty("password", "");
- DataSource bds = BasicDataSourceFactory.createDataSource(properties);
- if (!newurl.contains("hsqldb"))
- {
- createDatabase(bds, newDS);
- }
-
- new InitialContext().bind(newDS, bds);
- return newDS;
-
- }
-
- public WorkspaceEntry getNewWs(String wsName, boolean isMultiDb, String dsName, String
vsPath, ContainerEntry entry)
- throws Exception
- {
-
- List params = new ArrayList();
-
- if (isMultiDb || dsName == null)
- {
- dsName = getNewDataSource("");
- }
-
- params.add(new SimpleParameterEntry("sourceName", dsName));
- params.add(new SimpleParameterEntry("db-type", "generic"));
- params.add(new SimpleParameterEntry("multi-db", isMultiDb ?
"true" : "false"));
- params.add(new SimpleParameterEntry("update-storage",
"true"));
- params.add(new SimpleParameterEntry("max-buffer-size",
"204800"));
-
- if (entry.getParameterValue(JDBCWorkspaceDataContainer.DB_DIALECT) != null)
- {
- params.add(new SimpleParameterEntry(JDBCWorkspaceDataContainer.DB_DIALECT,
entry
- .getParameterValue(JDBCWorkspaceDataContainer.DB_DIALECT)));
- }
-
- String oldSwap = entry.getParameterValue("swap-directory");
- String newSwap = oldSwap.substring(0, oldSwap.lastIndexOf('/')) +
'/' + wsName;
-
- params.add(new SimpleParameterEntry("swap-directory", newSwap));
-
- ContainerEntry containerEntry =
- new
ContainerEntry("org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer",
- (ArrayList)params);
- containerEntry.setParameters(params);
-
- if (vsPath != null)
- {
-
- ArrayList<ValueStorageFilterEntry> vsparams = new
ArrayList<ValueStorageFilterEntry>();
- ValueStorageFilterEntry filterEntry = new ValueStorageFilterEntry();
- filterEntry.setPropertyType("Binary");
- vsparams.add(filterEntry);
-
- ValueStorageEntry valueStorageEntry =
- new
ValueStorageEntry("org.exoplatform.services.jcr.impl.storage.value.fs.SimpleFileValueStorage",
vsparams);
- ArrayList<SimpleParameterEntry> spe = new
ArrayList<SimpleParameterEntry>();
- spe.add(new SimpleParameterEntry("path", vsPath));
- valueStorageEntry.setId(IdGenerator.generate());
- valueStorageEntry.setParameters(spe);
- valueStorageEntry.setFilters(vsparams);
-
- // containerEntry.setValueStorages();
- containerEntry.setParameters(params);
- ArrayList list = new ArrayList(1);
- list.add(valueStorageEntry);
-
- containerEntry.setValueStorages(list);
-
- }
-
- // Indexer
- ArrayList qParams = new ArrayList();
- qParams.add(new SimpleParameterEntry("indexDir",
"../temp/index/" + IdGenerator.generate()));
- QueryHandlerEntry qEntry =
- new
QueryHandlerEntry("org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex",
qParams);
-
- WorkspaceEntry workspaceEntry =
- new WorkspaceEntry(wsName != null ? wsName : IdGenerator.generate(),
"nt:unstructured");
- workspaceEntry.setContainer(containerEntry);
-
- ArrayList cacheParams = new ArrayList();
-
- cacheParams.add(new SimpleParameterEntry("maxSize", "2000"));
- cacheParams.add(new SimpleParameterEntry("liveTime", "20m"));
- CacheEntry cacheEntry = new CacheEntry(cacheParams);
-
cacheEntry.setType("org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl");
-
- workspaceEntry.setCache(cacheEntry);
-
- workspaceEntry.setQueryHandler(qEntry);
-
- LockManagerEntry lockManagerEntry = new LockManagerEntry();
- lockManagerEntry.setTimeout(900000);
- LockPersisterEntry persisterEntry = new LockPersisterEntry();
-
persisterEntry.setType("org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister");
- ArrayList lpParams = new ArrayList();
- lpParams.add(new SimpleParameterEntry("path",
"../temp/lock"));
- persisterEntry.setParameters(lpParams);
- lockManagerEntry.setPersister(persisterEntry);
- workspaceEntry.setLockManager(lockManagerEntry);
-
- // workspaceEntry
- return workspaceEntry;
- }
-
- private void createDatabase(DataSource ds, String dbName) throws SQLException
- {
- Connection connection = ds.getConnection();
- PreparedStatement st = connection.prepareStatement("create database " +
dbName);
- st.executeQuery();
- }
-
- public static ConfigurationHelper getInstence()
- {
- if (instence == null)
- {
- instence = new ConfigurationHelper();
- }
-
- return instence;
- }
-}
Added:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/util/TesterConfigurationHelper.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/util/TesterConfigurationHelper.java
(rev 0)
+++
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/util/TesterConfigurationHelper.java 2010-09-16
15:35:06 UTC (rev 3126)
@@ -0,0 +1,349 @@
+/*
+ * 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.
+ */
+package org.exoplatform.services.jcr.util;
+
+import org.apache.commons.dbcp.BasicDataSourceFactory;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.services.jcr.RepositoryService;
+import org.exoplatform.services.jcr.config.CacheEntry;
+import org.exoplatform.services.jcr.config.ContainerEntry;
+import org.exoplatform.services.jcr.config.LockManagerEntry;
+import org.exoplatform.services.jcr.config.LockPersisterEntry;
+import org.exoplatform.services.jcr.config.QueryHandlerEntry;
+import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
+import org.exoplatform.services.jcr.config.SimpleParameterEntry;
+import org.exoplatform.services.jcr.config.ValueStorageEntry;
+import org.exoplatform.services.jcr.config.ValueStorageFilterEntry;
+import org.exoplatform.services.jcr.config.WorkspaceEntry;
+import org.exoplatform.services.jcr.impl.core.RepositoryImpl;
+import org.exoplatform.services.jcr.impl.storage.jdbc.DialectDetecter;
+import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import javax.jcr.RepositoryException;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.sql.DataSource;
+
+/**
+ * Created by The eXo Platform SAS
+ *
+ * @author <a href="mailto:Sergey.Kabashnyuk@gmail.com">Sergey
Kabashnyuk</a>
+ * @version $Id: ConfigurationHelper.java 11907 2008-03-13 15:36:21Z ksm $
+ */
+public class TesterConfigurationHelper
+{
+ private static Log log =
ExoLogger.getLogger("exo.jcr.component.core.ConfigurationHelper");
+
+ private static TesterConfigurationHelper instence;
+
+ private TesterConfigurationHelper()
+ {
+ System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"org.exoplatform.services.naming.SimpleContextFactory");
+ }
+
+ public void createWorkspace(WorkspaceEntry workspaceEntry, ExoContainer container)
+ throws RepositoryConfigurationException, RepositoryException
+ {
+ RepositoryService service =
(RepositoryService)container.getComponentInstanceOfType(RepositoryService.class);
+ RepositoryImpl defRep;
+
+ defRep = (RepositoryImpl)service.getDefaultRepository();
+ defRep.configWorkspace(workspaceEntry);
+ defRep.createWorkspace(workspaceEntry.getName());
+
+ }
+
+ public String getNewDataSource(String type) throws Exception
+ {
+
+ String newDS = IdGenerator.generate();
+ Properties properties = new Properties();
+
+ properties.setProperty("driverClassName",
"org.hsqldb.jdbcDriver");
+ String newurl = "jdbc:hsqldb:file:target/temp/data/" + newDS;
+
+ log.info("New url " + newurl);
+
+ properties.setProperty("url", newurl);
+ properties.setProperty("username", "sa");
+ properties.setProperty("password", "");
+ DataSource bds = BasicDataSourceFactory.createDataSource(properties);
+ if (!newurl.contains("hsqldb"))
+ {
+ createDatabase(bds, newDS);
+ }
+
+ new InitialContext().bind(newDS, bds);
+ return newDS;
+
+ }
+
+ public WorkspaceEntry getNewWs(String wsName, boolean isMultiDb, String dsName, String
vsPath, ContainerEntry entry)
+ throws Exception
+ {
+ return getNewWs(wsName, isMultiDb, dsName, vsPath, entry, true);
+ }
+
+ public WorkspaceEntry getNewWs(String wsName, boolean isMultiDb, String dsName, String
vsPath, ContainerEntry entry,
+ boolean newMultiDbDS) throws Exception
+ {
+
+ String dbDialect = null;
+ if (dsName != null)
+ {
+ DataSource ds = (DataSource)new InitialContext().lookup(dsName);
+ if (ds != null)
+ {
+ Connection jdbcConn = null;
+
+ jdbcConn = ds.getConnection();
+ dbDialect = DialectDetecter.detect(jdbcConn.getMetaData());
+
+ }
+ }
+
+ if (newMultiDbDS && (isMultiDb || dsName == null))
+ {
+ dsName = getNewDataSource("");
+ }
+
+ List params = new ArrayList();
+
+ params.add(new SimpleParameterEntry("sourceName", dsName));
+ params.add(new SimpleParameterEntry("db-type", "generic"));
+ params.add(new SimpleParameterEntry("multi-db", isMultiDb ?
"true" : "false"));
+ params.add(new SimpleParameterEntry("update-storage",
"true"));
+ params.add(new SimpleParameterEntry("max-buffer-size",
"204800"));
+
+ if (dbDialect != null)
+ {
+ params.add(new SimpleParameterEntry(JDBCWorkspaceDataContainer.DB_DIALECT,
dbDialect));
+ }
+ else if (entry.getParameterValue(JDBCWorkspaceDataContainer.DB_DIALECT) != null)
+ {
+ params.add(new SimpleParameterEntry(JDBCWorkspaceDataContainer.DB_DIALECT,
entry
+ .getParameterValue(JDBCWorkspaceDataContainer.DB_DIALECT)));
+ }
+
+ String oldSwap = entry.getParameterValue("swap-directory");
+ String newSwap = oldSwap.substring(0, oldSwap.lastIndexOf('/')) +
'/' + wsName;
+
+ params.add(new SimpleParameterEntry("swap-directory", newSwap));
+
+ ContainerEntry containerEntry =
+ new
ContainerEntry("org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer",
+ (ArrayList)params);
+ containerEntry.setParameters(params);
+
+ if (vsPath != null)
+ {
+
+ ArrayList<ValueStorageFilterEntry> vsparams = new
ArrayList<ValueStorageFilterEntry>();
+ ValueStorageFilterEntry filterEntry = new ValueStorageFilterEntry();
+ filterEntry.setPropertyType("Binary");
+ vsparams.add(filterEntry);
+
+ ValueStorageEntry valueStorageEntry =
+ new
ValueStorageEntry("org.exoplatform.services.jcr.impl.storage.value.fs.SimpleFileValueStorage",
vsparams);
+ ArrayList<SimpleParameterEntry> spe = new
ArrayList<SimpleParameterEntry>();
+ spe.add(new SimpleParameterEntry("path", vsPath));
+ valueStorageEntry.setId(IdGenerator.generate());
+ valueStorageEntry.setParameters(spe);
+ valueStorageEntry.setFilters(vsparams);
+
+ // containerEntry.setValueStorages();
+ containerEntry.setParameters(params);
+ ArrayList list = new ArrayList(1);
+ list.add(valueStorageEntry);
+
+ containerEntry.setValueStorages(list);
+
+ }
+
+ // Indexer
+ ArrayList qParams = new ArrayList();
+ qParams.add(new SimpleParameterEntry("indexDir",
"../temp/index/" + IdGenerator.generate()));
+ QueryHandlerEntry qEntry =
+ new
QueryHandlerEntry("org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex",
qParams);
+
+ WorkspaceEntry workspaceEntry =
+ new WorkspaceEntry(wsName != null ? wsName : IdGenerator.generate(),
"nt:unstructured");
+ workspaceEntry.setContainer(containerEntry);
+
+ ArrayList cacheParams = new ArrayList();
+
+ cacheParams.add(new SimpleParameterEntry("maxSize", "2000"));
+ cacheParams.add(new SimpleParameterEntry("liveTime", "20m"));
+ CacheEntry cacheEntry = new CacheEntry(cacheParams);
+
cacheEntry.setType("org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl");
+
+ workspaceEntry.setCache(cacheEntry);
+
+ workspaceEntry.setQueryHandler(qEntry);
+
+ LockManagerEntry lockManagerEntry = new LockManagerEntry();
+ lockManagerEntry.setTimeout(900000);
+ LockPersisterEntry persisterEntry = new LockPersisterEntry();
+
persisterEntry.setType("org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister");
+ ArrayList lpParams = new ArrayList();
+ lpParams.add(new SimpleParameterEntry("path",
"../temp/lock"));
+ persisterEntry.setParameters(lpParams);
+ lockManagerEntry.setPersister(persisterEntry);
+ workspaceEntry.setLockManager(lockManagerEntry);
+
+ // workspaceEntry
+ return workspaceEntry;
+ }
+
+ // public WorkspaceEntry getNewWsOnDataSource(String wsName, boolean isMultiDb,
String dsName, String vsPath,
+ // ContainerEntry entry) throws Exception
+ // {
+ //
+ // String dbDialect = null;
+ // if (dsName != null)
+ // {
+ // DataSource ds = (DataSource)new InitialContext().lookup(dsName);
+ // if (ds != null)
+ // {
+ // Connection jdbcConn = null;
+ //
+ // jdbcConn = ds.getConnection();
+ // dbDialect = DialectDetecter.detect(jdbcConn.getMetaData());
+ // }
+ // }
+ //
+ // List params = new ArrayList();
+ //
+ // if (isMultiDb && dsName == null)
+ // {
+ // dsName = getNewDataSource("");
+ // }
+ //
+ // params.add(new SimpleParameterEntry("sourceName", dsName));
+ // params.add(new SimpleParameterEntry("db-type",
"generic"));
+ // params.add(new SimpleParameterEntry("multi-db", isMultiDb ?
"true" : "false"));
+ // params.add(new SimpleParameterEntry("update-storage",
"true"));
+ // params.add(new SimpleParameterEntry("max-buffer-size",
"204800"));
+ //
+ // if (dbDialect != null)
+ // {
+ // params.add(new SimpleParameterEntry(JDBCWorkspaceDataContainer.DB_DIALECT,
dbDialect));
+ // }
+ // else if (entry.getParameterValue(JDBCWorkspaceDataContainer.DB_DIALECT) !=
null)
+ // {
+ // params.add(new SimpleParameterEntry(JDBCWorkspaceDataContainer.DB_DIALECT,
entry
+ // .getParameterValue(JDBCWorkspaceDataContainer.DB_DIALECT)));
+ // }
+ //
+ // String oldSwap = entry.getParameterValue("swap-directory");
+ // String newSwap = oldSwap.substring(0, oldSwap.lastIndexOf('/')) +
'/' + wsName;
+ //
+ // params.add(new SimpleParameterEntry("swap-directory", newSwap));
+ //
+ // ContainerEntry containerEntry =
+ // new
ContainerEntry("org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer",
+ // (ArrayList)params);
+ // containerEntry.setParameters(params);
+ //
+ // if (vsPath != null)
+ // {
+ //
+ // ArrayList<ValueStorageFilterEntry> vsparams = new
ArrayList<ValueStorageFilterEntry>();
+ // ValueStorageFilterEntry filterEntry = new ValueStorageFilterEntry();
+ // filterEntry.setPropertyType("Binary");
+ // vsparams.add(filterEntry);
+ //
+ // ValueStorageEntry valueStorageEntry =
+ // new
ValueStorageEntry("org.exoplatform.services.jcr.impl.storage.value.fs.SimpleFileValueStorage",
vsparams);
+ // ArrayList<SimpleParameterEntry> spe = new
ArrayList<SimpleParameterEntry>();
+ // spe.add(new SimpleParameterEntry("path", vsPath));
+ // valueStorageEntry.setId(IdGenerator.generate());
+ // valueStorageEntry.setParameters(spe);
+ // valueStorageEntry.setFilters(vsparams);
+ //
+ // // containerEntry.setValueStorages();
+ // containerEntry.setParameters(params);
+ // ArrayList list = new ArrayList(1);
+ // list.add(valueStorageEntry);
+ //
+ // containerEntry.setValueStorages(list);
+ //
+ // }
+ //
+ // // Indexer
+ // ArrayList qParams = new ArrayList();
+ // qParams.add(new SimpleParameterEntry("indexDir",
"../temp/index/" + IdGenerator.generate()));
+ // QueryHandlerEntry qEntry =
+ // new
QueryHandlerEntry("org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex",
qParams);
+ //
+ // WorkspaceEntry workspaceEntry =
+ // new WorkspaceEntry(wsName != null ? wsName : IdGenerator.generate(),
"nt:unstructured");
+ // workspaceEntry.setContainer(containerEntry);
+ //
+ // ArrayList cacheParams = new ArrayList();
+ //
+ // cacheParams.add(new SimpleParameterEntry("maxSize",
"2000"));
+ // cacheParams.add(new SimpleParameterEntry("liveTime",
"20m"));
+ // CacheEntry cacheEntry = new CacheEntry(cacheParams);
+ //
cacheEntry.setType("org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl");
+ //
+ // workspaceEntry.setCache(cacheEntry);
+ //
+ // workspaceEntry.setQueryHandler(qEntry);
+ //
+ // LockManagerEntry lockManagerEntry = new LockManagerEntry();
+ // lockManagerEntry.setTimeout(900000);
+ // LockPersisterEntry persisterEntry = new LockPersisterEntry();
+ //
persisterEntry.setType("org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister");
+ // ArrayList lpParams = new ArrayList();
+ // lpParams.add(new SimpleParameterEntry("path",
"../temp/lock"));
+ // persisterEntry.setParameters(lpParams);
+ // lockManagerEntry.setPersister(persisterEntry);
+ // workspaceEntry.setLockManager(lockManagerEntry);
+ //
+ // // workspaceEntry
+ // return workspaceEntry;
+ // }
+
+ private void createDatabase(DataSource ds, String dbName) throws SQLException
+ {
+ Connection connection = ds.getConnection();
+ PreparedStatement st = connection.prepareStatement("create database " +
dbName);
+ st.executeQuery();
+ }
+
+ public static TesterConfigurationHelper getInstence()
+ {
+ if (instence == null)
+ {
+ instence = new TesterConfigurationHelper();
+ }
+
+ return instence;
+ }
+}
Modified:
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration-sjdbc.xml
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration-sjdbc.xml 2010-09-16
15:32:57 UTC (rev 3125)
+++
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration-sjdbc.xml 2010-09-16
15:35:06 UTC (rev 3126)
@@ -118,7 +118,7 @@
<property name="rma"
value="http://www.rma.com/jcr/"/>
<property name="metadata"
value="http://www.exoplatform.com/jcr/metadata/1.1/"/>
<property name="dc"
value="http://purl.org/dc/elements/1.1/"/>
- <property name="publication"
value="http://www.exoplatform.com/jcr/publication/1.1/"/>
+ <property name="publication"
value="http://www.exoplatform.com/jcr/publication/1.1/"/>
</properties-param>
</init-params>
</component-plugin>
@@ -135,9 +135,9 @@
<value>jar:/conf/test/nodetypes-usecase.xml</value>
<value>jar:/conf/test/nodetypes-config.xml</value>
<value>jar:/conf/test/nodetypes-config-extended.xml</value>
- <value>jar:/conf/test/wcm-nodetypes.xml</value>
- <value>jar:/conf/test/nodetypes-publication-config.xml</value>
-
<value>jar:/conf/test/publication-plugins-nodetypes-config.xml</value>
+ <value>jar:/conf/test/wcm-nodetypes.xml</value>
+ <value>jar:/conf/test/nodetypes-publication-config.xml</value>
+
<value>jar:/conf/test/publication-plugins-nodetypes-config.xml</value>
</values-param>
<values-param>
@@ -391,6 +391,33 @@
</init-params>
</component-plugin>
<component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>testdbcleaner</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName"
value="org.hsqldb.jdbcDriver"/>
+ <property name="url"
value="jdbc:hsqldb:file:target/temp/data/testdbcleaner"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
<name>bind.jcr</name>
<set-method>addPlugin</set-method>
<type>org.exoplatform.services.naming.BindReferencePlugin</type>
Modified:
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration.xml
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration.xml 2010-09-16
15:32:57 UTC (rev 3125)
+++
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration.xml 2010-09-16
15:35:06 UTC (rev 3126)
@@ -525,6 +525,33 @@
</properties-param>
</init-params>
</component-plugin>
+<component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>testdbcleaner</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName"
value="org.hsqldb.jdbcDriver"/>
+ <property name="url"
value="jdbc:hsqldb:file:target/temp/data/testdbcleaner"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
<component-plugin>
<name>bind.jcr</name>
<set-method>addPlugin</set-method>