Author: sergiykarpenko
Date: 2010-06-17 03:49:10 -0400 (Thu, 17 Jun 2010)
New Revision: 2643
Added:
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/BaseStandaloneTest.java
core/trunk/exo.core.component.document/src/test/resources/test.policy
Modified:
core/trunk/exo.core.component.document/pom.xml
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestDocumentReadersIncomVals.java
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestHtmlDocumentReader.java
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestMSExcelDocumentReader.java
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestMSOutlookDocumentReader.java
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestMSWordDocumentReader.java
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestOpenOfficeDocumentReader.java
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestPDFDocumentReader.java
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestPPTDocumentReader.java
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestPropertiesExtracting.java
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestTextPlainDocumentReader.java
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestXMLDocumentReader.java
core/trunk/pom.xml
Log:
EXOJCR-756: now test works with no permission. test.policy added
Modified: core/trunk/exo.core.component.document/pom.xml
===================================================================
--- core/trunk/exo.core.component.document/pom.xml 2010-06-16 14:48:30 UTC (rev 2642)
+++ core/trunk/exo.core.component.document/pom.xml 2010-06-17 07:49:10 UTC (rev 2643)
@@ -46,6 +46,11 @@
<artifactId>exo.kernel.container</artifactId>
</dependency>
<dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.commons.test</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</dependency>
@@ -102,8 +107,92 @@
<include>**/*.html</include>
<include>**/*.msg</include>
<include>**/*.pst</include>
+ <include>**/*.policy</include>
</includes>
</testResource>
</testResources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+
<!--argLine>-Djava.security.manager=org.exoplatform.commons.test.TestSecurityManager
-Djava.security.policy=${project.build.directory}/test-classes/test.policy</argLine-->
+ <systemProperties>
+ <!--property>
+ <name>jcr.test.configuration.file</name>
+ <value>${jcr.test.configuration.file}</value>
+ </property-->
+ <property>
+ <name>emma.coverage.out.file</name>
+ <value>target/emma/coverage.ec</value>
+ </property>
+ </systemProperties>
+ <includes>
+
<include>org/exoplatform/services/document/**/Test*.java</include>
+ </includes>
+ <!--excludes>
+
<exclude>org/exoplatform/services/document/**/Test*.java</exclude>
+ </excludes-->
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <!--execution>
+ <id>delete-sources</id>
+ <phase>process-sources</phase>
+ <configuration>
+ <tasks>
+ <echo>Remove files that have been customized</echo>
+ <delete>
+ <fileset
dir="${project.build.directory}/generated-sources/javacc/org/exoplatform/services/jcr/impl/core/query">
+ <include name="sql/ASTLiteral.java" />
+ <include name="sql/ASTContainsExpression.java"
/>
+ <include name="sql/ASTPredicate.java" />
+ <include name="sql/ASTIdentifier.java" />
+ <include name="xpath/SimpleNode.java" />
+ </fileset>
+ </delete>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution-->
+ <execution>
+ <id>prepare-test-policy</id>
+ <phase>process-test-resources</phase>
+ <configuration>
+ <tasks>
+ <echo>Creating Access Policy for tests</echo>
+ <makeurl file="${settings.localRepository}"
property="localRepositoryURL"/>
+ <makeurl file="${project.build.outputDirectory}"
property="outputDirectoryURL"/>
+ <makeurl file="${project.build.testOutputDirectory}"
property="testOutputDirectoryURL"/>
+ <copy todir="${project.build.testOutputDirectory}"
overwrite="true">
+ <fileset
dir="${project.basedir}/src/test/resources/">
+ <include name="test.policy"/>
+ </fileset>
+ <filterset>
+ <filter token="MAVEN_REPO"
value="${localRepositoryURL}"/>
+ <filter token="MAIN_CLASSES"
value="${outputDirectoryURL}"/>
+ <filter token="TEST_CLASSES"
value="${testOutputDirectoryURL}"/>
+ </filterset>
+ </copy>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>ant</groupId>
+ <artifactId>ant-optional</artifactId>
+ <version>1.5.3-1</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
</build>
-</project>
+</project>
Added:
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/BaseStandaloneTest.java
===================================================================
---
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/BaseStandaloneTest.java
(rev 0)
+++
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/BaseStandaloneTest.java 2010-06-17
07:49:10 UTC (rev 2643)
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2003-2010 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.services.document.test;
+
+import org.exoplatform.commons.utils.MimeTypeResolver;
+import org.exoplatform.container.PortalContainer;
+import org.exoplatform.test.BasicTestCase;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * <br/>Date:
+ *
+ * @author <a href="karpenko.sergiy(a)gmail.com">Karpenko Sergiy</a>
+ * @version $Id: BaseStandaloneTest.java 111 2008-11-11 11:11:11Z serg $
+ */
+public class BaseStandaloneTest extends BasicTestCase
+{
+
+ public PortalContainer pcontainer;
+
+ protected MimeTypeResolver mimetypeResolver = new MimeTypeResolver();
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ pcontainer = PortalContainer.getInstance();
+ }
+
+ public Object getComponentInstanceOfType(Class componentType)
+ {
+ return pcontainer.getComponentInstanceOfType(componentType);
+ }
+
+ /**
+ * Its a wrapper to cheat security.
+ */
+ public File createTempFile(String prefix, String suffix) throws IOException
+ {
+ return File.createTempFile(prefix, suffix);
+ }
+
+ /**
+ * Its a wrapper to cheat security.
+ */
+ public boolean createNewFile(File f) throws IOException
+ {
+ return f.createNewFile();
+ }
+
+ /**
+ * Its a wrapper to cheat security.
+ */
+ public InputStream getInputStream(File f) throws IOException
+ {
+ return new FileInputStream(f);
+ }
+
+ /**
+ * Its a wrapper to cheat security.
+ */
+ public boolean deleteFile(File f) throws IOException
+ {
+ return f.delete();
+ }
+
+}
Modified:
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestDocumentReadersIncomVals.java
===================================================================
---
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestDocumentReadersIncomVals.java 2010-06-16
14:48:30 UTC (rev 2642)
+++
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestDocumentReadersIncomVals.java 2010-06-17
07:49:10 UTC (rev 2643)
@@ -29,10 +29,8 @@
import org.exoplatform.services.document.impl.PPTDocumentReader;
import org.exoplatform.services.document.impl.TextPlainDocumentReader;
import org.exoplatform.services.document.impl.XMLDocumentReader;
-import org.exoplatform.test.BasicTestCase;
import java.io.File;
-import java.io.FileInputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
@@ -45,9 +43,8 @@
* @author <a href="karpenko.sergiy(a)gmail.com">Karpenko Sergiy</a>
* @version $Id: TestDocumentReadersIncomVals.java 111 2008-11-11 11:11:11Z serg $
*/
-public class TestDocumentReadersIncomVals extends BasicTestCase
+public class TestDocumentReadersIncomVals extends BaseStandaloneTest
{
-
List<DocumentReader> serviceList;
public TestDocumentReadersIncomVals()
@@ -99,13 +96,13 @@
{
StringBuilder sb = new StringBuilder();
- File f = File.createTempFile("dfd", "suf");
- f.createNewFile();
+ File f = createTempFile("dfd", "suf");
+ createNewFile(f);
InputStream in;
for (int i = 0; i < serviceList.size(); i++)
{
- in = new FileInputStream(f);
+ in = getInputStream(f);
try
{
assertEquals("", serviceList.get(i).getContentAsText(in));
@@ -124,6 +121,6 @@
System.out.println(sb.toString());
}
- f.delete();
+ deleteFile(f);
}
}
Modified:
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestHtmlDocumentReader.java
===================================================================
---
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestHtmlDocumentReader.java 2010-06-16
14:48:30 UTC (rev 2642)
+++
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestHtmlDocumentReader.java 2010-06-17
07:49:10 UTC (rev 2643)
@@ -18,11 +18,8 @@
*/
package org.exoplatform.services.document.test;
-import org.exoplatform.commons.utils.MimeTypeResolver;
-import org.exoplatform.container.PortalContainer;
import org.exoplatform.services.document.DocumentReader;
import org.exoplatform.services.document.DocumentReaderService;
-import org.exoplatform.test.BasicTestCase;
import java.io.InputStream;
@@ -33,20 +30,19 @@
* @version $Id: $
*/
-public class TestHtmlDocumentReader extends BasicTestCase
+public class TestHtmlDocumentReader extends BaseStandaloneTest
{
DocumentReaderService service_;
public void setUp() throws Exception
{
- PortalContainer pcontainer = PortalContainer.getInstance();
- service_ =
(DocumentReaderService)pcontainer.getComponentInstanceOfType(DocumentReaderService.class);
+ super.setUp();
+ service_ =
(DocumentReaderService)getComponentInstanceOfType(DocumentReaderService.class);
}
public void testGetContentAsString() throws Exception
{
InputStream is =
TestHtmlDocumentReader.class.getResourceAsStream("/test.html");
- MimeTypeResolver mimetypeResolver = new MimeTypeResolver();
String mimeType = mimetypeResolver.getMimeType("test.html");
DocumentReader dr = service_.getDocumentReader(mimeType);
Modified:
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestMSExcelDocumentReader.java
===================================================================
---
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestMSExcelDocumentReader.java 2010-06-16
14:48:30 UTC (rev 2642)
+++
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestMSExcelDocumentReader.java 2010-06-17
07:49:10 UTC (rev 2643)
@@ -18,9 +18,7 @@
*/
package org.exoplatform.services.document.test;
-import org.exoplatform.container.PortalContainer;
import org.exoplatform.services.document.DocumentReaderService;
-import org.exoplatform.test.BasicTestCase;
import java.io.InputStream;
@@ -31,14 +29,14 @@
* @version $Id: $
*/
-public class TestMSExcelDocumentReader extends BasicTestCase
+public class TestMSExcelDocumentReader extends BaseStandaloneTest
{
DocumentReaderService service_;
public void setUp() throws Exception
{
- PortalContainer pcontainer = PortalContainer.getInstance();
- service_ =
(DocumentReaderService)pcontainer.getComponentInstanceOfType(DocumentReaderService.class);
+ super.setUp();
+ service_ =
(DocumentReaderService)getComponentInstanceOfType(DocumentReaderService.class);
}
public void testGetContentAsString() throws Exception
Modified:
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestMSOutlookDocumentReader.java
===================================================================
---
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestMSOutlookDocumentReader.java 2010-06-16
14:48:30 UTC (rev 2642)
+++
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestMSOutlookDocumentReader.java 2010-06-17
07:49:10 UTC (rev 2643)
@@ -18,7 +18,6 @@
*/
package org.exoplatform.services.document.test;
-import org.exoplatform.container.PortalContainer;
import org.exoplatform.services.document.DocumentReaderService;
import org.exoplatform.test.BasicTestCase;
@@ -31,14 +30,14 @@
* @version $Id: $
*/
-public class TestMSOutlookDocumentReader extends BasicTestCase
+public class TestMSOutlookDocumentReader extends BaseStandaloneTest
{
DocumentReaderService service_;
public void setUp() throws Exception
{
- PortalContainer pcontainer = PortalContainer.getInstance();
- service_ =
(DocumentReaderService)pcontainer.getComponentInstanceOfType(DocumentReaderService.class);
+ super.setUp();
+ service_ =
(DocumentReaderService)getComponentInstanceOfType(DocumentReaderService.class);
}
public void testGetContentAsString() throws Exception
Modified:
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestMSWordDocumentReader.java
===================================================================
---
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestMSWordDocumentReader.java 2010-06-16
14:48:30 UTC (rev 2642)
+++
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestMSWordDocumentReader.java 2010-06-17
07:49:10 UTC (rev 2643)
@@ -18,9 +18,7 @@
*/
package org.exoplatform.services.document.test;
-import org.exoplatform.container.PortalContainer;
import org.exoplatform.services.document.DocumentReaderService;
-import org.exoplatform.test.BasicTestCase;
import java.io.InputStream;
@@ -31,14 +29,14 @@
* @version $Id: $
*/
-public class TestMSWordDocumentReader extends BasicTestCase
+public class TestMSWordDocumentReader extends BaseStandaloneTest
{
DocumentReaderService service_;
public void setUp() throws Exception
{
- PortalContainer pcontainer = PortalContainer.getInstance();
- service_ =
(DocumentReaderService)pcontainer.getComponentInstanceOfType(DocumentReaderService.class);
+ super.setUp();
+ service_ =
(DocumentReaderService)getComponentInstanceOfType(DocumentReaderService.class);
}
public void testGetContentAsStringTemplate() throws Exception
Modified:
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestOpenOfficeDocumentReader.java
===================================================================
---
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestOpenOfficeDocumentReader.java 2010-06-16
14:48:30 UTC (rev 2642)
+++
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestOpenOfficeDocumentReader.java 2010-06-17
07:49:10 UTC (rev 2643)
@@ -18,9 +18,7 @@
*/
package org.exoplatform.services.document.test;
-import org.exoplatform.container.PortalContainer;
import org.exoplatform.services.document.DocumentReaderService;
-import org.exoplatform.test.BasicTestCase;
import java.io.InputStream;
@@ -31,15 +29,14 @@
* @version $Id: $
*/
-public class TestOpenOfficeDocumentReader extends BasicTestCase
+public class TestOpenOfficeDocumentReader extends BaseStandaloneTest
{
-
DocumentReaderService service_;
public void setUp() throws Exception
{
- PortalContainer pcontainer = PortalContainer.getInstance();
- service_ =
(DocumentReaderService)pcontainer.getComponentInstanceOfType(DocumentReaderService.class);
+ super.setUp();
+ service_ =
(DocumentReaderService)getComponentInstanceOfType(DocumentReaderService.class);
}
public void testGetContentAsString() throws Exception
Modified:
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestPDFDocumentReader.java
===================================================================
---
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestPDFDocumentReader.java 2010-06-16
14:48:30 UTC (rev 2642)
+++
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestPDFDocumentReader.java 2010-06-17
07:49:10 UTC (rev 2643)
@@ -18,9 +18,7 @@
*/
package org.exoplatform.services.document.test;
-import org.exoplatform.container.PortalContainer;
import org.exoplatform.services.document.DocumentReaderService;
-import org.exoplatform.test.BasicTestCase;
import java.io.InputStream;
@@ -31,14 +29,14 @@
* @version $Id: $
*/
-public class TestPDFDocumentReader extends BasicTestCase
+public class TestPDFDocumentReader extends BaseStandaloneTest
{
DocumentReaderService service_;
public void setUp() throws Exception
{
- PortalContainer pcontainer = PortalContainer.getInstance();
- service_ =
(DocumentReaderService)pcontainer.getComponentInstanceOfType(DocumentReaderService.class);
+ super.setUp();
+ service_ =
(DocumentReaderService)getComponentInstanceOfType(DocumentReaderService.class);
}
public void testGetContentAsString() throws Exception
Modified:
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestPPTDocumentReader.java
===================================================================
---
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestPPTDocumentReader.java 2010-06-16
14:48:30 UTC (rev 2642)
+++
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestPPTDocumentReader.java 2010-06-17
07:49:10 UTC (rev 2643)
@@ -18,9 +18,7 @@
*/
package org.exoplatform.services.document.test;
-import org.exoplatform.container.PortalContainer;
import org.exoplatform.services.document.DocumentReaderService;
-import org.exoplatform.test.BasicTestCase;
import java.io.InputStream;
@@ -31,15 +29,14 @@
* @version $Id: $
*/
-public class TestPPTDocumentReader extends BasicTestCase
+public class TestPPTDocumentReader extends BaseStandaloneTest
{
-
DocumentReaderService service_;
public void setUp() throws Exception
{
- PortalContainer pcontainer = PortalContainer.getInstance();
- service_ =
(DocumentReaderService)pcontainer.getComponentInstanceOfType(DocumentReaderService.class);
+ super.setUp();
+ service_ =
(DocumentReaderService)getComponentInstanceOfType(DocumentReaderService.class);
}
public void testGetContentAsString() throws Exception
Modified:
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestPropertiesExtracting.java
===================================================================
---
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestPropertiesExtracting.java 2010-06-16
14:48:30 UTC (rev 2642)
+++
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestPropertiesExtracting.java 2010-06-17
07:49:10 UTC (rev 2643)
@@ -18,10 +18,7 @@
*/
package org.exoplatform.services.document.test;
-import junit.framework.TestCase;
-
import org.exoplatform.commons.utils.ISO8601;
-import org.exoplatform.container.PortalContainer;
import org.exoplatform.services.document.DCMetaData;
import org.exoplatform.services.document.DocumentReader;
import org.exoplatform.services.document.DocumentReaderService;
@@ -32,20 +29,14 @@
import java.util.Map;
import java.util.Properties;
-public class TestPropertiesExtracting extends TestCase
+public class TestPropertiesExtracting extends BaseStandaloneTest
{
-
DocumentReaderService service_;
- public TestPropertiesExtracting(String name)
- {
- super(name);
- }
-
public void setUp() throws Exception
{
- PortalContainer pcontainer = PortalContainer.getInstance();
- service_ =
(DocumentReaderService)pcontainer.getComponentInstanceOfType(DocumentReaderService.class);
+ super.setUp();
+ service_ =
(DocumentReaderService)getComponentInstanceOfType(DocumentReaderService.class);
}
public void testPDFDocumentReaderService() throws Exception
Modified:
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestTextPlainDocumentReader.java
===================================================================
---
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestTextPlainDocumentReader.java 2010-06-16
14:48:30 UTC (rev 2642)
+++
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestTextPlainDocumentReader.java 2010-06-17
07:49:10 UTC (rev 2643)
@@ -18,9 +18,7 @@
*/
package org.exoplatform.services.document.test;
-import org.exoplatform.container.PortalContainer;
import org.exoplatform.services.document.DocumentReaderService;
-import org.exoplatform.test.BasicTestCase;
import java.io.InputStream;
@@ -31,15 +29,14 @@
* @version $Id: $
*/
-public class TestTextPlainDocumentReader extends BasicTestCase
+public class TestTextPlainDocumentReader extends BaseStandaloneTest
{
-
DocumentReaderService service_;
public void setUp() throws Exception
{
- PortalContainer pcontainer = PortalContainer.getInstance();
- service_ =
(DocumentReaderService)pcontainer.getComponentInstanceOfType(DocumentReaderService.class);
+ super.setUp();
+ service_ =
(DocumentReaderService)getComponentInstanceOfType(DocumentReaderService.class);
}
public void testGetContentAsString() throws Exception
Modified:
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestXMLDocumentReader.java
===================================================================
---
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestXMLDocumentReader.java 2010-06-16
14:48:30 UTC (rev 2642)
+++
core/trunk/exo.core.component.document/src/test/java/org/exoplatform/services/document/test/TestXMLDocumentReader.java 2010-06-17
07:49:10 UTC (rev 2643)
@@ -18,9 +18,7 @@
*/
package org.exoplatform.services.document.test;
-import org.exoplatform.container.PortalContainer;
import org.exoplatform.services.document.DocumentReaderService;
-import org.exoplatform.test.BasicTestCase;
import java.io.InputStream;
@@ -31,14 +29,14 @@
* @version $Id: $
*/
-public class TestXMLDocumentReader extends BasicTestCase
+public class TestXMLDocumentReader extends BaseStandaloneTest
{
DocumentReaderService service_;
public void setUp() throws Exception
{
- PortalContainer pcontainer = PortalContainer.getInstance();
- service_ =
(DocumentReaderService)pcontainer.getComponentInstanceOfType(DocumentReaderService.class);
+ super.setUp();
+ service_ =
(DocumentReaderService)getComponentInstanceOfType(DocumentReaderService.class);
}
public void testGetContentAsString() throws Exception
Added: core/trunk/exo.core.component.document/src/test/resources/test.policy
===================================================================
--- core/trunk/exo.core.component.document/src/test/resources/test.policy
(rev 0)
+++ core/trunk/exo.core.component.document/src/test/resources/test.policy 2010-06-17
07:49:10 UTC (rev 2643)
@@ -0,0 +1,12 @@
+grant codeBase "@MAVEN_REPO@-"{
+ permission java.security.AllPermission;
+};
+
+grant codeBase "@MAIN_CLASSES@-"{
+ permission java.security.AllPermission;
+};
+
+grant codeBase "@TEST_CLASSES@-"{
+ permission java.lang.RuntimePermission "getJCRSystemSession";
+ permission java.lang.RuntimePermission "manageRepository";
+};
Modified: core/trunk/pom.xml
===================================================================
--- core/trunk/pom.xml 2010-06-16 14:48:30 UTC (rev 2642)
+++ core/trunk/pom.xml 2010-06-17 07:49:10 UTC (rev 2643)
@@ -76,6 +76,12 @@
<artifactId>exo.kernel.commons</artifactId>
<version>${org.exoplatform.kernel.version}</version>
</dependency>
+
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.commons.test</artifactId>
+ <version>${org.exoplatform.kernel.version}</version>
+ </dependency>
<dependency>
<groupId>org.exoplatform.kernel</groupId>