From: <fg...@us...> - 2011-06-16 11:21:00
|
Revision: 3540 http://openutils.svn.sourceforge.net/openutils/?rev=3540&view=rev Author: fgiust Date: 2011-06-16 11:20:53 +0000 (Thu, 16 Jun 2011) Log Message: ----------- test infrastructure Modified Paths: -------------- trunk/openutils-mgnlmedia/pom.xml trunk/openutils-mgnlmedia/src/main/resources/META-INF/magnolia/media.xml Added Paths: ----------- trunk/openutils-mgnlmedia/src/test/java/net/sourceforge/openutils/mgnlmedia/media/repotests/ trunk/openutils-mgnlmedia/src/test/java/net/sourceforge/openutils/mgnlmedia/media/repotests/MediaTests.java trunk/openutils-mgnlmedia/src/test/resources/log4j.dtd trunk/openutils-mgnlmedia/src/test/resources/test-magnolia.properties trunk/openutils-mgnlmedia/src/test/resources/test-repository/ trunk/openutils-mgnlmedia/src/test/resources/test-repository/jackrabbit-test-configuration.xml trunk/openutils-mgnlmedia/src/test/resources/test-repository/test-repositories.xml trunk/openutils-mgnlmedia/src/test/resources/test_dir.txt Modified: trunk/openutils-mgnlmedia/pom.xml =================================================================== --- trunk/openutils-mgnlmedia/pom.xml 2011-06-16 10:59:48 UTC (rev 3539) +++ trunk/openutils-mgnlmedia/pom.xml 2011-06-16 11:20:53 UTC (rev 3540) @@ -1,4 +1,5 @@ -<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"> +<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"> <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> @@ -100,6 +101,34 @@ </dependency> <dependency> <groupId>info.magnolia</groupId> + <artifactId>magnolia-module-fckEditor</artifactId> + <version>${magnolia.version}</version> + <optional>true</optional> + <exclusions> + <exclusion> + <groupId>javax.mail</groupId> + <artifactId>mail</artifactId> + </exclusion> + <exclusion> + <groupId>javax.jms</groupId> + <artifactId>jms</artifactId> + </exclusion> + <exclusion> + <groupId>com.sun.jdmk</groupId> + <artifactId>jmxtools</artifactId> + </exclusion> + <exclusion> + <groupId>com.sun.jmx</groupId> + <artifactId>jmxri</artifactId> + </exclusion> + <exclusion> + <groupId>pdfbox</groupId> + <artifactId>pdfbox</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>info.magnolia</groupId> <artifactId>magnolia-module-admininterface</artifactId> <version>${magnolia.version}</version> <exclusions> Modified: trunk/openutils-mgnlmedia/src/main/resources/META-INF/magnolia/media.xml =================================================================== --- trunk/openutils-mgnlmedia/src/main/resources/META-INF/magnolia/media.xml 2011-06-16 10:59:48 UTC (rev 3539) +++ trunk/openutils-mgnlmedia/src/main/resources/META-INF/magnolia/media.xml 2011-06-16 11:20:53 UTC (rev 3540) @@ -11,12 +11,9 @@ <dependency> <name>adminInterface</name> <version>4.0/*</version> + <optional>true</optional> </dependency> <dependency> - <name>fckEditor</name> - <version>4.0/*</version> - </dependency> - <dependency> <name>standard-templating-kit</name> <version>1.2/*</version> <optional>true</optional> Added: trunk/openutils-mgnlmedia/src/test/java/net/sourceforge/openutils/mgnlmedia/media/repotests/MediaTests.java =================================================================== --- trunk/openutils-mgnlmedia/src/test/java/net/sourceforge/openutils/mgnlmedia/media/repotests/MediaTests.java (rev 0) +++ trunk/openutils-mgnlmedia/src/test/java/net/sourceforge/openutils/mgnlmedia/media/repotests/MediaTests.java 2011-06-16 11:20:53 UTC (rev 3540) @@ -0,0 +1,63 @@ +/** + * + * SimpleMedia Module for Magnolia CMS (http://www.openmindlab.com/lab/products/media.html) + * Copyright(C) 2008-2011, Openmind S.r.l. http://www.openmindonline.it + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU 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 net.sourceforge.openutils.mgnlmedia.media.repotests; + +import info.magnolia.cms.core.Content; +import it.openutils.mgnlutils.test.RepositoryTestConfiguration; +import it.openutils.mgnlutils.test.TestNgRepositoryTestcase; + +import java.io.InputStream; + +import net.sourceforge.openutils.mgnlmedia.media.utils.MediaLoadUtils; + +import org.apache.commons.io.IOUtils; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + + +/** + * @author fgiust + * @version $Id$ + */ +@RepositoryTestConfiguration(jackrabbitRepositoryConfig = "/test-repository/jackrabbit-test-configuration.xml", repositoryConfig = "/test-repository/test-repositories.xml") +// , bootstrapFiles = "/test-bootstrap/media.x.xml" +public class MediaTests extends TestNgRepositoryTestcase +{ + + @Override + @BeforeClass + public void setUp() throws Exception + { + super.setUp(); + // MgnlContext.getHierarchyManager("media").save(); + } + + @Test(enabled = false) + public void uploadIco() throws Exception + { + InputStream is = getClass().getResourceAsStream("/images/openmind.ico"); + Content entry = MediaLoadUtils.loadEntry(is, "/test/folder", "openmind.ico", true); + + IOUtils.closeQuietly(is); + + Assert.assertNotNull(entry); + } + +} Property changes on: trunk/openutils-mgnlmedia/src/test/java/net/sourceforge/openutils/mgnlmedia/media/repotests/MediaTests.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-mgnlmedia/src/test/resources/log4j.dtd =================================================================== --- trunk/openutils-mgnlmedia/src/test/resources/log4j.dtd (rev 0) +++ trunk/openutils-mgnlmedia/src/test/resources/log4j.dtd 2011-06-16 11:20:53 UTC (rev 3540) @@ -0,0 +1,166 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<!-- Authors: Chris Taylor, Ceki Gulcu. --> + +<!-- Version: 1.2 --> + +<!-- A configuration element consists of optional renderer +elements,appender elements, categories and an optional root +element. --> + +<!ELEMENT log4j:configuration (renderer*, appender*,(category|logger)*,root?, + categoryFactory?)> + +<!-- The "threshold" attribute takes a level value such that all --> +<!-- logging statements with a level equal or below this value are --> +<!-- disabled. --> + +<!-- Setting the "debug" enable the printing of internal log4j logging --> +<!-- statements. --> + +<!-- By default, debug attribute is "null", meaning that we not do touch --> +<!-- internal log4j logging settings. The "null" value for the threshold --> +<!-- attribute can be misleading. The threshold field of a repository --> +<!-- cannot be set to null. The "null" value for the threshold attribute --> +<!-- simply means don't touch the threshold field, the threshold field --> +<!-- keeps its old value. --> + +<!ATTLIST log4j:configuration + xmlns:log4j CDATA #FIXED "http://jakarta.apache.org/log4j/" + threshold (all|debug|info|warn|error|fatal|off|null) "null" + debug (true|false|null) "null" +> + +<!-- renderer elements allow the user to customize the conversion of --> +<!-- message objects to String. --> + +<!ELEMENT renderer EMPTY> +<!ATTLIST renderer + renderedClass CDATA #REQUIRED + renderingClass CDATA #REQUIRED +> + +<!-- Appenders must have a name and a class. --> +<!-- Appenders may contain an error handler, a layout, optional parameters --> +<!-- and filters. They may also reference (or include) other appenders. --> +<!ELEMENT appender (errorHandler?, param*, layout?, filter*, appender-ref*)> +<!ATTLIST appender + name ID #REQUIRED + class CDATA #REQUIRED +> + +<!ELEMENT layout (param*)> +<!ATTLIST layout + class CDATA #REQUIRED +> + +<!ELEMENT filter (param*)> +<!ATTLIST filter + class CDATA #REQUIRED +> + +<!-- ErrorHandlers can be of any class. They can admit any number of --> +<!-- parameters. --> + +<!ELEMENT errorHandler (param*, root-ref?, logger-ref*, appender-ref?)> +<!ATTLIST errorHandler + class CDATA #REQUIRED +> + +<!ELEMENT root-ref EMPTY> + +<!ELEMENT logger-ref EMPTY> +<!ATTLIST logger-ref + ref IDREF #REQUIRED +> + +<!ELEMENT param EMPTY> +<!ATTLIST param + name CDATA #REQUIRED + value CDATA #REQUIRED +> + + +<!-- The priority class is org.apache.log4j.Level by default --> +<!ELEMENT priority (param*)> +<!ATTLIST priority + class CDATA #IMPLIED + value CDATA #REQUIRED +> + +<!-- The level class is org.apache.log4j.Level by default --> +<!ELEMENT level (param*)> +<!ATTLIST level + class CDATA #IMPLIED + value CDATA #REQUIRED +> + + +<!-- If no level element is specified, then the configurator MUST not --> +<!-- touch the level of the named category. --> +<!ELEMENT category (param*,(priority|level)?,appender-ref*)> +<!ATTLIST category + class CDATA #IMPLIED + name CDATA #REQUIRED + additivity (true|false) "true" +> + +<!-- If no level element is specified, then the configurator MUST not --> +<!-- touch the level of the named logger. --> +<!ELEMENT logger (level?,appender-ref*)> +<!ATTLIST logger + name ID #REQUIRED + additivity (true|false) "true" +> + + +<!ELEMENT categoryFactory (param*)> +<!ATTLIST categoryFactory + class CDATA #REQUIRED> + +<!ELEMENT appender-ref EMPTY> +<!ATTLIST appender-ref + ref IDREF #REQUIRED +> + +<!-- If no priority element is specified, then the configurator MUST not --> +<!-- touch the priority of root. --> +<!-- The root category always exists and cannot be subclassed. --> +<!ELEMENT root (param*, (priority|level)?, appender-ref*)> + + +<!-- ==================================================================== --> +<!-- A logging event --> +<!-- ==================================================================== --> +<!ELEMENT log4j:eventSet (log4j:event*)> +<!ATTLIST log4j:eventSet + xmlns:log4j CDATA #FIXED "http://jakarta.apache.org/log4j/" + version (1.1|1.2) "1.2" + includesLocationInfo (true|false) "true" +> + + + +<!ELEMENT log4j:event (log4j:message, log4j:NDC?, log4j:throwable?, + log4j:locationInfo?) > + +<!-- The timestamp format is application dependent. --> +<!ATTLIST log4j:event + logger CDATA #REQUIRED + level CDATA #REQUIRED + thread CDATA #REQUIRED + timestamp CDATA #REQUIRED +> + +<!ELEMENT log4j:message (#PCDATA)> +<!ELEMENT log4j:NDC (#PCDATA)> + +<!ELEMENT log4j:throwable (#PCDATA)> + +<!ELEMENT log4j:locationInfo EMPTY> +<!ATTLIST log4j:locationInfo + class CDATA #REQUIRED + method CDATA #REQUIRED + file CDATA #REQUIRED + line CDATA #REQUIRED +> Property changes on: trunk/openutils-mgnlmedia/src/test/resources/log4j.dtd ___________________________________________________________________ Added: svn:mime-type + text/xml Added: svn:eol-style + native Added: trunk/openutils-mgnlmedia/src/test/resources/test-magnolia.properties =================================================================== --- trunk/openutils-mgnlmedia/src/test/resources/test-magnolia.properties (rev 0) +++ trunk/openutils-mgnlmedia/src/test/resources/test-magnolia.properties 2011-06-16 11:20:53 UTC (rev 3540) @@ -0,0 +1,39 @@ +magnolia.basedir=target/magnolia-test-data +magnolia.cache.startdir=${magnolia.basedir}/cache +magnolia.upload.tmpdir=${magnolia.basedir}/tmp +magnolia.exchange.history=${magnolia.basedir}/history + +magnolia.app.rootdir=. + +magnolia.repositories.home=target/test-repositories +# points to the classpath resources, but will be extracted and the property reset + +magnolia.repositories.config=/test-repositories.xml +magnolia.repositories.jackrabbit.config=/jackrabbit-test-configuration.xml + +log4j.config=WEB-INF/config/default/log4j.xml +magnolia.logs.dir=${magnolia.base}/logs + +# The directories in which the bootstrap files are searched +magnolia.bootstrap.dir=WEB-INF/bootstrap/author WEB-INF/bootstrap/common + + +magnolia.bootstrap.authorInstance=true +magnolia.bootstrap.samples=false +magnolia.develop=true + +magnolia.connection.jcr.userId = admin +magnolia.connection.jcr.password = admin + +magnolia.update.auto=true + +magnolia.defaultpage = /sapere.html + +####### solo per test ##### +info.magnolia.logging.AuditLoggingManager=info.magnolia.logging.AuditLoggingManager +info.magnolia.link.LinkTransformerManager=info.magnolia.link.LinkTransformerManager +####### + +info.magnolia.cms.i18n.I18nContentSupport=info.magnolia.cms.i18n.DefaultI18nContentSupport + +info.magnolia.cms.core.search.SearchFactory=info.magnolia.cms.core.search.DefaultSearchFactory Property changes on: trunk/openutils-mgnlmedia/src/test/resources/test-magnolia.properties ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-mgnlmedia/src/test/resources/test-repository/jackrabbit-test-configuration.xml =================================================================== --- trunk/openutils-mgnlmedia/src/test/resources/test-repository/jackrabbit-test-configuration.xml (rev 0) +++ trunk/openutils-mgnlmedia/src/test/resources/test-repository/jackrabbit-test-configuration.xml 2011-06-16 11:20:53 UTC (rev 3540) @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Repository PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 1.6//EN" "http://jackrabbit.apache.org/dtd/repository-1.6.dtd"> +<!-- TESTING-ONLY configuration! repositories are in memory only and any change is lost upon restart --> +<Repository> + <FileSystem class="org.apache.jackrabbit.core.fs.mem.MemoryFileSystem"> + </FileSystem> + <Security appName="Jackrabbit"> + <AccessManager class="org.apache.jackrabbit.core.security.SimpleAccessManager"></AccessManager> + <LoginModule class="org.apache.jackrabbit.core.security.SimpleLoginModule"> + <param name="anonymousId" value="anonymous" /> + </LoginModule> + </Security> + <Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default" /> + <Workspace name="default"> + <FileSystem class="org.apache.jackrabbit.core.fs.mem.MemoryFileSystem"> + </FileSystem> + <PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.BundleFsPersistenceManager"> + <param name="blobFSBlockSize" value="1" /><!-- store in memory --> + </PersistenceManager> + <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex"> + <param name="path" value="${wsp.home}/index" /> + <param name="useCompoundFile" value="false" /><!-- lasciare a false solo per i tests --> + <param name="minMergeDocs" value="100" /> + <param name="volatileIdleTime" value="3" /> + <param name="maxMergeDocs" value="100000" /> + <param name="mergeFactor" value="10" /> + <param name="maxFieldLength" value="10000" /> + <param name="bufferSize" value="10" /> + <param name="cacheSize" value="1000" /> + <param name="autoRepair" value="true" /> + <param name="queryClass" value="org.apache.jackrabbit.core.query.QueryImpl" /> + <param name="respectDocumentOrder" value="true" /> + <param name="resultFetchSize" value="2147483647" /> + <param name="extractorPoolSize" value="3" /> + <param name="extractorTimeout" value="100" /> + <param name="extractorBackLogSize" value="100" /> + <param name="enableConsistencyCheck" value="true" /> + <param name="autoRepair" value="true" /> + <param name="forceConsistencyCheck" value="false" /> + <param name="directoryManagerClass" value="org.apache.jackrabbit.core.query.lucene.directory.RAMDirectoryManager" /> + <param name="supportHighlighting" value="true" /> + <param name="analyzer" value="net.sourceforge.openutils.mgnlcriteria.utils.ASCIIFoldingAnalyzer" /> + </SearchIndex> + </Workspace> + <Versioning rootPath="${rep.home}/version"> + <FileSystem class="org.apache.jackrabbit.core.fs.mem.MemoryFileSystem"> + </FileSystem> + <PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.BundleFsPersistenceManager"> + <param name="blobFSBlockSize" value="1" /><!-- store in memory --> + </PersistenceManager> + </Versioning> +</Repository> \ No newline at end of file Property changes on: trunk/openutils-mgnlmedia/src/test/resources/test-repository/jackrabbit-test-configuration.xml ___________________________________________________________________ Added: svn:mime-type + text/xml Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-mgnlmedia/src/test/resources/test-repository/test-repositories.xml =================================================================== --- trunk/openutils-mgnlmedia/src/test/resources/test-repository/test-repositories.xml (rev 0) +++ trunk/openutils-mgnlmedia/src/test/resources/test-repository/test-repositories.xml 2011-06-16 11:20:53 UTC (rev 3540) @@ -0,0 +1,52 @@ +<!-- + $Id$ +--> +<!DOCTYPE JCR [ +<!ELEMENT Map (#PCDATA)> +<!ATTLIST Map + name CDATA #REQUIRED + repositoryName CDATA #REQUIRED + workspaceName CDATA #REQUIRED> +<!ELEMENT JCR (RepositoryMapping|Repository)*> +<!ELEMENT param (#PCDATA)> +<!ATTLIST param + name CDATA #REQUIRED + value CDATA #REQUIRED> +<!ELEMENT Repository (param|workspace)*> +<!ATTLIST Repository + loadOnStartup CDATA #REQUIRED + name CDATA #REQUIRED + provider CDATA #REQUIRED> +<!ELEMENT workspace (#PCDATA)> +<!ATTLIST workspace + name CDATA #REQUIRED> +<!ELEMENT RepositoryMapping (Map)*> +]><JCR> + <RepositoryMapping> + <Map name="website" repositoryName="magnolia" workspaceName="website" /> + <Map name="config" repositoryName="magnolia" workspaceName="config" /> + <Map name="users" repositoryName="magnolia" workspaceName="users" /> + <Map name="userroles" repositoryName="magnolia" workspaceName="userroles" /> + <Map name="usergroups" repositoryName="magnolia" workspaceName="usergroups" /> + <Map name="mgnlSystem" repositoryName="magnolia" workspaceName="mgnlSystem" /> <!-- System internal data --> + <Map name="mgnlVersion" repositoryName="magnolia" workspaceName="mgnlVersion" /> <!-- magnolia version workspace --> + <Map name="media" repositoryName="magnolia" workspaceName="media" /> + </RepositoryMapping> + + <!-- magnolia default repository --> + <Repository name="magnolia" provider="info.magnolia.jackrabbit.ProviderImpl" loadOnStartup="true"> + <param name="configFile" value="${magnolia.repositories.jackrabbit.config}" /> + <param name="repositoryHome" value="${magnolia.repositories.home}/magnolia" /> + <param name="contextFactoryClass" value="org.apache.jackrabbit.core.jndi.provider.DummyInitialContextFactory" /> + <param name="providerURL" value="localhost" /> + <param name="bindName" value="${magnolia.webapp}" /> + <workspace name="website" /> + <workspace name="config" /> + <workspace name="users" /> + <workspace name="userroles" /> + <workspace name="usergroups" /> + <workspace name="mgnlSystem" /> + <workspace name="mgnlVersion" /> + <workspace name="media" /> + </Repository> +</JCR> \ No newline at end of file Property changes on: trunk/openutils-mgnlmedia/src/test/resources/test-repository/test-repositories.xml ___________________________________________________________________ Added: svn:mime-type + text/xml Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-mgnlmedia/src/test/resources/test_dir.txt =================================================================== --- trunk/openutils-mgnlmedia/src/test/resources/test_dir.txt (rev 0) +++ trunk/openutils-mgnlmedia/src/test/resources/test_dir.txt 2011-06-16 11:20:53 UTC (rev 3540) @@ -0,0 +1 @@ +// file used in unit test to find the test resource root \ No newline at end of file Property changes on: trunk/openutils-mgnlmedia/src/test/resources/test_dir.txt ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |