exo-jcr SVN: r297 - jcr/trunk/component/core.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2009-10-19 09:30:46 -0400 (Mon, 19 Oct 2009)
New Revision: 297
Modified:
jcr/trunk/component/core/pom.xml
Log:
EXOJCR-164: JCR pom formatting
Modified: jcr/trunk/component/core/pom.xml
===================================================================
--- jcr/trunk/component/core/pom.xml 2009-10-19 13:04:34 UTC (rev 296)
+++ jcr/trunk/component/core/pom.xml 2009-10-19 13:30:46 UTC (rev 297)
@@ -1,12 +1,13 @@
<!--
- 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.
+ 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>
@@ -110,9 +111,11 @@
</dependency>
<!-- JOTM comes from exo.kernel.component.common -->
+
<!--
- dependency> <groupId>jotm</groupId> <artifactId>jotm</artifactId> <scope>compile</scope> <exclusions> <exclusion> <groupId>javax.resource</groupId> <artifactId>connector</artifactId>
- </exclusion> <exclusion> <groupId>log4j</groupId> <artifactId>log4j</artifactId> </exclusion> </exclusions> </dependency
+ dependency> <groupId>jotm</groupId> <artifactId>jotm</artifactId> <scope>compile</scope> <exclusions> <exclusion> <groupId>javax.resource</groupId>
+ <artifactId>connector</artifactId> </exclusion> <exclusion> <groupId>log4j</groupId> <artifactId>log4j</artifactId> </exclusion> </exclusions>
+ </dependency
-->
<dependency>
@@ -165,74 +168,97 @@
</dependency>
<!-- For MySQL support -->
- <!-- dependency>
+ <dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.0.5</version>
<scope>test</scope>
- </dependency -->
+ </dependency>
<!-- For PostgresSQL support -->
- <!--
- dependency> <groupId>postgresql</groupId> <artifactId>postgresql</artifactId> <version>8.2-504.jdbc3</version> <scope>compile</scope> </dependency
- -->
+ <dependency>
+ <groupId>postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ <version>8.2-504.jdbc3</version>
+ <scope>compile</scope>
+ </dependency>
<!-- For Oracle 10g support (local-jcr repository) -->
- <!--
- dependency> <groupId>ojdbc</groupId> <artifactId>ojdbc</artifactId> <version>14</version> <scope>compile</scope> </dependency> <dependency> <groupId>ojdbc</groupId>
- <artifactId>orai18n</artifactId> <version>14</version> <scope>compile</scope> </dependency
- -->
+ <dependency>
+ <groupId>ojdbc</groupId>
+ <artifactId>ojdbc</artifactId>
+ <version>14</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>ojdbc</groupId>
+ <artifactId>orai18n</artifactId>
+ <version>14</version>
+ <scope>compile</scope>
+ </dependency>
<!-- For IBM DB2 support (local-jcr repository) -->
- <!--
- dependency> <groupId>com.ibm.db2</groupId> <artifactId>db2jcc</artifactId> <version>9.1</version> <scope>compile</scope> </dependency> <dependency> <groupId>com.ibm.db2</groupId>
- <artifactId>db2jcc_license_cu</artifactId> <version>9.1</version> <scope>compile</scope> </dependency
- -->
+ <dependency>
+ <groupId>com.ibm.db2</groupId>
+ <artifactId>db2jcc</artifactId>
+ <version>9.1</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.ibm.db2</groupId>
+ <artifactId>db2jcc_license_cu</artifactId>
+ <version>9.1</version>
+ <scope>compile</scope>
+ </dependency>
<!-- For MS SQL 7/2000/2005 and Sybase ASE/Anywhere support (jTDS driver) -->
- <!-- dependency>
+ <dependency>
<groupId>net.sourceforge.jtds</groupId>
<artifactId>jtds</artifactId>
<version>1.2</version>
<scope>compile</scope>
- </dependency -->
+ </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>compile</scope> </dependency
- -->
+ <dependency>
+ <groupId>com.microsoft.sqlserver</groupId>
+ <artifactId>sqljdbc</artifactId>
+ <version>9.0</version>
+ <scope>compile</scope>
+ </dependency>
<!-- For Sybase ASE/Anywhere support (jConnect driver) (local-jcr repository) -->
- <!-- dependency>
+ <dependency>
<groupId>com.sybase.jdbc3.jdbc</groupId>
<artifactId>jconn3</artifactId>
<version>6.05</version>
<scope>compile</scope>
- </dependency -->
+ </dependency>
<!-- For Apache Derby support (aka JavaDB) -->
- <!-- dependency>
+ <dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.2.2.0</version>
<scope>compile</scope>
- </dependency -->
+ </dependency>
<!-- Ingres Database (local repository) -->
- <!-- dependency>
+ <dependency>
<groupId>com.ingres.jdbc</groupId>
<artifactId>iijdbc</artifactId>
<version>9.2</version>
<scope>test</scope>
- </dependency -->
+ </dependency>
<!-- H2 Database -->
- <!--dependency>
+ <dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.0.74</version>
<scope>compile</scope>
- </dependency -->
+ </dependency>
+
<!-- ======================================================================= -->
</dependencies>
@@ -454,6 +480,7 @@
</plugin>
</plugins>
</build>
+
<profiles>
<!-- ***************** -->
<!-- INTEGRATION TESTS -->
@@ -532,14 +559,40 @@
<!-- debug mode: mvn -Dmaven.test.skip=false -Dexo.tck.skip=false -DforkMode=never clean install -->
<!-- forking: to run both eXo test and TCK use forkMode=once, to run one of them (only) in Eclipse debug use forkMode=never -->
<executions>
- <!--
- execution> <id>execution2 - pause 10 sec</id> <phase>test</phase> <goals> <goal>test</goal> </goals> <configuration> <skip>${exo.tck.skip}</skip> <includes>
- <include>**/util/Sleeping10Seconds.java</include> </includes> </configuration> </execution> <execution> <id>execution3 - TCK init section</id> <phase>test</phase> <goals>
- <goal>test</goal> </goals> <configuration> <skip>${exo.tck.skip}</skip> <argLine>-Xmx512M</argLine> <systemProperties> <property> <name>jcr.test.configuration.file</name>
- <value>${jcr.test.configuration.file}</value> </property> </systemProperties> <includes> <include>org/exoplatform/services/jcr/integration/PrepareTestRepository.java</include>
- </includes> </configuration> </execution
- -->
<execution>
+ <id>execution2 - pause 10 sec</id>
+ <phase>test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>${exo.tck.skip}</skip>
+ <includes>
+ <include>**/util/Sleeping10Seconds.java</include>
+ </includes>
+ </configuration>
+ </execution>
+ <!-- execution>
+ <id>execution3 - TCK init section</id>
+ <phase>test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>${exo.tck.skip}</skip>
+ <argLine>-Xmx512M</argLine>
+ <systemProperties>
+ <property>
+ <name>jcr.test.configuration.file</name>
+ <value>${jcr.test.configuration.file}</value>
+ </property>
+ </systemProperties>
+ <includes>
+ <include>org/exoplatform/services/jcr/integration/PrepareTestRepository.java</include>
+ </includes>
+ </configuration>
+ </execution -->
+ <execution>
<id>execution4 - pause 10 sec</id>
<phase>test</phase>
<goals>
14 years, 8 months
exo-jcr SVN: r296 - jcr/trunk/component/core.
by do-not-reply@jboss.org
Author: aheritier
Date: 2009-10-19 09:04:34 -0400 (Mon, 19 Oct 2009)
New Revision: 296
Modified:
jcr/trunk/component/core/TCK.cmd
jcr/trunk/component/core/TCK.sh
jcr/trunk/component/core/pom.xml
jcr/trunk/component/core/test-all.cmd
jcr/trunk/component/core/test-dev.cmd
jcr/trunk/component/core/test.cmd
Log:
SWF-194 : Split unit tests, devtests in different profiles
Modified: jcr/trunk/component/core/TCK.cmd
===================================================================
--- jcr/trunk/component/core/TCK.cmd 2009-10-19 12:50:03 UTC (rev 295)
+++ jcr/trunk/component/core/TCK.cmd 2009-10-19 13:04:34 UTC (rev 296)
@@ -1,3 +1,3 @@
-@set MAVEN_OPTS=-Duser.language=en -Duser.region=us -Dmaven.test.skip=true -Dexo.devtest.skip=true -DforkMode=never -Dorg.exoplatform.jcr.monitor.jdbcMonitor %MAVEN_OPTS%
+@set MAVEN_OPTS=-Duser.language=en -Duser.region=us -Dmaven.test.skip=true -DforkMode=never -Dorg.exoplatform.jcr.monitor.jdbcMonitor %MAVEN_OPTS%
@start mvn clean install -Prun-its
Modified: jcr/trunk/component/core/TCK.sh
===================================================================
--- jcr/trunk/component/core/TCK.sh 2009-10-19 12:50:03 UTC (rev 295)
+++ jcr/trunk/component/core/TCK.sh 2009-10-19 13:04:34 UTC (rev 296)
@@ -1,2 +1,2 @@
-MAVEN_OPTS="-Duser.language=en -Duser.region=us -Dmaven.test.skip=true -Dexo.devtest.skip=true -DforkMode=never -Dorg.exoplatform.jcr.monitor.jdbcMonitor $MAVEN_OPTS "
+MAVEN_OPTS="-Duser.language=en -Duser.region=us -Dmaven.test.skip=true -DforkMode=never -Dorg.exoplatform.jcr.monitor.jdbcMonitor $MAVEN_OPTS "
mvn $MAVEN_OPTS clean install -Prun-its
\ No newline at end of file
Modified: jcr/trunk/component/core/pom.xml
===================================================================
--- jcr/trunk/component/core/pom.xml 2009-10-19 12:50:03 UTC (rev 295)
+++ jcr/trunk/component/core/pom.xml 2009-10-19 13:04:34 UTC (rev 296)
@@ -1,24 +1,12 @@
-<!--
- 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.
+ 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.
+ -->
- 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>
@@ -316,26 +304,6 @@
</configuration>
<executions>
<execution>
- <id>execution0 - developers tests</id>
- <phase>test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <systemProperties>
- <property>
- <name>jcr.test.configuration.file</name>
- <value>${jcr.test.configuration.file}</value>
- </property>
- </systemProperties>
- <includes>
- <include>**/**/TestErrorMultithreading__.java</include>
- <include>**/**/TestConcurrentItems__.java</include>
- <include>**/**/TestInvalidItemState__.java</include>
- </includes>
- </configuration>
- </execution>
- <execution>
<id>execution1 - exo tests</id>
<phase>test</phase>
<goals>
@@ -343,6 +311,7 @@
</goals>
<configuration>
<argLine>-Xmx512M</argLine>
+ <exo.devtest.skip>true</exo.devtest.skip>
<systemProperties>
<property>
<name>jcr.test.configuration.file</name>
@@ -489,6 +458,40 @@
<!-- ***************** -->
<!-- INTEGRATION TESTS -->
<!-- ***************** -->
+ <!-- Use "mvn -Prun-devtests" to launch them -->
+ <profile>
+ <id>run-devtests</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>execution0 - developers tests</id>
+ <phase>test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <systemProperties>
+ <property>
+ <name>jcr.test.configuration.file</name>
+ <value>${jcr.test.configuration.file}</value>
+ </property>
+ </systemProperties>
+ <includes>
+ <include>**/**/TestErrorMultithreading__.java</include>
+ <include>**/**/TestConcurrentItems__.java</include>
+ <include>**/**/TestInvalidItemState__.java</include>
+ </includes>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
<!-- Use "mvn -Prun-its" to launch them -->
<profile>
<id>run-its</id>
Modified: jcr/trunk/component/core/test-all.cmd
===================================================================
--- jcr/trunk/component/core/test-all.cmd 2009-10-19 12:50:03 UTC (rev 295)
+++ jcr/trunk/component/core/test-all.cmd 2009-10-19 13:04:34 UTC (rev 296)
@@ -1,3 +1,3 @@
-@set MAVEN_OPTS=-Duser.language=en -Duser.region=us %MAVEN_OPTS% -Dmaven.test.skip=false -Dexo.devtest.skip=true -DforkMode=once
+@set MAVEN_OPTS=-Duser.language=en -Duser.region=us %MAVEN_OPTS% -Dmaven.test.skip=false -DforkMode=once
@start mvn clean test -Prun-its
\ No newline at end of file
Modified: jcr/trunk/component/core/test-dev.cmd
===================================================================
--- jcr/trunk/component/core/test-dev.cmd 2009-10-19 12:50:03 UTC (rev 295)
+++ jcr/trunk/component/core/test-dev.cmd 2009-10-19 13:04:34 UTC (rev 296)
@@ -1,3 +1,3 @@
-@set MAVEN_OPTS=-Duser.language=en -Duser.region=us %MAVEN_OPTS% -Dmaven.test.skip=true -Dexo.devtest.skip=false -DforkMode=never
+@set MAVEN_OPTS=-Duser.language=en -Duser.region=us %MAVEN_OPTS% -Dmaven.test.skip=true -DforkMode=never
-@start mvn clean test
\ No newline at end of file
+@start mvn clean test -Prun-devtests
\ No newline at end of file
Modified: jcr/trunk/component/core/test.cmd
===================================================================
--- jcr/trunk/component/core/test.cmd 2009-10-19 12:50:03 UTC (rev 295)
+++ jcr/trunk/component/core/test.cmd 2009-10-19 13:04:34 UTC (rev 296)
@@ -1,3 +1,3 @@
-@set MAVEN_OPTS=-Duser.language=en -Duser.region=us %MAVEN_OPTS% -Dmaven.test.skip=false -Dexo.devtest.skip=true -DforkMode=never
+@set MAVEN_OPTS=-Duser.language=en -Duser.region=us %MAVEN_OPTS% -Dmaven.test.skip=false -DforkMode=never
@start mvn clean test
\ No newline at end of file
14 years, 8 months
exo-jcr SVN: r295 - in jcr/trunk/component/core/src/test/java/org/exoplatform/services/jcr: impl/core/query and 1 other directory.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2009-10-19 08:50:03 -0400 (Mon, 19 Oct 2009)
New Revision: 295
Removed:
jcr/trunk/component/core/src/test/java/org/exoplatform/services/jcr/api/core/query/IndexFormatVersionTest.java
Modified:
jcr/trunk/component/core/src/test/java/org/exoplatform/services/jcr/api/core/query/IndexingRuleTest.java
jcr/trunk/component/core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestQueryUsecases.java
Log:
EXOJCR-180: TestQueryUsecases updated
Deleted: jcr/trunk/component/core/src/test/java/org/exoplatform/services/jcr/api/core/query/IndexFormatVersionTest.java
===================================================================
--- jcr/trunk/component/core/src/test/java/org/exoplatform/services/jcr/api/core/query/IndexFormatVersionTest.java 2009-10-19 12:40:20 UTC (rev 294)
+++ jcr/trunk/component/core/src/test/java/org/exoplatform/services/jcr/api/core/query/IndexFormatVersionTest.java 2009-10-19 12:50:03 UTC (rev 295)
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.exoplatform.services.jcr.api.core.query;
-
-import org.apache.jackrabbit.test.AbstractJCRTest;
-import org.exoplatform.services.jcr.impl.core.query.QueryHandler;
-import org.exoplatform.services.jcr.impl.core.query.QueryManagerImpl;
-import org.exoplatform.services.jcr.impl.core.query.lucene.IndexFormatVersion;
-import org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex;
-
-
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
-import javax.jcr.query.QueryManager;
-
-/**
- * <code>IndexFormatVersionTest</code> checks if the various index format
- * versions are correctly read from the index.
- */
-public class IndexFormatVersionTest extends AbstractJCRTest {
-
-
- public void testname() throws Exception
- {
-
- }
-// public void testVersionOne() throws RepositoryException {
-// checkIndexFormatVersion("index-format-v1", IndexFormatVersion.V1);
-// }
-//
-// public void testVersionTwo() throws RepositoryException {
-// checkIndexFormatVersion("index-format-v2", IndexFormatVersion.V2);
-// }
-//
-// public void testVersionThree() throws RepositoryException {
-// checkIndexFormatVersion("index-format-v3", IndexFormatVersion.V3);
-// }
-//
-// private void checkIndexFormatVersion(String wspName,
-// IndexFormatVersion version)
-// throws RepositoryException {
-// Session session = helper.getSuperuserSession(wspName);
-// try {
-// QueryManager qm = session.getWorkspace().getQueryManager();
-// QueryHandler handler = ((QueryManagerImpl) qm).getQueryHandler();
-// SearchIndex index = (SearchIndex) handler;
-// assertEquals("Wrong index format", version.getVersion(),
-// index.getIndexFormatVersion().getVersion());
-// } finally {
-// session.logout();
-// }
-// }
-}
Modified: jcr/trunk/component/core/src/test/java/org/exoplatform/services/jcr/api/core/query/IndexingRuleTest.java
===================================================================
--- jcr/trunk/component/core/src/test/java/org/exoplatform/services/jcr/api/core/query/IndexingRuleTest.java 2009-10-19 12:40:20 UTC (rev 294)
+++ jcr/trunk/component/core/src/test/java/org/exoplatform/services/jcr/api/core/query/IndexingRuleTest.java 2009-10-19 12:50:03 UTC (rev 295)
@@ -83,9 +83,12 @@
Node node2 = testRootNode.addNode(nodeName2, NT_UNSTRUCTURED);
node2.setProperty("rule", "nsiFalse");
node2.setProperty("text", TEXT);
+ Node node3 = testRootNode.addNode(nodeName3, NT_UNSTRUCTURED);
+ node3.setProperty("text", TEXT);
+
testRootNode.save();
String stmt = "/jcr:root" + testRootNode.getPath() + "/*[jcr:contains(., 'quick')]";
- checkResult(executeQuery(stmt), new Node[]{node1});
+ checkResult(executeQuery(stmt), new Node[]{node1, node3});
}
public void testNodeType() throws RepositoryException
@@ -104,23 +107,22 @@
{
Node node = testRootNode.addNode(nodeName1, NT_UNSTRUCTURED);
node.setProperty("rule", "excerpt");
- node.setProperty("title", "Apache Jackrabbit");
- node.setProperty("text", "Jackrabbit is a JCR implementation");
+ node.setProperty("title", "eXo Platform");
+ node.setProperty("text", "eXo is a JCR implementation");
testRootNode.save();
- String stmt =
- "/jcr:root" + testRootNode.getPath() + "/*[jcr:contains(., 'jackrabbit implementation')]/rep:excerpt(.)";
+ String stmt = "/jcr:root" + testRootNode.getPath() + "/*[jcr:contains(., 'eXo implementation')]/rep:excerpt(.)";
RowIterator rows = executeQuery(stmt).getRows();
assertTrue("No results returned", rows.hasNext());
Value excerpt = rows.nextRow().getValue("rep:excerpt(.)");
assertNotNull("No excerpt created", excerpt);
- assertTrue("Title must not be present in excerpt", excerpt.getString().indexOf("Apache") == -1);
+ assertTrue("Title must not be present in excerpt", excerpt.getString().indexOf("Platform") == -1);
assertTrue("Missing highlight", excerpt.getString().indexOf("<strong>implementation</strong>") != -1);
- stmt = "/jcr:root" + testRootNode.getPath() + "/*[jcr:contains(., 'apache')]/rep:excerpt(.)";
+ stmt = "/jcr:root" + testRootNode.getPath() + "/*[jcr:contains(., 'eXo implementation')]/rep:excerpt(.)";
rows = executeQuery(stmt).getRows();
assertTrue("No results returned", rows.hasNext());
excerpt = rows.nextRow().getValue("rep:excerpt(.)");
assertNotNull("No excerpt created", excerpt);
- assertTrue("Title must not be present in excerpt", excerpt.getString().indexOf("Apache") == -1);
+ assertTrue("Title must not be present in excerpt", excerpt.getString().indexOf("Platform") == -1);
}
}
Modified: jcr/trunk/component/core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestQueryUsecases.java
===================================================================
--- jcr/trunk/component/core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestQueryUsecases.java 2009-10-19 12:40:20 UTC (rev 294)
+++ jcr/trunk/component/core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestQueryUsecases.java 2009-10-19 12:50:03 UTC (rev 295)
@@ -21,9 +21,11 @@
import org.exoplatform.services.log.Log;
import java.io.ByteArrayInputStream;
+import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashSet;
import java.util.Iterator;
+import java.util.List;
import java.util.Set;
import javax.jcr.Node;
@@ -422,7 +424,101 @@
checkResult(xres, new Node[]{doc2, doc3});
}
+ public void testUPPERConstraint() throws Exception
+ {
+ root.addNode("simplenode", "nt:unstructured");
+
+ Node doc1 = root.addNode("document1", "nt:unstructured");
+ doc1.addMixin("mix:title");
+ doc1.setProperty("jcr:title", "CaseSensitive");
+
+ Node doc2 = root.addNode("document2", "nt:unstructured");
+ doc2.addMixin("mix:title");
+ doc2.setProperty("jcr:title", "casesensitive");
+
+ Node doc3 = root.addNode("document3", "nt:unstructured");
+ doc3.addMixin("mix:title");
+ doc3.setProperty("jcr:title", "caseSENSITIVE");
+ session.save();
+
+ // make SQL query
+ QueryManager qman = this.workspace.getQueryManager();
+
+ Query q = qman.createQuery("SELECT * FROM mix:title WHERE UPPER(jcr:title) = 'CASESENSITIVE'", Query.SQL);
+ QueryResult res = q.execute();
+ long sqlsize = res.getNodes().getSize();
+ assertEquals(3, sqlsize);
+ checkResult(res, new Node[]{doc1, doc2, doc3});
+
+ q = qman.createQuery("SELECT * FROM mix:title WHERE LOWER(jcr:title) = 'casesensitive'", Query.SQL);
+ res = q.execute();
+ sqlsize = res.getNodes().getSize();
+ assertEquals(3, sqlsize);
+ checkResult(res, new Node[]{doc1, doc2, doc3});
+
+ //make XPath query
+ Query xq = qman.createQuery("//element(*,mix:title)[fn:upper-case(@jcr:title)='CASESENSITIVE']", Query.XPATH);
+ QueryResult xres = xq.execute();
+ long xpathsize = xres.getNodes().getSize();
+ assertEquals(3, xpathsize);
+ checkResult(xres, new Node[]{doc1, doc2, doc3});
+
+ xq = qman.createQuery("//element(*,mix:title)[fn:lower-case(@jcr:title)='casesensitive']", Query.XPATH);
+ xres = xq.execute();
+ xpathsize = xres.getNodes().getSize();
+ assertEquals(3, xpathsize);
+ checkResult(xres, new Node[]{doc1, doc2, doc3});
+ }
+
/**
+ * Find all mix:title nodes which title begins from 'P' symbol.
+ *
+ * @throws Exception
+ */
+ public void testLikeWithEscapeSymbol() throws Exception
+ {
+ root.addNode("simplenode", "nt:unstructured");
+
+ Node doc1 = root.addNode("document1", "nt:unstructured");
+ doc1.addMixin("mix:title");
+ doc1.setProperty("jcr:title", "Porison break");//setProperty("jcr:title", "Star wars");
+ doc1.setProperty("jcr:description", "Dart rules!!");
+
+ Node doc2 = root.addNode("document2", "nt:file");
+ doc2.addMixin("mix:title");
+ doc2.setProperty("jcr:title", "P%rison break");
+ doc2.setProperty("jcr:description", "Run, Forest, run ))");
+
+ NodeImpl cont = (NodeImpl)doc2.addNode("jcr:content", "nt:resource");
+ cont.setProperty("jcr:mimeType", "text/plain");
+ cont.setProperty("jcr:lastModified", Calendar.getInstance());
+ cont.setProperty("jcr:data", "text");
+
+ Node doc3 = root.addNode("document3", "nt:unstructured");
+ doc3.addMixin("mix:title");
+ doc3.setProperty("jcr:title", "Panopticum");
+ doc3.setProperty("jcr:description", "It's imagine film )");
+
+ session.save();
+
+ // make SQL query
+ QueryManager qman = this.workspace.getQueryManager();
+
+ Query q = qman.createQuery("SELECT * FROM mix:title WHERE jcr:title LIKE 'P#%ri%' ESCAPE '#'", Query.SQL);
+ QueryResult res = q.execute();
+ long sqlsize = res.getNodes().getSize();
+ assertEquals(1, sqlsize);
+ checkResult(res, new Node[]{doc2});
+
+ //make XPath query
+ Query xq = qman.createQuery("//element(*,mix:title)[jcr:like(@jcr:title, 'P\\%ri%')]", Query.XPATH);
+ QueryResult xres = xq.execute();
+ long xpathsize = xres.getNodes().getSize();
+ assertEquals(1, xpathsize);
+ checkResult(xres, new Node[]{doc2});
+ }
+
+ /**
* Find all mix:title nodes which title not begins from 'P' symbol.
*
* @throws Exception
@@ -911,8 +1007,8 @@
QueryManager qman = this.workspace.getQueryManager();
Query q =
- qman.createQuery(
- "SELECT * FROM mix:title WHERE CONTAINS(*, 'brown OR fox OR jumps') ORDER BY jcr:score() DESC", Query.SQL);
+ qman.createQuery("SELECT * FROM mix:title WHERE CONTAINS(*, 'brown OR fox OR jumps') ORDER BY SCORE ASC",
+ Query.SQL);
QueryResult res = q.execute();
long sqlsize = res.getNodes().getSize();
assertEquals(3, sqlsize);
@@ -921,7 +1017,7 @@
//make XPath query
Query xq =
qman.createQuery(
- "//element(*,mix:title)[jcr:contains(., 'brown OR fox OR jumps')] order by jcr:score() descending",
+ "//element(*,mix:title)[jcr:contains(., 'brown OR fox OR jumps')] order by jcr:score() ascending",
Query.XPATH);
QueryResult xres = xq.execute();
long xpathsize = xres.getNodes().getSize();
@@ -1006,6 +1102,77 @@
checkOrder(res, new Node[]{doc3, doc1, doc2});
}
+ public void testSearchByName() throws Exception
+ {
+ Node doc1 = root.addNode("document1", "nt:file");
+ NodeImpl cont1 = (NodeImpl)doc1.addNode("jcr:content", "nt:resource");
+ cont1.setProperty("jcr:mimeType", "text/plain");
+ cont1.setProperty("jcr:lastModified", Calendar.getInstance());
+ cont1.setProperty("jcr:data", "The quick brown fox jump over the lazy dog");
+ session.save();
+
+ Node doc2 = root.addNode("document2", "nt:file");
+ NodeImpl cont2 = (NodeImpl)doc2.addNode("jcr:content", "nt:resource");
+ cont2.setProperty("jcr:mimeType", "text/plain");
+ cont2.setProperty("jcr:lastModified", Calendar.getInstance());
+ cont2.setProperty("jcr:data", "Dogs do not like cats.");
+
+ Node doc3 = root.addNode("document1", "nt:file");
+ NodeImpl cont3 = (NodeImpl)doc3.addNode("jcr:content", "nt:resource");
+ cont3.setProperty("jcr:mimeType", "text/plain");
+ cont3.setProperty("jcr:lastModified", Calendar.getInstance());
+ cont3.setProperty("jcr:data", "Cats jumping high.");
+ session.save();
+
+ // make SQL query
+ QueryManager qman = this.workspace.getQueryManager();
+
+ Query q = qman.createQuery("SELECT * FROM nt:file WHERE fn:name() = 'document1'", Query.SQL);
+ QueryResult res = q.execute();
+ long sqlsize = res.getNodes().getSize();
+ assertEquals(2, sqlsize);
+ checkResult(res, new Node[]{doc1, doc3});
+
+ //make XPath query
+ Query xq = qman.createQuery("//element(*,nt:file)[fn:name() = 'document1']", Query.XPATH);
+ QueryResult xres = xq.execute();
+ long xpathsize = xres.getNodes().getSize();
+ assertEquals(2, xpathsize);
+ checkResult(xres, new Node[]{doc1, doc3});
+ }
+
+ public void testMultivalueProperty() throws Exception
+ {
+ Node doc1 = root.addNode("node1", "nt:unstructured");
+ doc1.setProperty("multiprop", new String[]{"one", "two"});
+
+ Node doc2 = root.addNode("node2", "nt:unstructured");
+ doc2.setProperty("multiprop", new String[]{"one", "two", "three"});
+
+ Node doc3 = root.addNode("node3", "nt:unstructured");
+ doc3.setProperty("multiprop", new String[]{"one", "five"});
+ session.save();
+
+ // make SQL query
+ QueryManager qman = this.workspace.getQueryManager();
+
+ Query q =
+ qman.createQuery("SELECT * FROM nt:unstructured WHERE multiprop = 'one' AND multiprop = 'two'", Query.SQL);
+ QueryResult res = q.execute();
+ long sqlsize = res.getNodes().getSize();
+ assertEquals(2, sqlsize);
+ checkResult(res, new Node[]{doc1, doc2});
+
+ //make XPath query
+ Query xq =
+ qman.createQuery("//element(*,nt:unstructured)[@multiprop = 'one' and @multiprop = 'two']", Query.XPATH);
+ QueryResult xres = xq.execute();
+ long xpathsize = xres.getNodes().getSize();
+ assertEquals(2, xpathsize);
+ checkResult(xres, new Node[]{doc1, doc2});
+
+ }
+
/**
* Checks if the result set contains exactly the <code>nodes</code>.
*
@@ -1050,6 +1217,14 @@
{
NodeIterator ni = res.getNodes();
+ List<String> list = new ArrayList<String>();
+
+ while (ni.hasNext())
+ {
+ list.add(ni.nextNode().getPath());
+ }
+
+ ni = res.getNodes();
for (int i = 0; i < expectedNodes.length; i++)
{
Node expNode = expectedNodes[i];
14 years, 8 months
exo-jcr SVN: r294 - jcr/trunk/component/core.
by do-not-reply@jboss.org
Author: aheritier
Date: 2009-10-19 08:40:20 -0400 (Mon, 19 Oct 2009)
New Revision: 294
Modified:
jcr/trunk/component/core/
jcr/trunk/component/core/TCK.cmd
jcr/trunk/component/core/TCK.sh
jcr/trunk/component/core/pom.xml
jcr/trunk/component/core/test-all.cmd
jcr/trunk/component/core/test-dev.cmd
jcr/trunk/component/core/test.cmd
Log:
SWF-194 : Split unit tests, integration tests in different profiles
Property changes on: jcr/trunk/component/core
___________________________________________________________________
Name: svn:ignore
+ .settings
target
.classpath
.project
Modified: jcr/trunk/component/core/TCK.cmd
===================================================================
--- jcr/trunk/component/core/TCK.cmd 2009-10-19 08:23:55 UTC (rev 293)
+++ jcr/trunk/component/core/TCK.cmd 2009-10-19 12:40:20 UTC (rev 294)
@@ -1,3 +1,3 @@
-@set MAVEN_OPTS=-Duser.language=en -Duser.region=us -Dexo.test.skip=true -Dexo.devtest.skip=true -Dexo.tck.skip=false -DforkMode=never -Dorg.exoplatform.jcr.monitor.jdbcMonitor %MAVEN_OPTS%
+@set MAVEN_OPTS=-Duser.language=en -Duser.region=us -Dmaven.test.skip=true -Dexo.devtest.skip=true -DforkMode=never -Dorg.exoplatform.jcr.monitor.jdbcMonitor %MAVEN_OPTS%
-@start mvn clean install
+@start mvn clean install -Prun-its
Modified: jcr/trunk/component/core/TCK.sh
===================================================================
--- jcr/trunk/component/core/TCK.sh 2009-10-19 08:23:55 UTC (rev 293)
+++ jcr/trunk/component/core/TCK.sh 2009-10-19 12:40:20 UTC (rev 294)
@@ -1,2 +1,2 @@
-MAVEN_OPTS="-Duser.language=en -Duser.region=us -Dexo.test.skip=true -Dexo.devtest.skip=true -Dexo.tck.skip=false -DforkMode=never -Dorg.exoplatform.jcr.monitor.jdbcMonitor $MAVEN_OPTS "
-mvn $MAVEN_OPTS clean install
\ No newline at end of file
+MAVEN_OPTS="-Duser.language=en -Duser.region=us -Dmaven.test.skip=true -Dexo.devtest.skip=true -DforkMode=never -Dorg.exoplatform.jcr.monitor.jdbcMonitor $MAVEN_OPTS "
+mvn $MAVEN_OPTS clean install -Prun-its
\ No newline at end of file
Modified: jcr/trunk/component/core/pom.xml
===================================================================
--- jcr/trunk/component/core/pom.xml 2009-10-19 08:23:55 UTC (rev 293)
+++ jcr/trunk/component/core/pom.xml 2009-10-19 12:40:20 UTC (rev 294)
@@ -18,6 +18,7 @@
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>
@@ -113,29 +114,18 @@
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<exclusions>
- <exclusion>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- </exclusion>
+ <exclusion>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<!-- JOTM comes from exo.kernel.component.common -->
- <!-- dependency>
- <groupId>jotm</groupId>
- <artifactId>jotm</artifactId>
- <scope>compile</scope>
- <exclusions>
- <exclusion>
- <groupId>javax.resource</groupId>
- <artifactId>connector</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
- </dependency -->
+ <!--
+ dependency> <groupId>jotm</groupId> <artifactId>jotm</artifactId> <scope>compile</scope> <exclusions> <exclusion> <groupId>javax.resource</groupId> <artifactId>connector</artifactId>
+ </exclusion> <exclusion> <groupId>log4j</groupId> <artifactId>log4j</artifactId> </exclusion> </exclusions> </dependency
+ -->
<dependency>
<groupId>javax.resource</groupId>
@@ -177,26 +167,7 @@
</exclusions>
</dependency>
- <!-- TCK binaries and deps for repo stub, some eXo API test -->
- <dependency>
- <groupId>org.apache.jackrabbit</groupId>
- <artifactId>jackrabbit-jcr-tests</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </exclusion>
- </exclusions>
- <scope>test</scope>
- </dependency>
- <!-- slf4j-log4j12 for TCK sources -->
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <scope>test</scope>
- </dependency>
-
<!-- ===== Databases JDBC support for tests ===== -->
<dependency>
@@ -214,40 +185,21 @@
</dependency -->
<!-- For PostgresSQL support -->
- <!-- dependency>
- <groupId>postgresql</groupId>
- <artifactId>postgresql</artifactId>
- <version>8.2-504.jdbc3</version>
- <scope>compile</scope>
- </dependency -->
+ <!--
+ dependency> <groupId>postgresql</groupId> <artifactId>postgresql</artifactId> <version>8.2-504.jdbc3</version> <scope>compile</scope> </dependency
+ -->
<!-- For Oracle 10g support (local-jcr repository) -->
- <!-- dependency>
- <groupId>ojdbc</groupId>
- <artifactId>ojdbc</artifactId>
- <version>14</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>ojdbc</groupId>
- <artifactId>orai18n</artifactId>
- <version>14</version>
- <scope>compile</scope>
- </dependency -->
+ <!--
+ dependency> <groupId>ojdbc</groupId> <artifactId>ojdbc</artifactId> <version>14</version> <scope>compile</scope> </dependency> <dependency> <groupId>ojdbc</groupId>
+ <artifactId>orai18n</artifactId> <version>14</version> <scope>compile</scope> </dependency
+ -->
<!-- For IBM DB2 support (local-jcr repository) -->
- <!-- dependency>
- <groupId>com.ibm.db2</groupId>
- <artifactId>db2jcc</artifactId>
- <version>9.1</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>com.ibm.db2</groupId>
- <artifactId>db2jcc_license_cu</artifactId>
- <version>9.1</version>
- <scope>compile</scope>
- </dependency -->
+ <!--
+ dependency> <groupId>com.ibm.db2</groupId> <artifactId>db2jcc</artifactId> <version>9.1</version> <scope>compile</scope> </dependency> <dependency> <groupId>com.ibm.db2</groupId>
+ <artifactId>db2jcc_license_cu</artifactId> <version>9.1</version> <scope>compile</scope> </dependency
+ -->
<!-- For MS SQL 7/2000/2005 and Sybase ASE/Anywhere support (jTDS driver) -->
<!-- dependency>
@@ -258,12 +210,9 @@
</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>compile</scope>
- </dependency -->
+ <!--
+ dependency> <groupId>com.microsoft.sqlserver</groupId> <artifactId>sqljdbc</artifactId> <version>9.0</version> <scope>compile</scope> </dependency
+ -->
<!-- For Sybase ASE/Anywhere support (jConnect driver) (local-jcr repository) -->
<!-- dependency>
@@ -353,20 +302,14 @@
<include>**/*.dtd</include>
</includes>
</testResource>
- <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>
- <!-- normal mode: mvn -Dmaven.test.skip=false -Dexo.tck.skip=false clean install -->
- <!-- debug mode: mvn -Dmaven.test.skip=false -Dexo.tck.skip=false -DforkMode=never clean install -->
+ <!-- normal mode: mvn -Dmaven.test.skip=false clean install -->
+ <!-- debug mode: mvn -Dmaven.test.skip=false -DforkMode=never clean install -->
<!-- forking: to run both eXo test and TCK use forkMode=once, to run one of them (only) in Eclipse debug use forkMode=never -->
<configuration>
<skip>true</skip>
@@ -379,7 +322,6 @@
<goal>test</goal>
</goals>
<configuration>
- <skip>${exo.devtest.skip}</skip>
<systemProperties>
<property>
<name>jcr.test.configuration.file</name>
@@ -400,7 +342,6 @@
<goal>test</goal>
</goals>
<configuration>
- <skip>${exo.test.skip}</skip>
<argLine>-Xmx512M</argLine>
<systemProperties>
<property>
@@ -418,129 +359,29 @@
<include>**/usecases/**/*Test.java</include>
<include>**/impl/**/Test*.java</include>
</includes>
- <excludes>
- <exclude>**/TestQueryUsecases.java</exclude>
- <exclude>**/TestImport.java</exclude>
- <exclude>**/TestRollbackBigFiles.java</exclude>
- <exclude>**/TestErrorMultithreading.java</exclude>
- <exclude>**/api/**/TestSameNameItems.java</exclude>
- <exclude>**/api/**/TestVersionRestore.java</exclude>
- <exclude>**/impl/**/TestWorkspaceManagement.java</exclude>
- <exclude>**/impl/**/TestRepositoryManagement.java</exclude>
- <exclude>**/impl/**/TestSaveConfiguration.java</exclude>
- <exclude>**/impl/**/ValueStoragePluginTest.java</exclude>
- <exclude>**/impl/**/TestWorkspaceRestore.java</exclude>
- <exclude>**/impl/**/TestSessionCleaner.java</exclude>
- <exclude>**/impl/**/Base*.java</exclude>
- <exclude>**/impl/**/TestJCRSerializationStream.java</exclude>
- <exclude>**/impl/**/TestJCRSerializationVersionRestore.java</exclude>
- <exclude>**/api/TestAll.java</exclude>
- <exclude>**/usecases/**/RemoveSameNameSiblingTest.java</exclude>
- <exclude>**/usecases/**/TestQueryWithNumberAndSpace.java</exclude>
- <exclude>**/usecases/BaseUsecasesTest.java</exclude>
- <exclude>**/apache/**</exclude>
- <exclude>**/api/**/TestSameNameItems.java</exclude>
- <exclude>**/api/**/TestVersionRestore.java</exclude>
- </excludes>
- </configuration>
- </execution>
- <!-- execution>
- <id>execution2 - pause 10 sec</id>
- <phase>test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <skip>${exo.tck.skip}</skip>
- <includes>
- <include>**/util/Sleeping10Seconds.java</include>
- </includes>
- </configuration>
- </execution>
- <execution>
- <id>execution3 - TCK init section</id>
- <phase>test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <skip>${exo.tck.skip}</skip>
- <argLine>-Xmx512M</argLine>
- <systemProperties>
- <property>
- <name>jcr.test.configuration.file</name>
- <value>${jcr.test.configuration.file}</value>
- </property>
- </systemProperties>
- <includes>
- <include>org/exoplatform/services/jcr/integration/PrepareTestRepository.java</include>
- </includes>
- </configuration>
- </execution -->
- <execution>
- <id>execution4 - pause 10 sec</id>
- <phase>test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <skip>${exo.tck.skip}</skip>
- <includes>
- <include>**/util/Sleeping10Seconds.java</include>
- </includes>
- </configuration>
- </execution>
- <execution>
- <id>execution5 - integration tests (TCK)</id>
- <phase>test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <skip>${exo.tck.skip}</skip>
- <argLine>-Xmx512M</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>
- </systemProperties>
- <includes>
- <include>**/api/*Test.java</include>
- <include>**/api/observation/*Test.java</include>
- <include>**/api/lock/*Test.java</include>
- <include>**/api/nodetype/*Test.java</include>
- <include>**/api/query/*Test.java</include>
- <include>**/api/version/*Test.java</include>
- </includes>
<excludes>
+ <exclude>**/TestQueryUsecases.java</exclude>
+ <exclude>**/TestImport.java</exclude>
+ <exclude>**/TestRollbackBigFiles.java</exclude>
+ <exclude>**/TestErrorMultithreading.java</exclude>
+ <exclude>**/api/**/TestSameNameItems.java</exclude>
+ <exclude>**/api/**/TestVersionRestore.java</exclude>
+ <exclude>**/impl/**/TestWorkspaceManagement.java</exclude>
+ <exclude>**/impl/**/TestRepositoryManagement.java</exclude>
+ <exclude>**/impl/**/TestSaveConfiguration.java</exclude>
+ <exclude>**/impl/**/ValueStoragePluginTest.java</exclude>
+ <exclude>**/impl/**/TestWorkspaceRestore.java</exclude>
+ <exclude>**/impl/**/TestSessionCleaner.java</exclude>
+ <exclude>**/impl/**/Base*.java</exclude>
+ <exclude>**/impl/**/TestJCRSerializationStream.java</exclude>
+ <exclude>**/impl/**/TestJCRSerializationVersionRestore.java</exclude>
<exclude>**/api/TestAll.java</exclude>
- <exclude>**/api/**/Abstract*.java</exclude>
- <exclude>**/api/**/FrozenNodeTest.java</exclude>
- <exclude>**/exoplatform/**</exclude>
+ <exclude>**/usecases/**/RemoveSameNameSiblingTest.java</exclude>
+ <exclude>**/usecases/**/TestQueryWithNumberAndSpace.java</exclude>
+ <exclude>**/usecases/BaseUsecasesTest.java</exclude>
+ <exclude>**/apache/**</exclude>
+ <exclude>**/api/**/TestSameNameItems.java</exclude>
+ <exclude>**/api/**/TestVersionRestore.java</exclude>
</excludes>
</configuration>
</execution>
@@ -644,4 +485,126 @@
</plugin>
</plugins>
</build>
+ <profiles>
+ <!-- ***************** -->
+ <!-- INTEGRATION TESTS -->
+ <!-- ***************** -->
+ <!-- Use "mvn -Prun-its" to launch them -->
+ <profile>
+ <id>run-its</id>
+ <dependencies>
+ <!-- TCK binaries and deps for repo stub, some eXo API test -->
+ <dependency>
+ <groupId>org.apache.jackrabbit</groupId>
+ <artifactId>jackrabbit-jcr-tests</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ </exclusions>
+ <scope>test</scope>
+ </dependency>
+ <!-- slf4j-log4j12 for TCK sources -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <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>
+ <!-- normal mode: mvn -Dmaven.test.skip=false -Dexo.tck.skip=false clean install -->
+ <!-- debug mode: mvn -Dmaven.test.skip=false -Dexo.tck.skip=false -DforkMode=never clean install -->
+ <!-- forking: to run both eXo test and TCK use forkMode=once, to run one of them (only) in Eclipse debug use forkMode=never -->
+ <executions>
+ <!--
+ execution> <id>execution2 - pause 10 sec</id> <phase>test</phase> <goals> <goal>test</goal> </goals> <configuration> <skip>${exo.tck.skip}</skip> <includes>
+ <include>**/util/Sleeping10Seconds.java</include> </includes> </configuration> </execution> <execution> <id>execution3 - TCK init section</id> <phase>test</phase> <goals>
+ <goal>test</goal> </goals> <configuration> <skip>${exo.tck.skip}</skip> <argLine>-Xmx512M</argLine> <systemProperties> <property> <name>jcr.test.configuration.file</name>
+ <value>${jcr.test.configuration.file}</value> </property> </systemProperties> <includes> <include>org/exoplatform/services/jcr/integration/PrepareTestRepository.java</include>
+ </includes> </configuration> </execution
+ -->
+ <execution>
+ <id>execution4 - pause 10 sec</id>
+ <phase>test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <includes>
+ <include>**/util/Sleeping10Seconds.java</include>
+ </includes>
+ </configuration>
+ </execution>
+ <execution>
+ <id>execution5 - integration tests (TCK)</id>
+ <phase>test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <argLine>-Xmx512M</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>
+ </systemProperties>
+ <includes>
+ <include>**/api/*Test.java</include>
+ <include>**/api/observation/*Test.java</include>
+ <include>**/api/lock/*Test.java</include>
+ <include>**/api/nodetype/*Test.java</include>
+ <include>**/api/query/*Test.java</include>
+ <include>**/api/version/*Test.java</include>
+ </includes>
+ <excludes>
+ <exclude>**/api/TestAll.java</exclude>
+ <exclude>**/api/**/Abstract*.java</exclude>
+ <exclude>**/api/**/FrozenNodeTest.java</exclude>
+ <exclude>**/exoplatform/**</exclude>
+ </excludes>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
Modified: jcr/trunk/component/core/test-all.cmd
===================================================================
--- jcr/trunk/component/core/test-all.cmd 2009-10-19 08:23:55 UTC (rev 293)
+++ jcr/trunk/component/core/test-all.cmd 2009-10-19 12:40:20 UTC (rev 294)
@@ -1,3 +1,3 @@
-@set MAVEN_OPTS=-Duser.language=en -Duser.region=us %MAVEN_OPTS% -Dmaven.test.skip=false -Dexo.devtest.skip=true -Dexo.tck.skip=false -DforkMode=once
+@set MAVEN_OPTS=-Duser.language=en -Duser.region=us %MAVEN_OPTS% -Dmaven.test.skip=false -Dexo.devtest.skip=true -DforkMode=once
-@start mvn clean test
\ No newline at end of file
+@start mvn clean test -Prun-its
\ No newline at end of file
Modified: jcr/trunk/component/core/test-dev.cmd
===================================================================
--- jcr/trunk/component/core/test-dev.cmd 2009-10-19 08:23:55 UTC (rev 293)
+++ jcr/trunk/component/core/test-dev.cmd 2009-10-19 12:40:20 UTC (rev 294)
@@ -1,3 +1,3 @@
-@set MAVEN_OPTS=-Duser.language=en -Duser.region=us %MAVEN_OPTS% -Dexo.test.skip=true -Dexo.tck.skip=true -Dexo.devtest.skip=false -DforkMode=never
+@set MAVEN_OPTS=-Duser.language=en -Duser.region=us %MAVEN_OPTS% -Dmaven.test.skip=true -Dexo.devtest.skip=false -DforkMode=never
@start mvn clean test
\ No newline at end of file
Modified: jcr/trunk/component/core/test.cmd
===================================================================
--- jcr/trunk/component/core/test.cmd 2009-10-19 08:23:55 UTC (rev 293)
+++ jcr/trunk/component/core/test.cmd 2009-10-19 12:40:20 UTC (rev 294)
@@ -1,3 +1,3 @@
-@set MAVEN_OPTS=-Duser.language=en -Duser.region=us %MAVEN_OPTS% -Dexo.test.skip=false -Dexo.tck.skip=true -Dexo.devtest.skip=true -DforkMode=never
+@set MAVEN_OPTS=-Duser.language=en -Duser.region=us %MAVEN_OPTS% -Dmaven.test.skip=false -Dexo.devtest.skip=true -DforkMode=never
@start mvn clean test
\ No newline at end of file
14 years, 8 months
exo-jcr SVN: r293 - in jcr/trunk/component/core/src/main/java/org/exoplatform/services/jcr: impl/core/nodetype and 1 other directory.
by do-not-reply@jboss.org
Author: skabashnyuk
Date: 2009-10-19 04:23:55 -0400 (Mon, 19 Oct 2009)
New Revision: 293
Modified:
jcr/trunk/component/core/src/main/java/org/exoplatform/services/jcr/core/nodetype/NodeTypeDataManager.java
jcr/trunk/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeDataManagerImpl.java
Log:
EXOJCR-191 : codestyle improvements
Modified: jcr/trunk/component/core/src/main/java/org/exoplatform/services/jcr/core/nodetype/NodeTypeDataManager.java
===================================================================
--- jcr/trunk/component/core/src/main/java/org/exoplatform/services/jcr/core/nodetype/NodeTypeDataManager.java 2009-10-19 07:03:07 UTC (rev 292)
+++ jcr/trunk/component/core/src/main/java/org/exoplatform/services/jcr/core/nodetype/NodeTypeDataManager.java 2009-10-19 08:23:55 UTC (rev 293)
@@ -116,15 +116,6 @@
List<ItemDefinitionData> getManadatoryItemDefs(InternalQName primaryNodeType, InternalQName[] mixinTypes)
throws RepositoryException;
- // /**
- // * @param nodeName
- // * @param nodeTypeName
- // * @param parentTypeName
- // * @return
- // */
- // NodeDefinitionData getChildNodeDefinition(InternalQName nodeName, InternalQName nodeTypeName,
- // InternalQName parentTypeName) throws RepositoryException;
-
/**
* @param typeName
* @return
Modified: jcr/trunk/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeDataManagerImpl.java
===================================================================
--- jcr/trunk/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeDataManagerImpl.java 2009-10-19 07:03:07 UTC (rev 292)
+++ jcr/trunk/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeDataManagerImpl.java 2009-10-19 08:23:55 UTC (rev 293)
@@ -125,7 +125,6 @@
this.accessControlPolicy = config.getAccessControl();
this.nodeTypeRepository = new InmemoryNodeTypeRepository(persister);
- //this.nodeTypeRepository = new PersistedNodeTypeRepository(persister);
this.listeners = Collections.synchronizedMap(new WeakHashMap<NodeTypeManagerListener, NodeTypeManagerListener>());
this.buildInNodeTypesNames = new HashSet<InternalQName>();
}
@@ -144,9 +143,6 @@
{
this.namespaceRegistry = namespaceRegistry;
-
- //this.persister = persister;
-
this.locationFactory = locationFactory;
this.dataManager = dataManager;
this.indexSearcherHolder = indexSearcherHolder;
@@ -425,7 +421,6 @@
public boolean isChildNodePrimaryTypeAllowed(final InternalQName childNodeTypeName,
final InternalQName parentNodeType, final InternalQName[] parentMixinNames) throws RepositoryException
{
- // NodeTypeData childDef = findNodeType(childNodeTypeName);
final Set<InternalQName> testSuperTypesNames = this.nodeTypeRepository.getSupertypes(childNodeTypeName);
NodeDefinitionData[] allChildNodeDefinitions = getAllChildNodeDefinitions(parentNodeType);
for (final NodeDefinitionData cnd : allChildNodeDefinitions)
@@ -570,7 +565,6 @@
// validate
nodeTypeDataValidator.validateNodeType(nodeTypes);
- //registerNodeType(nodeTypes, alreadyExistsBehaviour);
nodeTypeRepository.registerNodeType(nodeTypes, this, accessControlPolicy, alreadyExistsBehaviour);
return nodeTypes;
}
@@ -590,7 +584,6 @@
// validate
nodeTypeDataValidator.validateNodeType(nodeTypes);
- //registerNodeType(nodeTypes, alreadyExistsBehaviour);
nodeTypeRepository.registerNodeType(nodeTypes, this, accessControlPolicy, alreadyExistsBehaviour);
return nodeTypes;
@@ -698,64 +691,54 @@
return changesLog;
}
+ /**
+ *
+ * @see org.picocontainer.Startable#start()
+ */
public void start()
-
{
if (!started)
{
try
{
- final InputStream xml = NodeTypeManagerImpl.class.getResourceAsStream(NODETYPES_FILE);
- if (xml != null)
+ // check if default node type saved
+ if (!nodeTypeRepository.isStorageFilled())
{
+ final InputStream xml = NodeTypeManagerImpl.class.getResourceAsStream(NODETYPES_FILE);
- final NodeTypeConverter nodeTypeConverter =
- new NodeTypeConverter(this.locationFactory, this.accessControlPolicy);
- final NodeTypeDataValidator nodeTypeDataValidator = new NodeTypeDataValidator(this.nodeTypeRepository);
- final NodeTypeDataPersister serializer = new XmlNodeTypeDataPersister(nodeTypeConverter, xml);
-
- final List<NodeTypeData> defaultNodeTypes = serializer.getAllNodeTypes();
-
- // validate
- nodeTypeDataValidator.validateNodeType(defaultNodeTypes);
-
- // check if default node type saved
- if (!nodeTypeRepository.isStorageFilled())
+ if (xml != null)
{
-
- //registerNodeType(defaultNodeTypes, ExtendedNodeTypeManager.IGNORE_IF_EXISTS);
- nodeTypeRepository.registerNodeType(defaultNodeTypes, this, accessControlPolicy,
- ExtendedNodeTypeManager.IGNORE_IF_EXISTS);
- }
- else
- {
- final List<NodeTypeData> allNodeTypes = nodeTypeRepository.getAllNodeTypes();
- // register nodetypes in runtime
- final Map<InternalQName, NodeTypeData> volatileNodeTypes = new HashMap<InternalQName, NodeTypeData>();
-
- for (final NodeTypeData nodeTypeData : allNodeTypes)
+ List<NodeTypeData> registerNodeTypes =
+ registerNodeTypes(xml, ExtendedNodeTypeManager.IGNORE_IF_EXISTS, TEXT_XML);
+ for (NodeTypeData nodeTypeData : registerNodeTypes)
{
- volatileNodeTypes.put(nodeTypeData.getName(), nodeTypeData);
+ buildInNodeTypesNames.add(nodeTypeData.getName());
}
-
- for (final NodeTypeData nodeTypeData : allNodeTypes)
- {
- this.nodeTypeRepository.addNodeType(nodeTypeData, volatileNodeTypes);
- }
}
- // fill default node types map
- for (final NodeTypeData nodeTypeData : defaultNodeTypes)
+ else
{
- this.buildInNodeTypesNames.add(nodeTypeData.getName());
+ throw new RuntimeException("Resource file '" + NODETYPES_FILE
+ + "' with NodeTypes configuration does not found. Can not create node type manager");
}
-
}
else
{
- throw new RuntimeException("Resource file '" + NODETYPES_FILE
- + "' with NodeTypes configuration does not found. Can not create node type manager");
+ final List<NodeTypeData> allNodeTypes = nodeTypeRepository.getAllNodeTypes();
+ // register nodetypes in runtime
+ final Map<InternalQName, NodeTypeData> volatileNodeTypes = new HashMap<InternalQName, NodeTypeData>();
+ //create map from list
+ for (final NodeTypeData nodeTypeData : allNodeTypes)
+ {
+ volatileNodeTypes.put(nodeTypeData.getName(), nodeTypeData);
+ }
+
+ for (final NodeTypeData nodeTypeData : allNodeTypes)
+ {
+ this.nodeTypeRepository.addNodeType(nodeTypeData, volatileNodeTypes);
+ }
}
+
}
catch (final RepositoryException e)
{
@@ -765,6 +748,10 @@
}
}
+ /**
+ *
+ * @see org.picocontainer.Startable#stop()
+ */
public void stop()
{
}
@@ -981,42 +968,4 @@
return changesLog;
}
-
- protected void initDefault() throws RepositoryException
- {
- long start = System.currentTimeMillis();
- try
- {
- InputStream xml = NodeTypeManagerImpl.class.getResourceAsStream(NODETYPES_FILE);
- if (xml != null)
- {
- List<NodeTypeData> registerNodeTypes =
- registerNodeTypes(xml, ExtendedNodeTypeManager.IGNORE_IF_EXISTS, TEXT_XML);
- for (NodeTypeData nodeTypeData : registerNodeTypes)
- {
- buildInNodeTypesNames.add(nodeTypeData.getName());
- }
- }
- else
- {
- String msg =
- "Resource file '" + NODETYPES_FILE
- + "' with NodeTypes configuration does not found. Can not create node type manager";
- log.error(msg);
- throw new RepositoryException(msg);
- }
- }
- catch (RepositoryException e)
- {
- String msg =
- "Error of initialization default types. Resource file with NodeTypes configuration '" + NODETYPES_FILE
- + "'. " + e;
- log.error(msg);
- throw new RepositoryException(msg, e);
- }
- finally
- {
- log.info("Initialization of default nodetypes done. " + (System.currentTimeMillis() - start) + " ms.");
- }
- }
}
14 years, 8 months
exo-jcr SVN: r292 - in ws/branches/2.2.x/rest: core/src/main/java/org/exoplatform/services/rest/impl and 11 other directories.
by do-not-reply@jboss.org
Author: aparfonov
Date: 2009-10-19 03:03:07 -0400 (Mon, 19 Oct 2009)
New Revision: 292
Added:
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/DependencySupplier.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ApplicationDeployer.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ResourceBinderImpl.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/RestComponentDeployer.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/RestComponentResolver.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/SimpleDependencySupplier.java
Removed:
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/DependencyInjector.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/BaseResourceBinder.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/SimpleDependencyInjector.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ContainerObjectFactory.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/impl/ExoContainerDependencyInjector.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/impl/ExoContainerResourceBinder.java
Modified:
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ApplicationContext.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ComponentLifecycleScope.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/Inject.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ResourceBinder.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ApplicationContextImpl.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ConstructorDescriptorImpl.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/FieldInjectorImpl.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/FilterDescriptorImpl.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ProviderBinder.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/RequestDispatcher.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/RequestHandlerImpl.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/method/InjectableProvider.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/method/ParameterHelper.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/method/ParameterResolverFactory.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/provider/ProviderDescriptorImpl.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/resource/AbstractResourceDescriptorImpl.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/RestInitializedListener.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/wadl/WadlProcessor.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/BaseTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/RequestDispatcherTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/ResourceBinderTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/AnnotationInheritanceTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/ApplicationTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/ResourceDescriptorTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/ResourceDescriptorValidatorTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/wadl/WadlProcessorTest.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/impl/RestInitializer.java
ws/branches/2.2.x/rest/ext/src/test/java/conf/standalone/test-configuration.xml
Log:
EXOJCR-185 :
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ApplicationContext.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ApplicationContext.java 2009-10-16 15:45:39 UTC (rev 291)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ApplicationContext.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -82,7 +82,7 @@
GenericContainerResponse getContainerResponse();
- DependencyInjector getDependencyInjector();
+ DependencySupplier getDependencyInjector();
/**
* @return See {@link HttpHeaders}
@@ -126,7 +126,7 @@
*/
UriInfo getUriInfo();
- void setDependencyInjector(DependencyInjector depInjector);
+ void setDependencyInjector(DependencySupplier depInjector);
/**
* Pass in context list of path template parameters @see {@link UriPattern}.
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ComponentLifecycleScope.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ComponentLifecycleScope.java 2009-10-16 15:45:39 UTC (rev 291)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ComponentLifecycleScope.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -30,8 +30,4 @@
* Singleton lifecycle.
*/
SINGLETON,
- /**
- * Inversion-of-control framework controls component's lifecycle.
- */
- IOC
}
Deleted: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/DependencyInjector.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/DependencyInjector.java 2009-10-16 15:45:39 UTC (rev 291)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/DependencyInjector.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -1,43 +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.rest;
-
-import java.lang.reflect.Type;
-
-/**
- * Implementation of DependencyInjector should be able to provide
- * objects that required for constructors or fields of Resource or Provider.
- *
- * @author <a href="mailto:andrey.parfonov@exoplatform.com">Andrey Parfonov</a>
- * @version $Id$
- */
-public interface DependencyInjector
-{
-
- /**
- * Get single parameter of type <code>type</code>.
- *
- * @param type class of required parameter
- * @param the type of object to be produced
- * @return object of required type or null if instance of <code>type</code>
- * may not be produced
- */
- Object getInjectableParameter(Class<?> type, Type genericType);
-
-}
Copied: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/DependencySupplier.java (from rev 291, ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/DependencyInjector.java)
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/DependencySupplier.java (rev 0)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/DependencySupplier.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -0,0 +1,40 @@
+/*
+ * 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.rest;
+
+/**
+ * Implementation of DependencySupplier should be able to provide
+ * objects that required for constructors or fields of Resource or Provider.
+ *
+ * @author <a href="mailto:andrey.parfonov@exoplatform.com">Andrey Parfonov</a>
+ * @version $Id$
+ */
+public interface DependencySupplier
+{
+
+ /**
+ * Get object of <code>type</code>.
+ *
+ * @param parameter required parameter description
+ * @return object of required type or null if instance described by
+ * <code>parameter</code> may not be produced
+ */
+ Object getInstanceOfType(Parameter parameter);
+
+}
Property changes on: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/DependencySupplier.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/Inject.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/Inject.java 2009-10-16 15:45:39 UTC (rev 291)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/Inject.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -25,7 +25,7 @@
/**
* Used to annotate fields that should be injected with instances
- * provided by {@link DependencyInjector}. If DependencyInjector
+ * provided by {@link DependencySupplier}. If DependencyInjector
* is not available than field will be not initialized
* @author <a href="mailto:andrey.parfonov@exoplatform.com">Andrey Parfonov</a>
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ResourceBinder.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ResourceBinder.java 2009-10-16 15:45:39 UTC (rev 291)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ResourceBinder.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -22,8 +22,6 @@
import java.util.List;
-import javax.ws.rs.core.Application;
-
/**
* Manages root resources.
*
@@ -33,12 +31,6 @@
public interface ResourceBinder
{
/**
- * @param application Application
- * @see Application
- */
- void addApplication(Application application);
-
- /**
* @param resourceClass class of candidate to be root resource
* @return true if resource was bound and false if resource was not bound
* cause it is not root resource
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ApplicationContextImpl.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ApplicationContextImpl.java 2009-10-16 15:45:39 UTC (rev 291)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ApplicationContextImpl.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -19,7 +19,7 @@
package org.exoplatform.services.rest.impl;
import org.exoplatform.services.rest.ApplicationContext;
-import org.exoplatform.services.rest.DependencyInjector;
+import org.exoplatform.services.rest.DependencySupplier;
import org.exoplatform.services.rest.GenericContainerRequest;
import org.exoplatform.services.rest.GenericContainerResponse;
import org.exoplatform.services.rest.InitialProperties;
@@ -159,7 +159,7 @@
*/
private MultivaluedMap<String, String> queryParameters;
- private DependencyInjector depInjector;
+ private DependencySupplier depInjector;
/**
* Constructs new instance of ApplicationContext.
@@ -255,7 +255,7 @@
/**
* {@inheritDoc}
*/
- public DependencyInjector getDependencyInjector()
+ public DependencySupplier getDependencyInjector()
{
return depInjector;
}
@@ -484,7 +484,7 @@
/**
* {@inheritDoc}
*/
- public void setDependencyInjector(DependencyInjector depInjector)
+ public void setDependencyInjector(DependencySupplier depInjector)
{
this.depInjector = depInjector;
}
Added: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ApplicationDeployer.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ApplicationDeployer.java (rev 0)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ApplicationDeployer.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -0,0 +1,50 @@
+/*
+ * 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.rest.impl;
+
+import org.exoplatform.services.rest.ResourceBinder;
+
+import javax.ws.rs.core.Application;
+
+/**
+ * @author <a href="mailto:andrey.parfonov@exoplatform.com">Andrey Parfonov</a>
+ * @version $Id: $
+ */
+public class ApplicationDeployer extends RestComponentDeployer
+{
+
+ public ApplicationDeployer(ResourceBinder resources, ProviderBinder providers)
+ {
+ super(resources, providers);
+ }
+
+ @SuppressWarnings("unchecked")
+ public void deploy(Application application)
+ {
+ for (Object instance : application.getSingletons())
+ {
+ deploy(instance);
+ }
+ for (Class clazz : application.getClasses())
+ {
+ deploy(clazz);
+ }
+ }
+
+}
Property changes on: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ApplicationDeployer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/BaseResourceBinder.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/BaseResourceBinder.java 2009-10-16 15:45:39 UTC (rev 291)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/BaseResourceBinder.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -1,435 +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.rest.impl;
-
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
-import org.exoplatform.services.rest.Filter;
-import org.exoplatform.services.rest.ObjectFactory;
-import org.exoplatform.services.rest.PerRequestObjectFactory;
-import org.exoplatform.services.rest.RequestFilter;
-import org.exoplatform.services.rest.ResourceBinder;
-import org.exoplatform.services.rest.ResponseFilter;
-import org.exoplatform.services.rest.SingletonObjectFactory;
-import org.exoplatform.services.rest.impl.resource.AbstractResourceDescriptorImpl;
-import org.exoplatform.services.rest.impl.resource.ResourceDescriptorValidator;
-import org.exoplatform.services.rest.method.MethodInvokerFilter;
-import org.exoplatform.services.rest.resource.AbstractResourceDescriptor;
-import org.exoplatform.services.rest.resource.ResourceDescriptorVisitor;
-import org.exoplatform.services.rest.uri.UriPattern;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.ws.rs.Path;
-import javax.ws.rs.core.Application;
-import javax.ws.rs.ext.ContextResolver;
-import javax.ws.rs.ext.ExceptionMapper;
-import javax.ws.rs.ext.MessageBodyReader;
-import javax.ws.rs.ext.MessageBodyWriter;
-import javax.ws.rs.ext.Provider;
-import javax.ws.rs.ext.RuntimeDelegate;
-
-/**
- * @author <a href="mailto:andrew00x@gmail.com">Andrey Parfonov</a>
- * @version $Id$
- */
-public class BaseResourceBinder implements ResourceBinder
-{
-
- /**
- * Logger.
- */
- private static final Log LOG = ExoLogger.getLogger(BaseResourceBinder.class.getName());
-
- private static final Comparator<ObjectFactory<AbstractResourceDescriptor>> RESOURCE_COMPARATOR =
- new ResourceComparator();
-
- /**
- * Compare two {@link SingletonResourceFactory}.
- */
- private static final class ResourceComparator implements Comparator<ObjectFactory<AbstractResourceDescriptor>>
- {
- /**
- * Compare two ResourceClass for order.
- *
- * @param o1 first ResourceClass to be compared
- * @param o2 second ResourceClass to be compared
- * @return positive , zero or negative dependent of {@link UriPattern}
- * comparison
- * @see Comparator#compare(Object, Object)
- * @see UriPattern
- * @see UriPattern#URIPATTERN_COMPARATOR
- */
- public int compare(ObjectFactory<AbstractResourceDescriptor> o1, ObjectFactory<AbstractResourceDescriptor> o2)
- {
- return UriPattern.URIPATTERN_COMPARATOR.compare(o1.getObjectModel().getUriPattern(), o2.getObjectModel()
- .getUriPattern());
- }
- };
-
- /**
- * Root resource descriptors.
- */
- private final List<ObjectFactory<AbstractResourceDescriptor>> rootResources =
- new ArrayList<ObjectFactory<AbstractResourceDescriptor>>();
-
- /**
- * Validator.
- */
- private final ResourceDescriptorVisitor rdv = ResourceDescriptorValidator.getInstance();
-
- private int size = 0;
-
- public BaseResourceBinder()
- {
- // Initialize RuntimeDelegate instance
- // This is first component in life cycle what needs.
- // TODO better solution to initialize RuntimeDelegate
- RuntimeDelegate rd = new RuntimeDelegateImpl();
- RuntimeDelegate.setInstance(rd);
- }
-
- /**
- * @param application Application
- * @see Application
- */
- @SuppressWarnings("unchecked")
- public void addApplication(Application application)
- {
- ProviderBinder providers = ProviderBinder.getInstance();
- for (Object obj : application.getSingletons())
- {
- if (obj.getClass().getAnnotation(Provider.class) != null)
- {
- // singleton provider
- if (obj instanceof ContextResolver)
- {
- providers.addContextResolver((ContextResolver)obj);
- }
- if (obj instanceof ExceptionMapper)
- {
- providers.addExceptionMapper((ExceptionMapper)obj);
- }
- if (obj instanceof MessageBodyReader)
- {
- providers.addMessageBodyReader((MessageBodyReader)obj);
- }
- if (obj instanceof MessageBodyWriter)
- {
- providers.addMessageBodyWriter((MessageBodyWriter)obj);
- }
- }
- else if (obj.getClass().getAnnotation(Filter.class) != null)
- {
- // singleton filter
- if (obj instanceof MethodInvokerFilter)
- {
- providers.addMethodInvokerFilter((MethodInvokerFilter)obj);
- }
- if (obj instanceof RequestFilter)
- {
- providers.addRequestFilter((RequestFilter)obj);
- }
- if (obj instanceof ResponseFilter)
- {
- providers.addResponseFilter((ResponseFilter)obj);
- }
- }
- else
- {
- bind(obj); // singleton resource
- }
- }
- for (Class clazz : application.getClasses())
- {
- if (clazz.getAnnotation(Provider.class) != null)
- {
- // per-request provider
- if (ContextResolver.class.isAssignableFrom(clazz))
- {
- providers.addContextResolver(clazz);
- }
- if (ExceptionMapper.class.isAssignableFrom(clazz))
- {
- providers.addExceptionMapper(clazz);
- }
- if (MessageBodyReader.class.isAssignableFrom(clazz))
- {
- providers.addMessageBodyReader(clazz);
- }
- if (MessageBodyWriter.class.isAssignableFrom(clazz))
- {
- providers.addMessageBodyWriter(clazz);
- }
- }
- else if (clazz.getAnnotation(Filter.class) != null)
- {
- // per-request filter
- if (MethodInvokerFilter.class.isAssignableFrom(clazz))
- {
- providers.addMethodInvokerFilter(clazz);
- }
- if (RequestFilter.class.isAssignableFrom(clazz))
- {
- providers.addRequestFilter(clazz);
- }
- if (ResponseFilter.class.isAssignableFrom(clazz))
- {
- providers.addResponseFilter(clazz);
- }
- }
- else
- {
- bind(clazz); // per-request resource
- }
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean bind(final Object resource)
- {
- final Path path = resource.getClass().getAnnotation(Path.class);
-
- AbstractResourceDescriptor descriptor = null;
- if (path != null)
- {
- try
- {
- descriptor = new AbstractResourceDescriptorImpl(resource);
- }
- catch (Exception e)
- {
- String msg = "Unexpected error occurs when process resource class " + resource.getClass().getName();
- LOG.error(msg, e);
- return false;
- }
- }
- else
- {
- String msg =
- "Resource class " + resource.getClass().getName() + " it is not root resource. "
- + "Path annotation javax.ws.rs.Path is not specified for this class.";
- LOG.warn(msg);
- return false;
- }
-
- // validate AbstractResourceDescriptor
- try
- {
- descriptor.accept(rdv);
- }
- catch (Exception e)
- {
- LOG.error("Validation of root resource failed. ", e);
- return false;
- }
-
- synchronized (rootResources)
- {
- // check does exist other resource with the same URI pattern
- for (ObjectFactory<AbstractResourceDescriptor> exist : rootResources)
- {
- if (exist.getObjectModel().getUriPattern().equals(descriptor.getUriPattern()))
- {
- String msg =
- "Resource class " + descriptor.getObjectClass().getName() + " can't be registered. Resource class "
- + exist.getClass().getName() + " with the same pattern "
- + exist.getObjectModel().getUriPattern().getTemplate() + " already registered.";
- LOG.warn(msg);
- return false;
- }
- }
-
- // Singleton resource
- ObjectFactory<AbstractResourceDescriptor> res =
- new SingletonObjectFactory<AbstractResourceDescriptor>(descriptor, resource);
- rootResources.add(res);
- Collections.sort(rootResources, RESOURCE_COMPARATOR);
- LOG.info("Bind new resource " + res.getObjectModel().getUriPattern().getTemplate() + " : "
- + descriptor.getObjectClass());
- }
- size++;
- return true;
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean bind(final Class<?> resourceClass)
- {
- final Path path = resourceClass.getAnnotation(Path.class);
-
- AbstractResourceDescriptor descriptor = null;
- if (path != null)
- {
- try
- {
- descriptor = new AbstractResourceDescriptorImpl(resourceClass);
- }
- catch (Exception e)
- {
- String msg = "Unexpected error occurs when process resource class " + resourceClass.getName();
- LOG.error(msg, e);
- return false;
- }
- }
- else
- {
- String msg =
- "Resource class " + resourceClass.getName() + " it is not root resource. "
- + "Path annotation javax.ws.rs.Path is not specified for this class.";
- LOG.warn(msg);
- return false;
- }
-
- // validate AbstractResourceDescriptor
- try
- {
- descriptor.accept(rdv);
- }
- catch (Exception e)
- {
- LOG.error("Validation of root resource failed. ", e);
- return false;
- }
-
- synchronized (rootResources)
- {
- // check does exist other resource with the same URI pattern
- for (ObjectFactory<AbstractResourceDescriptor> exist : rootResources)
- {
- AbstractResourceDescriptor existDescriptor = exist.getObjectModel();
- if (exist.getObjectModel().getUriPattern().equals(descriptor.getUriPattern()))
- {
-
- String msg =
- "Resource class " + descriptor.getObjectClass().getName() + " can't be registered. Resource class "
- + existDescriptor.getObjectClass().getName() + " with the same pattern "
- + exist.getObjectModel().getUriPattern().getTemplate() + " already registered.";
- LOG.warn(msg);
- return false;
- }
- }
- // per-request resource
- ObjectFactory<AbstractResourceDescriptor> res =
- new PerRequestObjectFactory<AbstractResourceDescriptor>(descriptor);
- rootResources.add(res);
- Collections.sort(rootResources, RESOURCE_COMPARATOR);
- LOG.info("Bind new resource " + res.getObjectModel().getUriPattern().getRegex() + " : " + resourceClass);
- }
- size++;
- return true;
- }
-
- /**
- * {@inheritDoc}
- */
- @SuppressWarnings("unchecked")
- public boolean unbind(Class clazz)
- {
- synchronized (rootResources)
- {
- Iterator<ObjectFactory<AbstractResourceDescriptor>> i = rootResources.iterator();
- while (i.hasNext())
- {
- ObjectFactory<AbstractResourceDescriptor> res = i.next();
- Class c = res.getObjectModel().getObjectClass();
- if (clazz.equals(c))
- {
- i.remove();
- LOG.info("Remove ResourceContainer " + res.getObjectModel().getUriPattern().getTemplate() + " : " + c);
- size--;
- return true;
- }
- }
- return false;
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean unbind(String uriTemplate)
- {
- synchronized (rootResources)
- {
- Iterator<ObjectFactory<AbstractResourceDescriptor>> i = rootResources.iterator();
- while (i.hasNext())
- {
- ObjectFactory<AbstractResourceDescriptor> res = i.next();
- String t = res.getObjectModel().getUriPattern().getTemplate();
- if (t.equals(uriTemplate))
- {
- i.remove();
- LOG.info("Remove ResourceContainer " + res.getObjectModel().getUriPattern().getTemplate());
- size--;
- return true;
- }
- }
- return false;
- }
- }
-
- /**
- * Clear the list of ResourceContainer description.
- */
- public void clear()
- {
- rootResources.clear();
- size = 0;
- }
-
- /**
- * {@inheritDoc}
- */
- public List<ObjectFactory<AbstractResourceDescriptor>> getResources()
- {
- return rootResources;
- }
-
- /**
- * {@inheritDoc}
- */
- public int getSize()
- {
- return size;
- }
-
- /**
- * @return all registered root resources
- */
- @Deprecated
- public List<AbstractResourceDescriptor> getRootResources()
- {
- List<AbstractResourceDescriptor> l = new ArrayList<AbstractResourceDescriptor>(rootResources.size());
- synchronized (rootResources)
- {
- for (ObjectFactory<AbstractResourceDescriptor> f : rootResources)
- l.add(f.getObjectModel());
- }
- return l;
- }
-
-}
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ConstructorDescriptorImpl.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ConstructorDescriptorImpl.java 2009-10-16 15:45:39 UTC (rev 291)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ConstructorDescriptorImpl.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -254,7 +254,7 @@
.type(MediaType.TEXT_PLAIN).build());
}
- Object tmp = context.getDependencyInjector().getInjectableParameter(cp.getParameterClass(), null);
+ Object tmp = context.getDependencyInjector().getInstanceOfType(cp);
if (tmp == null)
{
String msg =
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/FieldInjectorImpl.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/FieldInjectorImpl.java 2009-10-16 15:45:39 UTC (rev 291)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/FieldInjectorImpl.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -74,7 +74,6 @@
*/
private final boolean encoded;
-
/** See {@link java.lang.reflect.Field} . */
private final java.lang.reflect.Field jfield;
@@ -225,7 +224,29 @@
throw new WebApplicationException(e, Response.status(Response.Status.BAD_REQUEST).build());
}
}
+ else
+ {
+ if (context.getDependencyInjector() != null)
+ {
+ Object tmp = context.getDependencyInjector().getInstanceOfType(this);
+ if (tmp != null)
+ {
+ try
+ {
+ if (!Modifier.isPublic(jfield.getModifiers()))
+ jfield.setAccessible(true);
+ jfield.set(resource, tmp);
+ }
+ catch (Throwable e)
+ {
+ // TODO check exception type
+ throw new WebApplicationException(e, Response.status(Response.Status.BAD_REQUEST).build());
+ }
+ }
+ }
+ }
+
}
/**
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/FilterDescriptorImpl.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/FilterDescriptorImpl.java 2009-10-16 15:45:39 UTC (rev 291)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/FilterDescriptorImpl.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -68,27 +68,11 @@
private final List<FieldInjector> fields;
/**
- * @param filterClass {@link Class} of filter
- */
- public FilterDescriptorImpl(Class<?> filterClass)
- {
- this(filterClass, ComponentLifecycleScope.PER_REQUEST);
- }
-
- /**
- * @param filter instance
- */
- public FilterDescriptorImpl(Object filter)
- {
- this(filter.getClass(), ComponentLifecycleScope.SINGLETON);
- }
-
- /**
* @param filterClass filter class
* @param scope filter scope
* @see ComponentLifecycleScope
*/
- private FilterDescriptorImpl(Class<?> filterClass, ComponentLifecycleScope scope)
+ public FilterDescriptorImpl(Class<?> filterClass, ComponentLifecycleScope scope)
{
final Path p = filterClass.getAnnotation(Path.class);
if (p != null)
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ProviderBinder.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ProviderBinder.java 2009-10-16 15:45:39 UTC (rev 291)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ProviderBinder.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -20,6 +20,7 @@
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
+import org.exoplatform.services.rest.ComponentLifecycleScope;
import org.exoplatform.services.rest.FilterDescriptor;
import org.exoplatform.services.rest.ObjectFactory;
import org.exoplatform.services.rest.PerRequestObjectFactory;
@@ -241,7 +242,7 @@
{
try
{
- ProviderDescriptor descriptor = new ProviderDescriptorImpl(clazz);
+ ProviderDescriptor descriptor = new ProviderDescriptorImpl(clazz, ComponentLifecycleScope.PER_REQUEST);
descriptor.accept(rdv);
addContextResolver(new PerRequestObjectFactory<ProviderDescriptor>(descriptor));
@@ -263,7 +264,7 @@
Class<? extends ContextResolver> clazz = instance.getClass();
try
{
- ProviderDescriptor descriptor = new ProviderDescriptorImpl(clazz);
+ ProviderDescriptor descriptor = new ProviderDescriptorImpl(clazz, ComponentLifecycleScope.SINGLETON);
descriptor.accept(rdv);
addContextResolver(new SingletonObjectFactory<ProviderDescriptor>(descriptor, instance));
@@ -325,7 +326,8 @@
{
try
{
- addExceptionMapper(new PerRequestObjectFactory(new ProviderDescriptorImpl(clazz)));
+ addExceptionMapper(new PerRequestObjectFactory(new ProviderDescriptorImpl(clazz,
+ ComponentLifecycleScope.PER_REQUEST)));
}
catch (Exception e)
{
@@ -344,7 +346,8 @@
Class<? extends ExceptionMapper> clazz = instance.getClass();
try
{
- addExceptionMapper(new SingletonObjectFactory(new ProviderDescriptorImpl(clazz), instance));
+ addExceptionMapper(new SingletonObjectFactory(new ProviderDescriptorImpl(clazz,
+ ComponentLifecycleScope.SINGLETON), instance));
}
catch (Exception e)
{
@@ -389,7 +392,7 @@
{
try
{
- ProviderDescriptor descriptor = new ProviderDescriptorImpl(clazz);
+ ProviderDescriptor descriptor = new ProviderDescriptorImpl(clazz, ComponentLifecycleScope.PER_REQUEST);
descriptor.accept(rdv);
addMessageBodyReader(new PerRequestObjectFactory<ProviderDescriptor>(descriptor));
@@ -411,7 +414,7 @@
Class<? extends MessageBodyReader> clazz = instance.getClass();
try
{
- ProviderDescriptor descriptor = new ProviderDescriptorImpl(clazz);
+ ProviderDescriptor descriptor = new ProviderDescriptorImpl(clazz, ComponentLifecycleScope.SINGLETON);
descriptor.accept(rdv);
addMessageBodyReader(new SingletonObjectFactory(descriptor, instance));
@@ -442,9 +445,9 @@
{
try
{
- ProviderDescriptor descriptor = new ProviderDescriptorImpl(clazz);
+ ProviderDescriptor descriptor = new ProviderDescriptorImpl(clazz, ComponentLifecycleScope.PER_REQUEST);
descriptor.accept(rdv);
-
+
addMessageBodyWriter(new PerRequestObjectFactory<ProviderDescriptor>(descriptor));
}
catch (Exception e)
@@ -464,7 +467,7 @@
Class<? extends MessageBodyWriter> clazz = instance.getClass();
try
{
- ProviderDescriptor descriptor = new ProviderDescriptorImpl(clazz);
+ ProviderDescriptor descriptor = new ProviderDescriptorImpl(clazz, ComponentLifecycleScope.SINGLETON);
descriptor.accept(rdv);
addMessageBodyWriter(new SingletonObjectFactory<ProviderDescriptor>(descriptor, instance));
@@ -484,8 +487,7 @@
for (MediaType mime : writerFactory.getObjectModel().produces())
writeProviders.getList(mime).add(writerFactory);
}
-
-
+
/**
* Get list of most acceptable writer's media type for specified type.
*
@@ -596,9 +598,9 @@
{
try
{
- FilterDescriptor descriptor = new FilterDescriptorImpl(clazz);
+ FilterDescriptor descriptor = new FilterDescriptorImpl(clazz, ComponentLifecycleScope.PER_REQUEST);
descriptor.accept(rdv);
-
+
addMethodInvokerFilter(new PerRequestObjectFactory<FilterDescriptor>(descriptor));
}
catch (Exception e)
@@ -617,9 +619,9 @@
Class<? extends MethodInvokerFilter> clazz = instance.getClass();
try
{
- FilterDescriptor descriptor = new FilterDescriptorImpl(clazz);
+ FilterDescriptor descriptor = new FilterDescriptorImpl(clazz, ComponentLifecycleScope.SINGLETON);
descriptor.accept(rdv);
-
+
addMethodInvokerFilter(new SingletonObjectFactory<FilterDescriptor>(descriptor, instance));
}
catch (Exception e)
@@ -627,7 +629,7 @@
LOG.error("Failed add RequestFilter " + clazz.getName(), e);
}
}
-
+
protected void addMethodInvokerFilter(ObjectFactory<FilterDescriptor> filterFactory)
{
invokerFilters.getList(filterFactory.getObjectModel().getUriPattern()).add(filterFactory);
@@ -642,7 +644,7 @@
{
try
{
- FilterDescriptor descriptor = new FilterDescriptorImpl(clazz);
+ FilterDescriptor descriptor = new FilterDescriptorImpl(clazz, ComponentLifecycleScope.PER_REQUEST);
descriptor.accept(rdv);
addRequestFilter(new PerRequestObjectFactory<FilterDescriptor>(descriptor));
@@ -663,7 +665,7 @@
Class<? extends RequestFilter> clazz = instance.getClass();
try
{
- FilterDescriptor descriptor = new FilterDescriptorImpl(clazz);
+ FilterDescriptor descriptor = new FilterDescriptorImpl(clazz, ComponentLifecycleScope.SINGLETON);
descriptor.accept(rdv);
addRequestFilter(new SingletonObjectFactory<FilterDescriptor>(descriptor, instance));
@@ -673,8 +675,8 @@
LOG.error("Failed add RequestFilter " + clazz.getName(), e);
}
}
-
- protected void addRequestFilter(ObjectFactory<FilterDescriptor> filterFactory)
+
+ protected void addRequestFilter(ObjectFactory<FilterDescriptor> filterFactory)
{
requestFilters.getList(filterFactory.getObjectModel().getUriPattern()).add(filterFactory);
}
@@ -688,7 +690,7 @@
{
try
{
- FilterDescriptor descriptor = new FilterDescriptorImpl(clazz);
+ FilterDescriptor descriptor = new FilterDescriptorImpl(clazz, ComponentLifecycleScope.PER_REQUEST);
descriptor.accept(rdv);
addResponseFilter(new PerRequestObjectFactory<FilterDescriptor>(descriptor));
@@ -709,7 +711,7 @@
Class<? extends ResponseFilter> clazz = instance.getClass();
try
{
- FilterDescriptor descriptor = new FilterDescriptorImpl(clazz);
+ FilterDescriptor descriptor = new FilterDescriptorImpl(clazz, ComponentLifecycleScope.SINGLETON);
descriptor.accept(rdv);
addResponseFilter(new SingletonObjectFactory<FilterDescriptor>(descriptor, instance));
@@ -719,7 +721,7 @@
LOG.error("Failed add ResponseFilter " + clazz.getName(), e);
}
}
-
+
protected void addResponseFilter(ObjectFactory<FilterDescriptor> filterFactory)
{
responseFilters.getList(filterFactory.getObjectModel().getUriPattern()).add(filterFactory);
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/RequestDispatcher.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/RequestDispatcher.java 2009-10-16 15:45:39 UTC (rev 291)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/RequestDispatcher.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -21,6 +21,7 @@
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
import org.exoplatform.services.rest.ApplicationContext;
+import org.exoplatform.services.rest.ComponentLifecycleScope;
import org.exoplatform.services.rest.GenericContainerRequest;
import org.exoplatform.services.rest.GenericContainerResponse;
import org.exoplatform.services.rest.ObjectFactory;
@@ -332,7 +333,8 @@
MethodInvoker invoker = srld.getMethodInvoker();
resource = invoker.invokeMethod(resource, srld, context);
- AbstractResourceDescriptor descriptor = new AbstractResourceDescriptorImpl(resource);
+ AbstractResourceDescriptor descriptor =
+ new AbstractResourceDescriptorImpl(resource.getClass(), ComponentLifecycleScope.SINGLETON);
SingletonObjectFactory<AbstractResourceDescriptor> locResource =
new SingletonObjectFactory<AbstractResourceDescriptor>(descriptor, resource);
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/RequestHandlerImpl.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/RequestHandlerImpl.java 2009-10-16 15:45:39 UTC (rev 291)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/RequestHandlerImpl.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -33,7 +33,7 @@
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
import org.exoplatform.services.rest.ApplicationContext;
-import org.exoplatform.services.rest.DependencyInjector;
+import org.exoplatform.services.rest.DependencySupplier;
import org.exoplatform.services.rest.FilterDescriptor;
import org.exoplatform.services.rest.GenericContainerRequest;
import org.exoplatform.services.rest.GenericContainerResponse;
@@ -114,9 +114,9 @@
*/
private final ResourceBinder binder;
- private final DependencyInjector depInjector;
+ private final DependencySupplier depInjector;
- public RequestHandlerImpl(ResourceBinder binder, DependencyInjector depInjector)
+ public RequestHandlerImpl(ResourceBinder binder, DependencySupplier depInjector)
{
this.binder = binder;
this.dispatcher = new RequestDispatcher(binder);
Copied: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ResourceBinderImpl.java (from rev 291, ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/BaseResourceBinder.java)
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ResourceBinderImpl.java (rev 0)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ResourceBinderImpl.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -0,0 +1,330 @@
+/*
+ * 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.rest.impl;
+
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+import org.exoplatform.services.rest.ComponentLifecycleScope;
+import org.exoplatform.services.rest.ObjectFactory;
+import org.exoplatform.services.rest.PerRequestObjectFactory;
+import org.exoplatform.services.rest.ResourceBinder;
+import org.exoplatform.services.rest.SingletonObjectFactory;
+import org.exoplatform.services.rest.impl.resource.AbstractResourceDescriptorImpl;
+import org.exoplatform.services.rest.impl.resource.ResourceDescriptorValidator;
+import org.exoplatform.services.rest.resource.AbstractResourceDescriptor;
+import org.exoplatform.services.rest.resource.ResourceDescriptorVisitor;
+import org.exoplatform.services.rest.uri.UriPattern;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.ws.rs.Path;
+import javax.ws.rs.ext.RuntimeDelegate;
+
+/**
+ * @author <a href="mailto:andrew00x@gmail.com">Andrey Parfonov</a>
+ * @version $Id$
+ */
+public class ResourceBinderImpl implements ResourceBinder
+{
+
+ /**
+ * Logger.
+ */
+ private static final Log LOG = ExoLogger.getLogger(ResourceBinderImpl.class.getName());
+
+ private static final Comparator<ObjectFactory<AbstractResourceDescriptor>> RESOURCE_COMPARATOR =
+ new ResourceComparator();
+
+ /**
+ * Compare two {@link SingletonResourceFactory}.
+ */
+ private static final class ResourceComparator implements Comparator<ObjectFactory<AbstractResourceDescriptor>>
+ {
+ /**
+ * Compare two ResourceClass for order.
+ *
+ * @param o1 first ResourceClass to be compared
+ * @param o2 second ResourceClass to be compared
+ * @return positive , zero or negative dependent of {@link UriPattern}
+ * comparison
+ * @see Comparator#compare(Object, Object)
+ * @see UriPattern
+ * @see UriPattern#URIPATTERN_COMPARATOR
+ */
+ public int compare(ObjectFactory<AbstractResourceDescriptor> o1, ObjectFactory<AbstractResourceDescriptor> o2)
+ {
+ return UriPattern.URIPATTERN_COMPARATOR.compare(o1.getObjectModel().getUriPattern(), o2.getObjectModel()
+ .getUriPattern());
+ }
+ };
+
+ /**
+ * Root resource descriptors.
+ */
+ private final List<ObjectFactory<AbstractResourceDescriptor>> rootResources =
+ new ArrayList<ObjectFactory<AbstractResourceDescriptor>>();
+
+ /**
+ * Validator.
+ */
+ private final ResourceDescriptorVisitor rdv = ResourceDescriptorValidator.getInstance();
+
+ private int size = 0;
+
+ public ResourceBinderImpl()
+ {
+ // Initialize RuntimeDelegate instance
+ // This is first component in life cycle what needs.
+ // TODO better solution to initialize RuntimeDelegate
+ RuntimeDelegate rd = new RuntimeDelegateImpl();
+ RuntimeDelegate.setInstance(rd);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean bind(final Object resource)
+ {
+ final Path path = resource.getClass().getAnnotation(Path.class);
+
+ AbstractResourceDescriptor descriptor = null;
+ if (path != null)
+ {
+ try
+ {
+ descriptor = new AbstractResourceDescriptorImpl(resource.getClass(), ComponentLifecycleScope.SINGLETON);
+ }
+ catch (Exception e)
+ {
+ String msg = "Unexpected error occurs when process resource class " + resource.getClass().getName();
+ LOG.error(msg, e);
+ return false;
+ }
+ }
+ else
+ {
+ String msg =
+ "Resource class " + resource.getClass().getName() + " it is not root resource. "
+ + "Path annotation javax.ws.rs.Path is not specified for this class.";
+ LOG.warn(msg);
+ return false;
+ }
+
+ // validate AbstractResourceDescriptor
+ try
+ {
+ descriptor.accept(rdv);
+ }
+ catch (Exception e)
+ {
+ LOG.error("Validation of root resource failed. ", e);
+ return false;
+ }
+
+ synchronized (rootResources)
+ {
+ // check does exist other resource with the same URI pattern
+ for (ObjectFactory<AbstractResourceDescriptor> exist : rootResources)
+ {
+ if (exist.getObjectModel().getUriPattern().equals(descriptor.getUriPattern()))
+ {
+ String msg =
+ "Resource class " + descriptor.getObjectClass().getName() + " can't be registered. Resource class "
+ + exist.getClass().getName() + " with the same pattern "
+ + exist.getObjectModel().getUriPattern().getTemplate() + " already registered.";
+ LOG.warn(msg);
+ return false;
+ }
+ }
+
+ // Singleton resource
+ ObjectFactory<AbstractResourceDescriptor> res =
+ new SingletonObjectFactory<AbstractResourceDescriptor>(descriptor, resource);
+ rootResources.add(res);
+ Collections.sort(rootResources, RESOURCE_COMPARATOR);
+ LOG.info("Bind new resource " + res.getObjectModel().getUriPattern().getTemplate() + " : "
+ + descriptor.getObjectClass());
+ }
+ size++;
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean bind(final Class<?> resourceClass)
+ {
+ final Path path = resourceClass.getAnnotation(Path.class);
+
+ AbstractResourceDescriptor descriptor = null;
+ if (path != null)
+ {
+ try
+ {
+ descriptor = new AbstractResourceDescriptorImpl(resourceClass, ComponentLifecycleScope.PER_REQUEST);
+ }
+ catch (Exception e)
+ {
+ String msg = "Unexpected error occurs when process resource class " + resourceClass.getName();
+ LOG.error(msg, e);
+ return false;
+ }
+ }
+ else
+ {
+ String msg =
+ "Resource class " + resourceClass.getName() + " it is not root resource. "
+ + "Path annotation javax.ws.rs.Path is not specified for this class.";
+ LOG.warn(msg);
+ return false;
+ }
+
+ // validate AbstractResourceDescriptor
+ try
+ {
+ descriptor.accept(rdv);
+ }
+ catch (Exception e)
+ {
+ LOG.error("Validation of root resource failed. ", e);
+ return false;
+ }
+
+ synchronized (rootResources)
+ {
+ // check does exist other resource with the same URI pattern
+ for (ObjectFactory<AbstractResourceDescriptor> exist : rootResources)
+ {
+ AbstractResourceDescriptor existDescriptor = exist.getObjectModel();
+ if (exist.getObjectModel().getUriPattern().equals(descriptor.getUriPattern()))
+ {
+
+ String msg =
+ "Resource class " + descriptor.getObjectClass().getName() + " can't be registered. Resource class "
+ + existDescriptor.getObjectClass().getName() + " with the same pattern "
+ + exist.getObjectModel().getUriPattern().getTemplate() + " already registered.";
+ LOG.warn(msg);
+ return false;
+ }
+ }
+ // per-request resource
+ ObjectFactory<AbstractResourceDescriptor> res =
+ new PerRequestObjectFactory<AbstractResourceDescriptor>(descriptor);
+ rootResources.add(res);
+ Collections.sort(rootResources, RESOURCE_COMPARATOR);
+ LOG.info("Bind new resource " + res.getObjectModel().getUriPattern().getRegex() + " : " + resourceClass);
+ }
+ size++;
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @SuppressWarnings("unchecked")
+ public boolean unbind(Class clazz)
+ {
+ synchronized (rootResources)
+ {
+ Iterator<ObjectFactory<AbstractResourceDescriptor>> i = rootResources.iterator();
+ while (i.hasNext())
+ {
+ ObjectFactory<AbstractResourceDescriptor> res = i.next();
+ Class c = res.getObjectModel().getObjectClass();
+ if (clazz.equals(c))
+ {
+ i.remove();
+ LOG.info("Remove ResourceContainer " + res.getObjectModel().getUriPattern().getTemplate() + " : " + c);
+ size--;
+ return true;
+ }
+ }
+ return false;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean unbind(String uriTemplate)
+ {
+ synchronized (rootResources)
+ {
+ Iterator<ObjectFactory<AbstractResourceDescriptor>> i = rootResources.iterator();
+ while (i.hasNext())
+ {
+ ObjectFactory<AbstractResourceDescriptor> res = i.next();
+ String t = res.getObjectModel().getUriPattern().getTemplate();
+ if (t.equals(uriTemplate))
+ {
+ i.remove();
+ LOG.info("Remove ResourceContainer " + res.getObjectModel().getUriPattern().getTemplate());
+ size--;
+ return true;
+ }
+ }
+ return false;
+ }
+ }
+
+ /**
+ * Clear the list of ResourceContainer description.
+ */
+ public void clear()
+ {
+ rootResources.clear();
+ size = 0;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public List<ObjectFactory<AbstractResourceDescriptor>> getResources()
+ {
+ return rootResources;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int getSize()
+ {
+ return size;
+ }
+
+ /**
+ * @return all registered root resources
+ */
+ @Deprecated
+ public List<AbstractResourceDescriptor> getRootResources()
+ {
+ List<AbstractResourceDescriptor> l = new ArrayList<AbstractResourceDescriptor>(rootResources.size());
+ synchronized (rootResources)
+ {
+ for (ObjectFactory<AbstractResourceDescriptor> f : rootResources)
+ l.add(f.getObjectModel());
+ }
+ return l;
+ }
+
+}
Property changes on: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ResourceBinderImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/RestComponentDeployer.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/RestComponentDeployer.java (rev 0)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/RestComponentDeployer.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -0,0 +1,48 @@
+/*
+ * 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.rest.impl;
+
+import org.exoplatform.services.rest.ResourceBinder;
+
+/**
+ * @author <a href="mailto:andrey.parfonov@exoplatform.com">Andrey Parfonov</a>
+ * @version $Id: $
+ */
+public abstract class RestComponentDeployer
+{
+
+ protected RestComponentResolver resolver;
+
+ public RestComponentDeployer(ResourceBinder resources, ProviderBinder providers)
+ {
+ resolver = new RestComponentResolver(resources, providers);
+ }
+
+ public void deploy(Object instance)
+ {
+ resolver.addSingleton(instance);
+ }
+
+ @SuppressWarnings("unchecked")
+ public void deploy(Class clazz)
+ {
+ resolver.addPerRequest(clazz);
+ }
+
+}
Property changes on: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/RestComponentDeployer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/RestComponentResolver.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/RestComponentResolver.java (rev 0)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/RestComponentResolver.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -0,0 +1,146 @@
+/*
+ * 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.rest.impl;
+
+import org.exoplatform.services.rest.Filter;
+import org.exoplatform.services.rest.RequestFilter;
+import org.exoplatform.services.rest.ResourceBinder;
+import org.exoplatform.services.rest.ResponseFilter;
+import org.exoplatform.services.rest.method.MethodInvokerFilter;
+
+import javax.ws.rs.Path;
+import javax.ws.rs.ext.ContextResolver;
+import javax.ws.rs.ext.ExceptionMapper;
+import javax.ws.rs.ext.MessageBodyReader;
+import javax.ws.rs.ext.MessageBodyWriter;
+import javax.ws.rs.ext.Provider;
+
+/**
+ * @author <a href="mailto:andrey.parfonov@exoplatform.com">Andrey Parfonov</a>
+ * @version $Id: $
+ */
+public final class RestComponentResolver
+{
+
+ private ResourceBinder resources;
+
+ private ProviderBinder providers;
+
+ public RestComponentResolver(ResourceBinder resources, ProviderBinder providers)
+ {
+ this.resources = resources;
+ this.providers = providers;
+ }
+
+ @SuppressWarnings("unchecked")
+ public void addSingleton(Object instance)
+ {
+ Class clazz = instance.getClass();
+ if (clazz.getAnnotation(Provider.class) != null)
+ {
+ // singleton provider
+ if (instance instanceof ContextResolver)
+ {
+ providers.addContextResolver((ContextResolver)instance);
+ }
+ if (instance instanceof ExceptionMapper)
+ {
+ providers.addExceptionMapper((ExceptionMapper)instance);
+ }
+ if (instance instanceof MessageBodyReader)
+ {
+ providers.addMessageBodyReader((MessageBodyReader)instance);
+ }
+ if (instance instanceof MessageBodyWriter)
+ {
+ providers.addMessageBodyWriter((MessageBodyWriter)instance);
+ }
+ }
+ else if (clazz.getAnnotation(Filter.class) != null)
+ {
+ // singleton filter
+ if (instance instanceof MethodInvokerFilter)
+ {
+ providers.addMethodInvokerFilter((MethodInvokerFilter)instance);
+ }
+ if (instance instanceof RequestFilter)
+ {
+ providers.addRequestFilter((RequestFilter)instance);
+ }
+ if (instance instanceof ResponseFilter)
+ {
+ providers.addResponseFilter((ResponseFilter)instance);
+ }
+ }
+ else if (clazz.getAnnotation(Path.class) != null)
+ {
+ // singleton resource
+ resources.bind(instance);
+ }
+
+ }
+
+ @SuppressWarnings("unchecked")
+ public void addPerRequest(Class clazz)
+ {
+ if (clazz.getAnnotation(Provider.class) != null)
+ {
+ // per-request provider
+ if (ContextResolver.class.isAssignableFrom(clazz))
+ {
+ providers.addContextResolver(clazz);
+ }
+ if (ExceptionMapper.class.isAssignableFrom(clazz))
+ {
+ providers.addExceptionMapper(clazz);
+ }
+ if (MessageBodyReader.class.isAssignableFrom(clazz))
+ {
+ providers.addMessageBodyReader(clazz);
+ }
+ if (MessageBodyWriter.class.isAssignableFrom(clazz))
+ {
+ providers.addMessageBodyWriter(clazz);
+ }
+ }
+ else if (clazz.getAnnotation(Filter.class) != null)
+ {
+ // per-request filter
+ if (MethodInvokerFilter.class.isAssignableFrom(clazz))
+ {
+ providers.addMethodInvokerFilter(clazz);
+ }
+ if (RequestFilter.class.isAssignableFrom(clazz))
+ {
+ providers.addRequestFilter(clazz);
+ }
+ if (ResponseFilter.class.isAssignableFrom(clazz))
+ {
+ providers.addResponseFilter(clazz);
+ }
+ }
+ else if (clazz.getAnnotation(Path.class) != null)
+ {
+ // per-request resource
+ resources.bind(clazz);
+ }
+
+ }
+
+}
Property changes on: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/RestComponentResolver.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/SimpleDependencyInjector.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/SimpleDependencyInjector.java 2009-10-16 15:45:39 UTC (rev 291)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/SimpleDependencyInjector.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -1,40 +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.rest.impl;
-
-import org.exoplatform.services.rest.DependencyInjector;
-
-import java.lang.reflect.Type;
-import java.util.HashMap;
-
-/**
- * @author <a href="mailto:andrey.parfonov@exoplatform.com">Andrey Parfonov</a>
- * @version $Id$
- */
-public class SimpleDependencyInjector extends HashMap<Class<?>, Object> implements DependencyInjector
-{
-
- private static final long serialVersionUID = 8212609178539168377L;
-
- public Object getInjectableParameter(Class<?> type, Type genericType)
- {
- return get(type);
- }
-
-}
Copied: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/SimpleDependencySupplier.java (from rev 291, ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/SimpleDependencyInjector.java)
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/SimpleDependencySupplier.java (rev 0)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/SimpleDependencySupplier.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -0,0 +1,40 @@
+/*
+ * 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.rest.impl;
+
+import org.exoplatform.services.rest.DependencySupplier;
+import org.exoplatform.services.rest.Parameter;
+
+import java.util.HashMap;
+
+/**
+ * @author <a href="mailto:andrey.parfonov@exoplatform.com">Andrey Parfonov</a>
+ * @version $Id$
+ */
+public class SimpleDependencySupplier extends HashMap<Class<?>, Object> implements DependencySupplier
+{
+
+ private static final long serialVersionUID = 8212609178539168377L;
+
+ public Object getInstanceOfType(Parameter parameter)
+ {
+ return get(parameter.getParameterClass());
+ }
+
+}
Property changes on: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/SimpleDependencySupplier.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/method/InjectableProvider.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/method/InjectableProvider.java 2009-10-16 15:45:39 UTC (rev 291)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/method/InjectableProvider.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -40,7 +40,7 @@
public Object resolve(Parameter parameter, ApplicationContext context) throws Exception
{
if (context.getDependencyInjector() != null)
- return context.getDependencyInjector().getInjectableParameter(parameter.getParameterClass(), null);
+ return context.getDependencyInjector().getInstanceOfType(parameter);
return null;
}
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/method/ParameterHelper.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/method/ParameterHelper.java 2009-10-16 15:45:39 UTC (rev 291)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/method/ParameterHelper.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -18,7 +18,6 @@
*/
package org.exoplatform.services.rest.impl.method;
-import org.exoplatform.services.rest.Inject;
import org.exoplatform.services.rest.Property;
import org.exoplatform.services.rest.method.TypeProducer;
@@ -89,8 +88,7 @@
static
{
PROVIDER_FIELDS_ANNOTATIONS =
- Collections.unmodifiableList(Arrays.asList(Context.class.getName(), Property.class.getName(), Inject.class
- .getName()));
+ Collections.unmodifiableList(Arrays.asList(Context.class.getName(), Property.class.getName()));
PROVIDER_CONSTRUCTOR_PARAMETER_ANNOTATIONS =
Collections.unmodifiableList(Arrays.asList(Context.class.getName(), Property.class.getName()));
@@ -103,7 +101,6 @@
tmp1.add(PathParam.class.getName());
tmp1.add(QueryParam.class.getName());
tmp1.add(Property.class.getName());
- tmp1.add(Inject.class.getName());
RESOURCE_FIELDS_ANNOTATIONS = Collections.unmodifiableList(tmp1);
RESOURCE_CONSTRUCTOR_PARAMETER_ANNOTATIONS = Collections.unmodifiableList(tmp1);
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/method/ParameterResolverFactory.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/method/ParameterResolverFactory.java 2009-10-16 15:45:39 UTC (rev 291)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/method/ParameterResolverFactory.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -28,7 +28,6 @@
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Context;
-import org.exoplatform.services.rest.Inject;
import org.exoplatform.services.rest.Property;
/**
@@ -71,8 +70,8 @@
return new QueryParameterResolver((QueryParam)annotation);
if (clazz == Property.class)
return new PropertyResolver((Property)annotation);
- if (clazz == Inject.class)
- return new InjectableProvider((Inject)annotation);
+// if (clazz == Inject.class)
+// return new InjectableProvider((Inject)annotation);
return null;
}
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/provider/ProviderDescriptorImpl.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/provider/ProviderDescriptorImpl.java 2009-10-16 15:45:39 UTC (rev 291)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/provider/ProviderDescriptorImpl.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -74,26 +74,9 @@
/**
* @param providerClass provider class
- */
- public ProviderDescriptorImpl(Class<?> providerClass)
- {
- this(providerClass, ComponentLifecycleScope.PER_REQUEST);
- }
-
- /**
- * @param provider provider instance
- */
- @Deprecated
- public ProviderDescriptorImpl(Object provider)
- {
- this(provider.getClass(), ComponentLifecycleScope.SINGLETON);
- }
-
- /**
- * @param providerClass provider class
* @param scope provider scope
*/
- private ProviderDescriptorImpl(Class<?> providerClass, ComponentLifecycleScope scope)
+ public ProviderDescriptorImpl(Class<?> providerClass, ComponentLifecycleScope scope)
{
this.providerClass = providerClass;
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/resource/AbstractResourceDescriptorImpl.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/resource/AbstractResourceDescriptorImpl.java 2009-10-16 15:45:39 UTC (rev 291)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/resource/AbstractResourceDescriptorImpl.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -133,23 +133,12 @@
*
* @param resourceClass resource class
*/
- public AbstractResourceDescriptorImpl(Class<?> resourceClass)
+ public AbstractResourceDescriptorImpl(Class<?> resourceClass, ComponentLifecycleScope scope)
{
- this(resourceClass.getAnnotation(Path.class), resourceClass, ComponentLifecycleScope.PER_REQUEST);
+ this(resourceClass.getAnnotation(Path.class), resourceClass, scope);
}
/**
- * Constructs new instance of AbstractResourceDescriptor without path
- * (sub-resource).
- *
- * @param resource resource instance
- */
- public AbstractResourceDescriptorImpl(Object resource)
- {
- this(resource.getClass().getAnnotation(Path.class), resource.getClass(), ComponentLifecycleScope.SINGLETON);
- }
-
- /**
* @param path the path value
* @param resourceClass resource class
* @param scope resource scope
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/RestInitializedListener.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/RestInitializedListener.java 2009-10-16 15:45:39 UTC (rev 291)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/RestInitializedListener.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -18,10 +18,10 @@
*/
package org.exoplatform.services.rest.servlet;
-import org.exoplatform.services.rest.DependencyInjector;
+import org.exoplatform.services.rest.DependencySupplier;
import org.exoplatform.services.rest.RequestHandler;
import org.exoplatform.services.rest.ResourceBinder;
-import org.exoplatform.services.rest.impl.BaseResourceBinder;
+import org.exoplatform.services.rest.impl.ResourceBinderImpl;
import org.exoplatform.services.rest.impl.RequestHandlerImpl;
import javax.servlet.ServletContextEvent;
@@ -41,14 +41,14 @@
public void contextInitialized(ServletContextEvent event)
{
- String dependencyInjectorFQN = event.getServletContext().getInitParameter(DependencyInjector.class.getName());
- DependencyInjector dependencyInjector = null;
+ String dependencyInjectorFQN = event.getServletContext().getInitParameter(DependencySupplier.class.getName());
+ DependencySupplier dependencyInjector = null;
if (dependencyInjectorFQN != null)
{
try
{
Class<?> cl = Thread.currentThread().getContextClassLoader().loadClass(dependencyInjectorFQN.trim());
- dependencyInjector = (DependencyInjector)cl.newInstance();
+ dependencyInjector = (DependencySupplier)cl.newInstance();
}
catch (ClassNotFoundException cnfe)
{
@@ -64,7 +64,7 @@
}
}
- ResourceBinder binder = new BaseResourceBinder();
+ ResourceBinder binder = new ResourceBinderImpl();
String applicationFQN = event.getServletContext().getInitParameter("javax.ws.rs.Application");
if (applicationFQN != null)
{
@@ -72,7 +72,7 @@
{
Class<?> cl = Thread.currentThread().getContextClassLoader().loadClass(applicationFQN.trim());
Application application = (Application)cl.newInstance();
- binder.addApplication(application);
+// binder.addApplication(application);
}
catch (ClassNotFoundException cnfe)
{
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/wadl/WadlProcessor.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/wadl/WadlProcessor.java 2009-10-16 15:45:39 UTC (rev 291)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/wadl/WadlProcessor.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.rest.wadl;
+import org.exoplatform.services.rest.ComponentLifecycleScope;
import org.exoplatform.services.rest.impl.resource.AbstractResourceDescriptorImpl;
import org.exoplatform.services.rest.method.MethodParameter;
import org.exoplatform.services.rest.resource.AbstractResourceDescriptor;
@@ -216,7 +217,7 @@
for (SubResourceLocatorDescriptor srld : resourceDescriptor.getSubResourceLocators().values())
{
AbstractResourceDescriptor subResourceDescriptor =
- new AbstractResourceDescriptorImpl(srld.getMethod().getReturnType());
+ new AbstractResourceDescriptorImpl(srld.getMethod().getReturnType(), ComponentLifecycleScope.SINGLETON);
org.exoplatform.services.rest.wadl.research.Resource wadlSubResource = processResource(subResourceDescriptor);
wadlSubResource.setPath(srld.getPathValue().getPath());
wadlResource.getMethodOrResource().add(wadlSubResource);
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/BaseTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/BaseTest.java 2009-10-16 15:45:39 UTC (rev 291)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/BaseTest.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -22,7 +22,7 @@
//import org.exoplatform.container.StandaloneContainer;
import org.exoplatform.services.rest.impl.ApplicationContextImpl;
-import org.exoplatform.services.rest.impl.BaseResourceBinder;
+import org.exoplatform.services.rest.impl.ResourceBinderImpl;
import org.exoplatform.services.rest.impl.ProviderBinder;
import org.exoplatform.services.rest.impl.RequestHandlerImpl;
@@ -37,7 +37,7 @@
protected ProviderBinder providers;
- protected BaseResourceBinder binder;
+ protected ResourceBinderImpl resources;
protected RequestHandlerImpl requestHandler;
@@ -45,8 +45,8 @@
{
// StandaloneContainer.setConfigurationPath("src/test/java/conf/standalone/test-configuration.xml");
// container = StandaloneContainer.getInstance();
- binder = new BaseResourceBinder();
- requestHandler = new RequestHandlerImpl(binder, new SimpleDependencyInjector());
+ resources = new ResourceBinderImpl();
+ requestHandler = new RequestHandlerImpl(resources, new SimpleDependencySupplier());
requestHandler.init();
// reset providers to be sure it is clean
@@ -70,25 +70,25 @@
public boolean registry(Object resource) throws Exception
{
// container.registerComponentInstance(resource);
- return binder.bind(resource);
+ return resources.bind(resource);
}
public boolean registry(Class<?> resourceClass) throws Exception
{
// container.registerComponentImplementation(resourceClass.getName(), resourceClass);
- return binder.bind(resourceClass);
+ return resources.bind(resourceClass);
}
public boolean unregistry(Object resource)
{
// container.unregisterComponentByInstance(resource);
- return binder.unbind(resource.getClass());
+ return resources.unbind(resource.getClass());
}
public boolean unregistry(Class<?> resourceClass)
{
// container.unregisterComponent(resourceClass.getName());
- return binder.unbind(resourceClass);
+ return resources.unbind(resourceClass);
}
}
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/RequestDispatcherTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/RequestDispatcherTest.java 2009-10-16 15:45:39 UTC (rev 291)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/RequestDispatcherTest.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -44,12 +44,12 @@
public void setUp() throws Exception
{
- binder = new BaseResourceBinder();
- SimpleDependencyInjector depInjector = new SimpleDependencyInjector();
+ resources = new ResourceBinderImpl();
+ SimpleDependencySupplier depInjector = new SimpleDependencySupplier();
depInjector.put(InjectableComponent1.class, new InjectableComponent1());
depInjector.put(InjectableComponent2.class, new InjectableComponent2());
- requestHandler = new RequestHandlerImpl(binder, depInjector);
+ requestHandler = new RequestHandlerImpl(resources, depInjector);
requestHandler.init();
// reset providers to be sure it is clean
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/ResourceBinderTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/ResourceBinderTest.java 2009-10-16 15:45:39 UTC (rev 291)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/ResourceBinderTest.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -44,15 +44,15 @@
public void testBind()
{
- binder.bind(Resource.class);
- assertEquals(1, binder.getSize());
+ resources.bind(Resource.class);
+ assertEquals(1, resources.getSize());
}
public void testUnbind()
{
- binder.bind(Resource.class);
- binder.unbind(Resource.class);
- assertEquals(0, binder.getSize());
+ resources.bind(Resource.class);
+ resources.unbind(Resource.class);
+ assertEquals(0, resources.getSize());
}
@Path("/a/b/{c}")
@@ -94,25 +94,25 @@
public void testSameResourceURI()
{
- assertTrue(binder.bind(SameURIResource1.class));
- assertEquals(1, binder.getSize());
- assertFalse(binder.bind(SameURIResource2.class));
- assertEquals(1, binder.getSize());
- binder.clear();
- assertTrue(binder.bind(SameURIResource2.class));
- assertEquals(1, binder.getSize());
- assertFalse(binder.bind(SameURIResource1.class));
- assertEquals(1, binder.getSize());
- binder.clear();
- assertTrue(binder.bind(new SameURIResource1()));
- assertEquals(1, binder.getSize());
- assertFalse(binder.bind(new SameURIResource2()));
- assertEquals(1, binder.getSize());
- binder.clear();
- assertTrue(binder.bind(new SameURIResource2()));
- assertEquals(1, binder.getSize());
- assertFalse(binder.bind(new SameURIResource1()));
- assertEquals(1, binder.getSize());
+ assertTrue(resources.bind(SameURIResource1.class));
+ assertEquals(1, resources.getSize());
+ assertFalse(resources.bind(SameURIResource2.class));
+ assertEquals(1, resources.getSize());
+ resources.clear();
+ assertTrue(resources.bind(SameURIResource2.class));
+ assertEquals(1, resources.getSize());
+ assertFalse(resources.bind(SameURIResource1.class));
+ assertEquals(1, resources.getSize());
+ resources.clear();
+ assertTrue(resources.bind(new SameURIResource1()));
+ assertEquals(1, resources.getSize());
+ assertFalse(resources.bind(new SameURIResource2()));
+ assertEquals(1, resources.getSize());
+ resources.clear();
+ assertTrue(resources.bind(new SameURIResource2()));
+ assertEquals(1, resources.getSize());
+ assertFalse(resources.bind(new SameURIResource1()));
+ assertEquals(1, resources.getSize());
}
@Path("/a/b/c/{d}/e")
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/AnnotationInheritanceTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/AnnotationInheritanceTest.java 2009-10-16 15:45:39 UTC (rev 291)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/AnnotationInheritanceTest.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.rest.impl.resource;
+import org.exoplatform.services.rest.ComponentLifecycleScope;
import org.exoplatform.services.rest.impl.AbstractResourceTest;
import javax.ws.rs.GET;
@@ -87,7 +88,7 @@
{
try
{
- new AbstractResourceDescriptorImpl(Resource3.class);
+ new AbstractResourceDescriptorImpl(Resource3.class, ComponentLifecycleScope.PER_REQUEST);
fail("Should be failed here, equivocality annotation on method m0");
}
catch (RuntimeException e)
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/ApplicationTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/ApplicationTest.java 2009-10-16 15:45:39 UTC (rev 291)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/ApplicationTest.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -24,6 +24,7 @@
import org.exoplatform.services.rest.RequestFilter;
import org.exoplatform.services.rest.ResponseFilter;
import org.exoplatform.services.rest.impl.AbstractResourceTest;
+import org.exoplatform.services.rest.impl.ApplicationDeployer;
import org.exoplatform.services.rest.impl.ContainerResponse;
import org.exoplatform.services.rest.method.MethodInvokerFilter;
import org.exoplatform.services.rest.resource.GenericMethodResource;
@@ -187,8 +188,9 @@
public void testRegistry()
{
- binder.addApplication(new Application1());
- assertEquals(4, binder.getSize());
+ ApplicationDeployer deployer = new ApplicationDeployer(resources, providers);
+ deployer.deploy(new Application1());
+ assertEquals(4, resources.getSize());
assertEquals(1, providers.getRequestFilters(null).size());
assertEquals(1, providers.getResponseFilters(null).size());
assertEquals(1, providers.getMethodInvokerFilters(null).size());
@@ -202,7 +204,8 @@
public void testAsResources() throws Exception
{
- binder.addApplication(new Application1());
+ ApplicationDeployer deployer = new ApplicationDeployer(resources, providers);
+ deployer.deploy(new Application1());
// per-request
ContainerResponse resp = service("GET", "/a", "", null, null);
assertEquals(200, resp.getStatus());
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/ResourceDescriptorTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/ResourceDescriptorTest.java 2009-10-16 15:45:39 UTC (rev 291)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/ResourceDescriptorTest.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.rest.impl.resource;
+import org.exoplatform.services.rest.ComponentLifecycleScope;
import org.exoplatform.services.rest.ConstructorDescriptor;
import org.exoplatform.services.rest.FieldInjector;
import org.exoplatform.services.rest.impl.BaseTest;
@@ -68,7 +69,7 @@
{
try
{
- new AbstractResourceDescriptorImpl(Resource1.class);
+ new AbstractResourceDescriptorImpl(Resource1.class, ComponentLifecycleScope.PER_REQUEST);
fail("Should be failed here, resource does not contains JAX-RS methods");
}
catch (RuntimeException e)
@@ -80,7 +81,7 @@
{
try
{
- new AbstractResourceDescriptorImpl(Resource2.class);
+ new AbstractResourceDescriptorImpl(Resource2.class, ComponentLifecycleScope.PER_REQUEST);
fail("Should be failed here, resource does not have public constructor");
}
catch (RuntimeException e)
@@ -92,15 +93,15 @@
{
try
{
- new AbstractResourceDescriptorImpl(Resource3.class);
+ new AbstractResourceDescriptorImpl(Resource3.class, ComponentLifecycleScope.PER_REQUEST);
fail("Should be failed here, resource has two methods that have tha same HTTP method, consumes and produces annotation");
- new AbstractResourceDescriptorImpl(Resource4.class);
+ new AbstractResourceDescriptorImpl(Resource4.class, ComponentLifecycleScope.PER_REQUEST);
fail("Should be failed here, resource has two methods that have tha same HTTP method, consumes and produces annotation");
- new AbstractResourceDescriptorImpl(Resource5.class);
+ new AbstractResourceDescriptorImpl(Resource5.class, ComponentLifecycleScope.PER_REQUEST);
fail("Should be failed here, resource has two methods that have tha same HTTP method, path, consumes and produces annotation");
- new AbstractResourceDescriptorImpl(Resource6.class);
+ new AbstractResourceDescriptorImpl(Resource6.class, ComponentLifecycleScope.PER_REQUEST);
fail("Should be failed here, resource has two methods that have tha same HTTP method, path, consumes and produces annotation");
- new AbstractResourceDescriptorImpl(Resource7.class);
+ new AbstractResourceDescriptorImpl(Resource7.class, ComponentLifecycleScope.PER_REQUEST);
fail("Should be failed here, resource has two methods that have tha same path");
}
catch (RuntimeException e)
@@ -112,35 +113,35 @@
{
try
{
- new AbstractResourceDescriptorImpl(Resource8.class);
+ new AbstractResourceDescriptorImpl(Resource8.class, ComponentLifecycleScope.PER_REQUEST);
fail("Should be failed here, method has two JAX-RS annotation on the same parameter");
}
catch (RuntimeException e)
{
}
// must warn
- new AbstractResourceDescriptorImpl(Resource9.class);
+ new AbstractResourceDescriptorImpl(Resource9.class, ComponentLifecycleScope.PER_REQUEST);
}
public void testFailedCreation5()
{
try
{
- new AbstractResourceDescriptorImpl(Resource10.class);
+ new AbstractResourceDescriptorImpl(Resource10.class, ComponentLifecycleScope.PER_REQUEST);
fail("Should be failed here, constructor of per-request resource has two JAX-RS annotation on the same parameter");
}
catch (RuntimeException e)
{
}
// must warn
- new AbstractResourceDescriptorImpl(Resource11.class);
+ new AbstractResourceDescriptorImpl(Resource11.class, ComponentLifecycleScope.PER_REQUEST);
}
public void testFailedCreation6()
{
try
{
- new AbstractResourceDescriptorImpl(Resource12.class);
+ new AbstractResourceDescriptorImpl(Resource12.class, ComponentLifecycleScope.PER_REQUEST);
fail("Should be failed here, fields of per-request resource has two JAX-RS annotation on the same parameter");
}
catch (RuntimeException e)
@@ -153,7 +154,7 @@
// TODO Mechanism for checking log messages. There is some sections in
// JAX-RS specification that said 'should warn...'. Need control this
// messages in some way.
- new AbstractResourceDescriptorImpl(Resource14.class);
+ new AbstractResourceDescriptorImpl(Resource14.class, ComponentLifecycleScope.PER_REQUEST);
}
// ====================== all of this resource are not valid =========================
@@ -360,7 +361,8 @@
public void testCreateAbstractResourceDescriptor()
{
- AbstractResourceDescriptor resource = new AbstractResourceDescriptorImpl(SampleResource.class);
+ AbstractResourceDescriptor resource =
+ new AbstractResourceDescriptorImpl(SampleResource.class, ComponentLifecycleScope.PER_REQUEST);
assertTrue(resource.isRootResource());
assertEquals("/a/{b}/", resource.getPathValue().getPath());
assertEquals(SampleResource.class, resource.getObjectClass());
@@ -372,7 +374,8 @@
public void testResourceMethods()
{
- AbstractResourceDescriptor resource = new AbstractResourceDescriptorImpl(SampleResource.class);
+ AbstractResourceDescriptor resource =
+ new AbstractResourceDescriptorImpl(SampleResource.class, ComponentLifecycleScope.PER_REQUEST);
// GET
ResourceMethodDescriptor methodDescriptor = resource.getResourceMethods().getFirst("GET");
assertEquals("GET", methodDescriptor.getHttpMethod());
@@ -405,7 +408,8 @@
public void testSubResourceMethods()
{
- AbstractResourceDescriptor resource = new AbstractResourceDescriptorImpl(SampleResource.class);
+ AbstractResourceDescriptor resource =
+ new AbstractResourceDescriptorImpl(SampleResource.class, ComponentLifecycleScope.PER_REQUEST);
Collection<ResourceMethodMap<SubResourceMethodDescriptor>> subRes = resource.getSubResourceMethods().values();
// POST
SubResourceMethodDescriptor subResourceMethodDescriptor = subRes.iterator().next().getFirst("POST");
@@ -457,7 +461,8 @@
public void testSubResourceLocators()
{
// sub-resource method SampleResource#get2()
- AbstractResourceDescriptor resource = new AbstractResourceDescriptorImpl(SampleResource.class);
+ AbstractResourceDescriptor resource =
+ new AbstractResourceDescriptorImpl(SampleResource.class, ComponentLifecycleScope.PER_REQUEST);
SubResourceLocatorDescriptor subResourceLocatorDescriptor =
resource.getSubResourceLocators().values().iterator().next();
assertEquals("{c}/d", subResourceLocatorDescriptor.getPathValue().getPath());
@@ -474,7 +479,8 @@
public void testFields()
{
- AbstractResourceDescriptor resource = new AbstractResourceDescriptorImpl(SampleResource.class);
+ AbstractResourceDescriptor resource =
+ new AbstractResourceDescriptorImpl(SampleResource.class, ComponentLifecycleScope.PER_REQUEST);
List<FieldInjector> fields = resource.getFieldInjectors();
assertEquals(1, fields.size());
FieldInjector f = fields.get(0);
@@ -488,7 +494,8 @@
public void testConstructors()
{
- AbstractResourceDescriptor resource = new AbstractResourceDescriptorImpl(SampleResource.class);
+ AbstractResourceDescriptor resource =
+ new AbstractResourceDescriptorImpl(SampleResource.class, ComponentLifecycleScope.PER_REQUEST);
assertEquals(3, resource.getConstructorDescriptors().size());
List<ConstructorDescriptor> c = resource.getConstructorDescriptors();
assertEquals(2, c.get(0).getParameters().size());
@@ -563,7 +570,8 @@
public void testResourceMethodSorting()
{
- AbstractResourceDescriptor resource = new AbstractResourceDescriptorImpl(SampleResource1.class);
+ AbstractResourceDescriptor resource =
+ new AbstractResourceDescriptorImpl(SampleResource1.class, ComponentLifecycleScope.PER_REQUEST);
List<ResourceMethodDescriptor> l = resource.getResourceMethods().get("GET");
assertEquals("m4", l.get(0).getMethod().getName());
assertEquals("m3", l.get(1).getMethod().getName());
@@ -624,7 +632,8 @@
public void testSubResourceMethodSorting()
{
- AbstractResourceDescriptor resource = new AbstractResourceDescriptorImpl(SampleResource2.class);
+ AbstractResourceDescriptor resource =
+ new AbstractResourceDescriptorImpl(SampleResource2.class, ComponentLifecycleScope.PER_REQUEST);
SubResourceMethodMap srmm = resource.getSubResourceMethods();
Collection<UriPattern> uris = srmm.keySet();
Iterator<UriPattern> i = uris.iterator();
@@ -705,7 +714,8 @@
public void testSubResourceLocatorSorting()
{
- AbstractResourceDescriptor resource = new AbstractResourceDescriptorImpl(SampleResource3.class);
+ AbstractResourceDescriptor resource =
+ new AbstractResourceDescriptorImpl(SampleResource3.class, ComponentLifecycleScope.PER_REQUEST);
SubResourceLocatorMap locs = resource.getSubResourceLocators();
Collection<UriPattern> uris = locs.keySet();
Iterator<UriPattern> i = uris.iterator();
@@ -757,7 +767,8 @@
public void testInitializeFieldSuperClass()
{
- AbstractResourceDescriptor resource = new AbstractResourceDescriptorImpl(EndResource.class);
+ AbstractResourceDescriptor resource =
+ new AbstractResourceDescriptorImpl(EndResource.class, ComponentLifecycleScope.PER_REQUEST);
assertEquals(6, resource.getFieldInjectors().size());
}
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/ResourceDescriptorValidatorTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/ResourceDescriptorValidatorTest.java 2009-10-16 15:45:39 UTC (rev 291)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/ResourceDescriptorValidatorTest.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.rest.impl.resource;
+import org.exoplatform.services.rest.ComponentLifecycleScope;
import org.exoplatform.services.rest.impl.BaseTest;
import org.exoplatform.services.rest.resource.AbstractResourceDescriptor;
import org.exoplatform.services.rest.resource.ResourceMethodDescriptor;
@@ -46,7 +47,8 @@
public void testAbstractResourceDescriptorValidator()
{
- AbstractResourceDescriptor resource = new AbstractResourceDescriptorImpl(Resource2.class);
+ AbstractResourceDescriptor resource =
+ new AbstractResourceDescriptorImpl(Resource2.class, ComponentLifecycleScope.PER_REQUEST);
try
{
resource.accept(new ResourceDescriptorValidator());
@@ -59,7 +61,8 @@
public void testResourceMethodDescriptorValidator()
{
- AbstractResourceDescriptor resource = new AbstractResourceDescriptorImpl(Resource3.class);
+ AbstractResourceDescriptor resource =
+ new AbstractResourceDescriptorImpl(Resource3.class, ComponentLifecycleScope.PER_REQUEST);
for (List<ResourceMethodDescriptor> l : resource.getResourceMethods().values())
{
ResourceDescriptorValidator validator = new ResourceDescriptorValidator();
@@ -88,7 +91,8 @@
public void testSubResourceMethodDescriptorValidator()
{
- AbstractResourceDescriptor resource = new AbstractResourceDescriptorImpl(Resource4.class);
+ AbstractResourceDescriptor resource =
+ new AbstractResourceDescriptorImpl(Resource4.class, ComponentLifecycleScope.PER_REQUEST);
ResourceDescriptorValidator validator = new ResourceDescriptorValidator();
for (ResourceMethodMap<SubResourceMethodDescriptor> srmm : resource.getSubResourceMethods().values())
{
@@ -117,7 +121,8 @@
public void testSubResourceLocatorDescriptorValidator()
{
- AbstractResourceDescriptor resource = new AbstractResourceDescriptorImpl(Resource5.class);
+ AbstractResourceDescriptor resource =
+ new AbstractResourceDescriptorImpl(Resource5.class, ComponentLifecycleScope.PER_REQUEST);
ResourceDescriptorValidator validator = new ResourceDescriptorValidator();
for (SubResourceLocatorDescriptor rmd : resource.getSubResourceLocators().values())
{
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/wadl/WadlProcessorTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/wadl/WadlProcessorTest.java 2009-10-16 15:45:39 UTC (rev 291)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/wadl/WadlProcessorTest.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.rest.wadl;
+import org.exoplatform.services.rest.ComponentLifecycleScope;
import org.exoplatform.services.rest.impl.BaseTest;
import org.exoplatform.services.rest.impl.resource.AbstractResourceDescriptorImpl;
import org.exoplatform.services.rest.resource.AbstractResourceDescriptor;
@@ -124,7 +125,7 @@
public void testBaseWadlGenerator() throws Exception
{
- AbstractResourceDescriptor ard = new AbstractResourceDescriptorImpl(Resource1.class);
+ AbstractResourceDescriptor ard = new AbstractResourceDescriptorImpl(Resource1.class, ComponentLifecycleScope.PER_REQUEST);
WadlProcessor wadlProcessor = new WadlProcessor();
Application app = wadlProcessor.process(ard, new URI("http://localhost:8080/ws/rs"));
Deleted: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ContainerObjectFactory.java
===================================================================
--- ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ContainerObjectFactory.java 2009-10-16 15:45:39 UTC (rev 291)
+++ ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ContainerObjectFactory.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -1,65 +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.rest;
-
-import org.exoplatform.container.ExoContainerContext;
-
-/**
- * Factory provides object that is created and is manageable by
- * inversion-of-control container.
- *
- * @param <T> any extension of {@link ObjectModel}
- * @author <a href="mailto:andrew00x@gmail.com">Andrey Parfonov</a>
- * @version $Id$
- */
-public class ContainerObjectFactory<T extends ObjectModel> implements ObjectFactory<T>
-{
-
- /**
- * Object model.
- */
- protected final T model;
-
- /**
- * @param model object model
- * @see ObjectModel
- */
- public ContainerObjectFactory(T model)
- {
- this.model = model;
- }
-
- /**
- * {@inheritDoc}
- */
- public Object getInstance(ApplicationContext context)
- {
- Class<?> clazz = model.getObjectClass();
- return ExoContainerContext.getCurrentContainer().getComponentInstanceOfType(clazz);
- }
-
- /**
- * {@inheritDoc}
- */
- public T getObjectModel()
- {
- return model;
- }
-
-}
Deleted: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/impl/ExoContainerDependencyInjector.java
===================================================================
--- ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/impl/ExoContainerDependencyInjector.java 2009-10-16 15:45:39 UTC (rev 291)
+++ ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/impl/ExoContainerDependencyInjector.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -1,43 +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.rest.impl;
-
-import java.lang.reflect.Type;
-
-import org.exoplatform.container.ExoContainer;
-import org.exoplatform.container.ExoContainerContext;
-import org.exoplatform.services.rest.DependencyInjector;
-
-/**
- * @author <a href="mailto:andrey.parfonov@exoplatform.com">Andrey Parfonov</a>
- * @version $Id$
- */
-public class ExoContainerDependencyInjector implements DependencyInjector
-{
-
- /**
- * {@inheritDoc}
- */
- public Object getInjectableParameter(Class<?> type, Type genericType)
- {
- ExoContainer container = ExoContainerContext.getCurrentContainer();
- return container.getComponentInstanceOfType(type);
- }
-
-}
Deleted: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/impl/ExoContainerResourceBinder.java
===================================================================
--- ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/impl/ExoContainerResourceBinder.java 2009-10-16 15:45:39 UTC (rev 291)
+++ ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/impl/ExoContainerResourceBinder.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -1,77 +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.rest.impl;
-
-import java.util.List;
-
-import javax.ws.rs.core.Application;
-import javax.ws.rs.ext.RuntimeDelegate;
-
-import org.exoplatform.container.ExoContainer;
-import org.exoplatform.container.ExoContainerContext;
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
-import org.exoplatform.services.rest.resource.ResourceContainer;
-
-/**
- * @author <a href="mailto:andrew00x@gmail.com">Andrey Parfonov</a>
- * @version $Id$
- */
-public class ExoContainerResourceBinder extends BaseResourceBinder
-{
-
- /**
- * Logger.
- */
- private static final Log LOG = ExoLogger.getLogger(ExoContainerResourceBinder.class.getName());
-
- /**
- * @param containerContext eXo container context
- * @throws Exception if can't set instance of {@link RuntimeDelegate}
- */
- @SuppressWarnings("unchecked")
- public ExoContainerResourceBinder(ExoContainerContext containerContext) throws Exception
- {
- super();
- ExoContainer container = containerContext.getContainer();
-
- // Lookup Applications
- List<Application> applications = container.getComponentInstancesOfType(Application.class);
- for (Application a : applications)
- {
- try
- {
- addApplication(a);
- }
- catch (Exception e)
- {
- LOG.error("Failed add JAX-RS application " + a.getClass().getName(), e);
- }
- }
-
- // Lookup all object which implements ResourceContainer interface and
- // process them to be add as root resources.
- for (Object resource : container.getComponentInstancesOfType(ResourceContainer.class))
- {
- bind(resource);
- }
-
- }
-
-}
Modified: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/impl/RestInitializer.java
===================================================================
--- ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/impl/RestInitializer.java 2009-10-16 15:45:39 UTC (rev 291)
+++ ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/impl/RestInitializer.java 2009-10-19 07:03:07 UTC (rev 292)
@@ -18,26 +18,26 @@
*/
package org.exoplatform.services.rest.impl;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.ext.ContextResolver;
-import javax.xml.bind.JAXBException;
-
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
-import org.exoplatform.services.rest.RequestFilter;
-import org.exoplatform.services.rest.RequestHandler;
-import org.exoplatform.services.rest.ResponseFilter;
-import org.exoplatform.services.rest.impl.provider.JAXBContextResolver;
-import org.exoplatform.services.rest.method.MethodInvokerFilter;
-import org.exoplatform.services.rest.provider.EntityProvider;
+import org.exoplatform.services.rest.DependencySupplier;
+import org.exoplatform.services.rest.Parameter;
+import org.exoplatform.services.rest.ResourceBinder;
+import org.exoplatform.services.rest.resource.ResourceContainer;
import org.picocontainer.Startable;
+import java.util.List;
+
+import javax.ws.rs.core.Application;
+
/**
* @author <a href="mailto:andrey.parfonov@exoplatform.com">Andrey Parfonov</a>
* @version $Id$
*/
-public class RestInitializer implements Startable
+public class RestInitializer extends ApplicationDeployer implements DependencySupplier, Startable
{
/**
@@ -46,18 +46,17 @@
private static final Log LOG = ExoLogger.getLogger(RestInitializer.class.getName());
@SuppressWarnings("unchecked")
- public RestInitializer(RequestHandler requestHandler, InitParams initParams)
+ public RestInitializer(ResourceBinder resources, InitParams initParams, ExoContainerContext containerContext)
{
-
- ProviderBinder providers = ProviderBinder.getInstance();
-
+ super(resources, ProviderBinder.getInstance());
+ ExoContainer container = containerContext.getContainer();
if (initParams != null)
{
- for (Object cl : initParams.getValuesParam("ws.rs.request.filter").getValues())
+ for (Object cl : initParams.getValuesParam("ws.rest.components").getValues())
{
try
{
- providers.addRequestFilter((Class<? extends RequestFilter>)Class.forName((String)cl));
+ deploy(Class.forName((String)cl));
}
catch (ClassNotFoundException e)
{
@@ -65,69 +64,22 @@
}
}
}
- for (Object cl : initParams.getValuesParam("ws.rs.response.filter").getValues())
+ List<Application> applications = container.getComponentInstancesOfType(Application.class);
+ for (Application a : applications)
{
- try
- {
- providers.addResponseFilter((Class<? extends ResponseFilter>)Class.forName((String)cl));
- }
- catch (ClassNotFoundException e)
- {
- LOG.error("Failed load class " + cl, e);
- }
+ deploy(a);
}
- for (Object cl : initParams.getValuesParam("ws.rs.method.filter").getValues())
+ for (Object resource : container.getComponentInstancesOfType(ResourceContainer.class))
{
- try
- {
- providers.addMethodInvokerFilter((Class<? extends MethodInvokerFilter>)Class.forName((String)cl));
- }
- catch (ClassNotFoundException e)
- {
- LOG.error("Failed load class " + cl, e);
- }
+ deploy(resource);
}
- for (Object cl : initParams.getValuesParam("ws.rs.entity.provider").getValues())
- {
- try
- {
- Class<? extends EntityProvider> prov = (Class<? extends EntityProvider>)Class.forName((String)cl);
- providers.addMessageBodyReader(prov);
- providers.addMessageBodyWriter(prov);
- }
- catch (ClassNotFoundException e)
- {
- LOG.error("Failed load class " + cl, e);
- }
- }
- for (Object cl : initParams.getValuesParam("ws.rs.jaxb.context").getValues())
- {
- try
- {
- ContextResolver<JAXBContextResolver> resolver =
- providers.getContextResolver(JAXBContextResolver.class, MediaType.WILDCARD_TYPE);
- if (resolver == null)
- {
- LOG.error("Not found JAXBContextResolver.");
- }
- else
- {
- JAXBContextResolver contextResolver = resolver.getContext(null);
- contextResolver.createJAXBContext((Class<?>)Class.forName((String)cl));
- }
- }
- catch (ClassNotFoundException e)
- {
- LOG.error("Failed load class " + cl, e);
- }
- catch (JAXBException jaxbe)
- {
- LOG.error("Failed add JAXBContext for class " + cl, jaxbe);
- }
- }
-
}
+ public Object getInstanceOfType(Parameter parameter)
+ {
+ return null;
+ }
+
public void start()
{
}
Modified: ws/branches/2.2.x/rest/ext/src/test/java/conf/standalone/test-configuration.xml
===================================================================
--- ws/branches/2.2.x/rest/ext/src/test/java/conf/standalone/test-configuration.xml 2009-10-16 15:45:39 UTC (rev 291)
+++ ws/branches/2.2.x/rest/ext/src/test/java/conf/standalone/test-configuration.xml 2009-10-19 07:03:07 UTC (rev 292)
@@ -22,36 +22,18 @@
<type>org.exoplatform.services.rest.impl.RestInitializer</type>
<init-params>
<values-param>
- <name>ws.rs.entity.provider</name>
+ <name>ws.rest.components</name>
<value>org.exoplatform.services.rest.ext.provider.HierarchicalPropertyEntityProvider</value>
-<!-- Add own entity providers here -->
- </values-param>
- <values-param>
- <name>ws.rs.request.filter</name>
<value>org.exoplatform.services.rest.ext.filter.MethodOverrideFilter</value>
-<!-- Add own request filters here -->
- </values-param>
- <values-param>
- <name>ws.rs.response.filter</name>
-<!-- Add own response filters here -->
- </values-param>
- <values-param>
- <name>ws.rs.method.filter</name>
<value>org.exoplatform.services.rest.impl.method.MethodInvokerFilterComponentPlugin</value>
-<!-- Add own method filters here -->
</values-param>
- <values-param>
- <name>ws.rs.jaxb.context</name>
- <value>org.exoplatform.services.rest.wadl.research.Application</value>
-<!-- Add own jaxb context here -->
- </values-param>
</init-params>
</component>
<component>
<type>org.exoplatform.services.rest.impl.RequestHandlerImpl</type>
</component>
<component>
- <type>org.exoplatform.services.rest.impl.ExoContainerResourceBinder</type>
+ <type>org.exoplatform.services.rest.impl.BaseResourceBinder</type>
</component>
<component>
<type>org.exoplatform.services.rest.impl.ExoContainerDependencyInjector</type>
14 years, 8 months
exo-jcr SVN: r291 - ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet.
by do-not-reply@jboss.org
Author: aparfonov
Date: 2009-10-16 11:45:39 -0400 (Fri, 16 Oct 2009)
New Revision: 291
Modified:
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/BaseRestServlet.java
Log:
EXOJCR-185 :
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/BaseRestServlet.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/BaseRestServlet.java 2009-10-16 13:40:34 UTC (rev 290)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/BaseRestServlet.java 2009-10-16 15:45:39 UTC (rev 291)
@@ -66,7 +66,7 @@
env.put(HttpServletRequest.class, httpRequest);
env.put(HttpServletResponse.class, httpResponse);
env.put(ServletConfig.class, servletConfig);
- env.put(ServletContext.class, getServletContext());
+ env.put(ServletContext.class, servletConfig.getServletContext());
try
{
14 years, 8 months
exo-jcr SVN: r290 - jcr/trunk/component/webdav/src/main/java/org/exoplatform/services/jcr/webdav/command.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2009-10-16 09:40:34 -0400 (Fri, 16 Oct 2009)
New Revision: 290
Modified:
jcr/trunk/component/webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/PutCommand.java
Log:
EXOJCR-28 fixed bug in PUT method.
Modified: jcr/trunk/component/webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/PutCommand.java
===================================================================
--- jcr/trunk/component/webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/PutCommand.java 2009-10-16 12:46:33 UTC (rev 289)
+++ jcr/trunk/component/webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/PutCommand.java 2009-10-16 13:40:34 UTC (rev 290)
@@ -91,7 +91,8 @@
nullResourceLocks.checkLock(session, path, tokens);
}
- if (node == null || "add".equals(updatePolicyType))
+ //if (node == null || "add".equals(updatePolicyType))
+ if (node == null)
{
node = session.getRootNode().addNode(TextUtil.relativizePath(path), fileNodeType);
@@ -103,15 +104,16 @@
{
if ("add".equals(updatePolicyType))
{
- node = session.getRootNode().addNode(TextUtil.relativizePath(path), fileNodeType);
+ node = session.getRootNode().getNode(TextUtil.relativizePath(path));
if (!node.isNodeType("mix:versionable"))
{
+ node = session.getRootNode().addNode(TextUtil.relativizePath(path), fileNodeType);
node.addNode("jcr:content", contentNodeType);
updateContent(node, inputStream, mimeType, encoding, mixins);
}
else
{
- updateVersion(node, inputStream, mimeType, autoVersion, encoding, mixins);
+ updateVersion(node, inputStream, mimeType, encoding, autoVersion, mixins);
}
}
@@ -127,7 +129,7 @@
}
else
{
- updateVersion(node, inputStream, mimeType, autoVersion, encoding, mixins);
+ updateVersion(node, inputStream, mimeType, encoding, autoVersion, mixins);
}
}
}
14 years, 8 months
exo-jcr SVN: r289 - in jcr/trunk/component/core/src/main/java/org/exoplatform/services/jcr/impl: core/nodetype and 1 other directory.
by do-not-reply@jboss.org
Author: skabashnyuk
Date: 2009-10-16 08:46:33 -0400 (Fri, 16 Oct 2009)
New Revision: 289
Modified:
jcr/trunk/component/core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java
jcr/trunk/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeDataManagerImpl.java
Log:
EXOJCR-191 : Save default node types in repository
Modified: jcr/trunk/component/core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java
===================================================================
--- jcr/trunk/component/core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java 2009-10-16 09:11:03 UTC (rev 288)
+++ jcr/trunk/component/core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java 2009-10-16 12:46:33 UTC (rev 289)
@@ -19,8 +19,6 @@
package org.exoplatform.services.jcr.impl;
import org.exoplatform.container.ExoContainer;
-import org.exoplatform.container.component.ComponentPlugin;
-import org.exoplatform.container.configuration.ConfigurationManager;
import org.exoplatform.container.jmx.MX4JComponentAdapterFactory;
import org.exoplatform.management.annotations.Managed;
import org.exoplatform.management.annotations.ManagedDescription;
@@ -64,13 +62,10 @@
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
-import java.io.InputStream;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
-import java.util.Map;
-import javax.jcr.NamespaceException;
import javax.jcr.NamespaceRegistry;
import javax.jcr.RepositoryException;
import javax.jcr.nodetype.NodeTypeManager;
@@ -557,21 +552,22 @@
*/
private void load() throws RepositoryException
{
-
- JcrNodeTypeDataPersister nodeTypePersister =
- (JcrNodeTypeDataPersister)this.getComponentInstanceOfType(JcrNodeTypeDataPersister.class);
+ //Namespaces first
NamespaceDataPersister namespacePersister =
(NamespaceDataPersister)this.getComponentInstanceOfType(NamespaceDataPersister.class);
+ NamespaceRegistryImpl nsRegistry = (NamespaceRegistryImpl)getNamespaceRegistry();
- // Load from persistence
- nodeTypePersister.start();
namespacePersister.start();
+ nsRegistry.start();
- NamespaceRegistryImpl nsRegistry = (NamespaceRegistryImpl)getNamespaceRegistry();
+ //Node types now.
+ JcrNodeTypeDataPersister nodeTypePersister =
+ (JcrNodeTypeDataPersister)this.getComponentInstanceOfType(JcrNodeTypeDataPersister.class);
+
NodeTypeDataManagerImpl ntManager =
(NodeTypeDataManagerImpl)this.getComponentInstanceOfType(NodeTypeDataManagerImpl.class);
- // initialize internal components.
- nsRegistry.start();
+
+ nodeTypePersister.start();
ntManager.start();
}
Modified: jcr/trunk/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeDataManagerImpl.java
===================================================================
--- jcr/trunk/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeDataManagerImpl.java 2009-10-16 09:11:03 UTC (rev 288)
+++ jcr/trunk/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeDataManagerImpl.java 2009-10-16 12:46:33 UTC (rev 289)
@@ -38,7 +38,6 @@
import org.exoplatform.services.jcr.datamodel.QPathEntry;
import org.exoplatform.services.jcr.impl.Constants;
import org.exoplatform.services.jcr.impl.core.LocationFactory;
-
import org.exoplatform.services.jcr.impl.core.nodetype.registration.NodeDefinitionComparator;
import org.exoplatform.services.jcr.impl.core.nodetype.registration.NodeTypeConverter;
import org.exoplatform.services.jcr.impl.core.nodetype.registration.NodeTypeDataPersister;
@@ -112,7 +111,8 @@
public NodeTypeDataManagerImpl(final RepositoryEntry config, final LocationFactory locationFactory,
final NamespaceRegistry namespaceRegistry, final NodeTypeDataPersister persister,
- final ItemDataConsumer dataManager, final RepositoryIndexSearcherHolder indexSearcherHolder) throws RepositoryException
+ final ItemDataConsumer dataManager, final RepositoryIndexSearcherHolder indexSearcherHolder)
+ throws RepositoryException
{
this.namespaceRegistry = namespaceRegistry;
@@ -128,7 +128,6 @@
//this.nodeTypeRepository = new PersistedNodeTypeRepository(persister);
this.listeners = Collections.synchronizedMap(new WeakHashMap<NodeTypeManagerListener, NodeTypeManagerListener>());
this.buildInNodeTypesNames = new HashSet<InternalQName>();
- initDefault();
}
/**
@@ -982,6 +981,7 @@
return changesLog;
}
+
protected void initDefault() throws RepositoryException
{
long start = System.currentTimeMillis();
@@ -990,7 +990,8 @@
InputStream xml = NodeTypeManagerImpl.class.getResourceAsStream(NODETYPES_FILE);
if (xml != null)
{
- List<NodeTypeData> registerNodeTypes = registerNodeTypes(xml, ExtendedNodeTypeManager.IGNORE_IF_EXISTS,TEXT_XML);
+ List<NodeTypeData> registerNodeTypes =
+ registerNodeTypes(xml, ExtendedNodeTypeManager.IGNORE_IF_EXISTS, TEXT_XML);
for (NodeTypeData nodeTypeData : registerNodeTypes)
{
buildInNodeTypesNames.add(nodeTypeData.getName());
14 years, 8 months
exo-jcr SVN: r288 - ws/branches/2.2.x/rest/core.
by do-not-reply@jboss.org
Author: gazarenkov
Date: 2009-10-16 05:11:03 -0400 (Fri, 16 Oct 2009)
New Revision: 288
Removed:
ws/branches/2.2.x/rest/core/exo.ws.rest.core/
Log:
remove erroneusly created exo.ws.rest.core folder
14 years, 8 months