You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ol...@apache.org on 2019/06/16 05:41:16 UTC
[sling-org-apache-sling-i18n] branch master updated: SLING-8514
Make Pax Exam testing compliant with Java 9 and higher
This is an automated email from the ASF dual-hosted git repository.
olli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-i18n.git
The following commit(s) were added to refs/heads/master by this push:
new 797930e SLING-8514 Make Pax Exam testing compliant with Java 9 and higher
797930e is described below
commit 797930e367d561ef7d7abce6d9d188cf5900413e
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Sun Jun 16 07:40:25 2019 +0200
SLING-8514 Make Pax Exam testing compliant with Java 9 and higher
* Use Sling Bundle Parent 35
* Use bnd Maven plugins
* Update Pax Exam to 4.13.1
* Use Testing PaxExam 3.0.0
* Update Felix Framework to 6.0.3
---
bnd.bnd | 16 ++
pom.xml | 159 +++++---------
.../org/apache/sling/i18n/it/I18nTestSupport.java | 62 ++++++
.../sling/i18n/it/ResourceBundleProviderIT.java | 238 ++-------------------
src/test/resources/repoinit.txt | 23 --
5 files changed, 153 insertions(+), 345 deletions(-)
diff --git a/bnd.bnd b/bnd.bnd
new file mode 100644
index 0000000..24986a0
--- /dev/null
+++ b/bnd.bnd
@@ -0,0 +1,16 @@
+Conditional-Package:\
+ org.apache.sling.commons.osgi
+
+Require-Capability:\
+ osgi.implementation;filter:="(&(osgi.implementation=osgi.http)(version>=1.0)(!(version>=2.0)))"
+
+Sling-Nodetypes:\
+ SLING-INF/nodetypes/jcrlanguage.cnd,\
+ SLING-INF/nodetypes/message.cnd
+
+-includeresource:\
+ @jackrabbit-jcr-commons-*.jar!/(org/apache/jackrabbit/util/ISO9075.*|org/apache/jackrabbit/util/XMLChar.*|org/apache/jackrabbit/util/Text.*|org/apache/jackrabbit/commons/json/Json*)
+
+-removeheaders:\
+ Include-Resource,\
+ Private-Package
diff --git a/pom.xml b/pom.xml
index 8a1a464..9fee8f4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
+<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -20,68 +20,40 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
+
<parent>
<groupId>org.apache.sling</groupId>
- <artifactId>sling</artifactId>
- <version>33</version>
+ <artifactId>sling-bundle-parent</artifactId>
+ <version>35</version>
<relativePath />
</parent>
<artifactId>org.apache.sling.i18n</artifactId>
- <packaging>bundle</packaging>
<version>2.5.15-SNAPSHOT</version>
<name>Apache Sling I18N Support</name>
- <description>
- Support for creating Java I18N ResourceBundles from repository
- resources.
- </description>
+ <description>Support for creating Java I18N ResourceBundles from repository resources.</description>
<properties>
- <exam.version>4.9.1</exam.version>
- <org.ops4j.pax.logging.DefaultServiceLog.level>INFO</org.ops4j.pax.logging.DefaultServiceLog.level>
+ <org.ops4j.pax.exam.version>4.13.1</org.ops4j.pax.exam.version>
</properties>
<scm>
<connection>scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-i18n.git</connection>
<developerConnection>scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-i18n.git</developerConnection>
<url>https://gitbox.apache.org/repos/asf?p=sling-org-apache-sling-i18n.git</url>
- <tag>HEAD</tag>
- </scm>
+ <tag>HEAD</tag>
+ </scm>
<build>
<plugins>
<plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Sling-Nodetypes>
- SLING-INF/nodetypes/jcrlanguage.cnd,
- SLING-INF/nodetypes/message.cnd
- </Sling-Nodetypes>
- <!-- embed the commons.osgi bundle as described in http://njbartlett.name/2014/05/26/static-linking.html,
- to make this bundle compatible with older versions of Sling -->
- <Conditional-Package>org.apache.sling.commons.osgi</Conditional-Package>
- <Embed-Dependency>
- jackrabbit-jcr-commons;inline="org/apache/jackrabbit/util/ISO9075.*|org/apache/jackrabbit/util/XMLChar.*|org/apache/jackrabbit/util/Text.*|org/apache/jackrabbit/commons/json/Json*"
- </Embed-Dependency>
- <Require-Capability>
- osgi.implementation;filter:="(&(osgi.implementation=osgi.http)(version>=1.0)(!(version>=2.0)))"
- </Require-Capability>
- </instructions>
- </configuration>
+ <groupId>biz.aQute.bnd</groupId>
+ <artifactId>bnd-maven-plugin</artifactId>
</plugin>
<plugin>
- <groupId>org.apache.rat</groupId>
- <artifactId>apache-rat-plugin</artifactId>
- <configuration>
- <excludes>
- <exclude>derby.log</exclude>
- <exclude>jackrabbit/**</exclude>
- </excludes>
- </configuration>
+ <groupId>biz.aQute.bnd</groupId>
+ <artifactId>bnd-baseline-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -97,26 +69,6 @@
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>reserve-network-port</id>
- <goals>
- <goal>reserve-network-port</goal>
- </goals>
- <phase>pre-integration-test</phase>
- <configuration>
- <portNames>
- <portName>http.port</portName>
- </portNames>
- <minPortNumber>45000</minPortNumber>
- <maxPortNumber>45999</maxPortNumber>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
@@ -128,39 +80,34 @@
</execution>
</executions>
<configuration>
- <systemPropertyVariables>
- <org.ops4j.pax.logging.DefaultServiceLog.level>${org.ops4j.pax.logging.DefaultServiceLog.level}</org.ops4j.pax.logging.DefaultServiceLog.level>
- <pax.exam.log.level>${pax.exam.log.level}</pax.exam.log.level>
- <java.protocol.handler.pkgs>org.ops4j.pax.url</java.protocol.handler.pkgs>
- <bundle.filename>${basedir}/target/${project.build.finalName}.jar</bundle.filename>
- <bundle.build.dir>${basedir}/target</bundle.build.dir>
- <org.osgi.service.http.port>${http.port}</org.osgi.service.http.port>
- </systemPropertyVariables>
+ <redirectTestOutputToFile>true</redirectTestOutputToFile>
+ <systemProperties>
+ <property>
+ <name>bundle.filename</name>
+ <value>${basedir}/target/${project.build.finalName}.jar</value>
+ </property>
+ </systemProperties>
</configuration>
</plugin>
<plugin>
- <artifactId>maven-clean-plugin</artifactId>
- <configuration>
- <filesets>
- <fileset>
- <directory>${basedir}</directory>
- <includes>
- <include>oak/**</include>
- <include>jackrabbit/**</include>
- <include>derby.log</include>
- </includes>
- </fileset>
- </filesets>
- </configuration>
+ <groupId>org.apache.servicemix.tooling</groupId>
+ <artifactId>depends-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
+
<dependencies>
+ <!-- javax -->
<dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>javax.servlet-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
<!-- OSGi -->
<dependency>
<groupId>org.osgi</groupId>
@@ -201,11 +148,6 @@
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>javax.servlet-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>jackrabbit-jcr-commons</artifactId>
<version>2.2.4</version>
@@ -239,6 +181,19 @@
<version>1.2.0</version>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.testing.paxexam</artifactId>
+ <version>3.0.0</version>
+ <scope>test</scope>
+ </dependency>
+ <!-- Apache Felix -->
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.framework</artifactId>
+ <version>6.0.3</version>
+ <scope>test</scope>
+ </dependency>
<!-- Testing -->
<dependency>
<groupId>javax.jcr</groupId>
@@ -289,46 +244,40 @@
<version>1.2.17</version>
<scope>test</scope>
</dependency>
+ <!-- testing -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>org.ops4j.pax.exam</groupId>
<artifactId>pax-exam</artifactId>
- <version>${exam.version}</version>
+ <version>${org.ops4j.pax.exam.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.exam</groupId>
<artifactId>pax-exam-cm</artifactId>
- <version>${exam.version}</version>
+ <version>${org.ops4j.pax.exam.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.exam</groupId>
<artifactId>pax-exam-container-forked</artifactId>
- <version>${exam.version}</version>
+ <version>${org.ops4j.pax.exam.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.exam</groupId>
<artifactId>pax-exam-junit4</artifactId>
- <version>${exam.version}</version>
+ <version>${org.ops4j.pax.exam.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.exam</groupId>
<artifactId>pax-exam-link-mvn</artifactId>
- <version>${exam.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.framework</artifactId>
- <version>5.4.0</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.sling</groupId>
- <artifactId>org.apache.sling.paxexam.util</artifactId>
- <version>1.0.2</version>
+ <version>${org.ops4j.pax.exam.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
diff --git a/src/test/java/org/apache/sling/i18n/it/I18nTestSupport.java b/src/test/java/org/apache/sling/i18n/it/I18nTestSupport.java
new file mode 100644
index 0000000..3b31b89
--- /dev/null
+++ b/src/test/java/org/apache/sling/i18n/it/I18nTestSupport.java
@@ -0,0 +1,62 @@
+/*
+ * 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.apache.sling.i18n.it;
+
+import org.apache.sling.testing.paxexam.TestSupport;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+
+import static org.apache.sling.testing.paxexam.SlingOptions.slingQuickstartOakTar;
+import static org.ops4j.pax.exam.CoreOptions.composite;
+import static org.ops4j.pax.exam.CoreOptions.junitBundles;
+import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.factoryConfiguration;
+import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.newConfiguration;
+
+public abstract class I18nTestSupport extends TestSupport {
+
+ @Configuration
+ public Option[] configuration() {
+ return new Option[]{
+ baseConfiguration(),
+ quickstart(),
+ // Sling I18N
+ testBundle("bundle.filename"),
+ factoryConfiguration("org.apache.sling.jcr.repoinit.RepositoryInitializer")
+ .put("scripts", new String[]{"create service user sling-i18n\n\n set ACL for sling-i18n\n\n allow jcr:read on /\n\n end"})
+ .asOption(),
+ factoryConfiguration("org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended")
+ .put("user.mapping", new String[]{"org.apache.sling.i18n=sling-i18n"})
+ .asOption(),
+ // testing
+ newConfiguration("org.apache.sling.jcr.base.internal.LoginAdminWhitelist")
+ .put("whitelist.bundles.regexp", "PAXEXAM-PROBE-.*")
+ .asOption(),
+ junitBundles()
+ };
+ }
+
+ protected Option quickstart() {
+ final int httpPort = findFreePort();
+ final String workingDirectory = workingDirectory();
+ return composite(
+ slingQuickstartOakTar(workingDirectory, httpPort)
+ );
+ }
+
+}
diff --git a/src/test/java/org/apache/sling/i18n/it/ResourceBundleProviderIT.java b/src/test/java/org/apache/sling/i18n/it/ResourceBundleProviderIT.java
index 4cf2f7d..047d424 100644
--- a/src/test/java/org/apache/sling/i18n/it/ResourceBundleProviderIT.java
+++ b/src/test/java/org/apache/sling/i18n/it/ResourceBundleProviderIT.java
@@ -18,44 +18,31 @@
*/
package org.apache.sling.i18n.it;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+import javax.inject.Inject;
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
import org.apache.sling.i18n.ResourceBundleProvider;
import org.apache.sling.jcr.api.SlingRepository;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Configuration;
-import org.ops4j.pax.exam.CoreOptions;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.cm.ConfigurationAdminOptions;
import org.ops4j.pax.exam.junit.PaxExam;
import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
import org.ops4j.pax.exam.spi.reactors.PerClass;
-import javax.inject.Inject;
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
-import java.io.File;
-import java.net.URISyntaxException;
-import java.util.Locale;
-import java.util.ResourceBundle;
-
-import static org.junit.Assert.*;
-import static org.ops4j.pax.exam.CoreOptions.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
@RunWith(PaxExam.class)
@ExamReactorStrategy(PerClass.class)
-public class ResourceBundleProviderIT {
-
- private static final String BUNDLE_JAR_SYS_PROP = "bundle.filename";
-
- /** The property containing the build directory. */
- private static final String SYS_PROP_BUILD_DIR = "bundle.build.dir";
-
- private static final String DEFAULT_BUILD_DIR = "target";
-
- private static final String PORT_CONFIG = "org.osgi.service.http.port";
+public class ResourceBundleProviderIT extends I18nTestSupport {
public static final int RETRY_TIMEOUT_MSEC = 50000;
public static final String MSG_KEY1 = "foo";
@@ -78,197 +65,22 @@ public class ResourceBundleProviderIT {
private Node enRoot;
private Node enBasenameRoot;
- @Configuration
- public Option[] config() {
- final String buildDir = System.getProperty(SYS_PROP_BUILD_DIR, DEFAULT_BUILD_DIR);
- final String bundleFileName = System.getProperty( BUNDLE_JAR_SYS_PROP );
- final File bundleFile = new File( bundleFileName );
- if ( !bundleFile.canRead() ) {
- throw new IllegalArgumentException( "Cannot read from bundle file " + bundleFileName + " specified in the "
- + BUNDLE_JAR_SYS_PROP + " system property" );
- }
-
- String localRepo = System.getProperty("maven.repo.local", "");
-
- final String jackrabbitVersion = "2.13.1";
- final String oakVersion = "1.5.7";
-
- final String slingHome = new File(buildDir + File.separatorChar + "sling_" + System.currentTimeMillis()).getAbsolutePath();
-
- return options(
- frameworkProperty("sling.home").value(slingHome),
- frameworkProperty("repository.home").value(slingHome + File.separatorChar + "repository"),
- when( localRepo.length() > 0 ).useOptions(
- systemProperty("org.ops4j.pax.url.mvn.localRepository").value(localRepo)
- ),
- when( System.getProperty(PORT_CONFIG) != null ).useOptions(
- systemProperty(PORT_CONFIG).value(System.getProperty(PORT_CONFIG))),
- systemProperty("pax.exam.osgi.unresolved.fail").value("true"),
-
- ConfigurationAdminOptions.newConfiguration("org.apache.felix.jaas.ConfigurationSpi")
- .create(true)
- .put("jaas.defaultRealmName", "jackrabbit.oak")
- .put("jaas.configProviderName", "FelixJaasProvider")
- .asOption(),
- ConfigurationAdminOptions.factoryConfiguration("org.apache.felix.jaas.Configuration.factory")
- .create(true)
- .put("jaas.controlFlag", "optional")
- .put("jaas.classname", "org.apache.jackrabbit.oak.spi.security.authentication.GuestLoginModule")
- .put("jaas.ranking", 300)
- .asOption(),
- ConfigurationAdminOptions.factoryConfiguration("org.apache.felix.jaas.Configuration.factory")
- .create(true)
- .put("jaas.controlFlag", "required")
- .put("jaas.classname", "org.apache.jackrabbit.oak.security.authentication.user.LoginModuleImpl")
- .asOption(),
- ConfigurationAdminOptions.factoryConfiguration("org.apache.felix.jaas.Configuration.factory")
- .create(true)
- .put("jaas.controlFlag", "sufficient")
- .put("jaas.classname", "org.apache.jackrabbit.oak.security.authentication.token.TokenLoginModule")
- .put("jaas.ranking", 200)
- .asOption(),
- ConfigurationAdminOptions.newConfiguration("org.apache.jackrabbit.oak.security.authentication.AuthenticationConfigurationImpl")
- .create(true)
- .put("org.apache.jackrabbit.oak.authentication.configSpiName", "FelixJaasProvider")
- .asOption(),
- ConfigurationAdminOptions.newConfiguration("org.apache.jackrabbit.oak.security.user.UserConfigurationImpl")
- .create(true)
- .put("groupsPath", "/home/groups")
- .put("usersPath", "/home/users")
- .put("defaultPath", "1")
- .put("importBehavior", "besteffort")
- .asOption(),
- ConfigurationAdminOptions.newConfiguration("org.apache.jackrabbit.oak.security.user.RandomAuthorizableNodeName")
- .create(true)
- .put("enabledActions", new String[] {"org.apache.jackrabbit.oak.spi.security.user.action.AccessControlAction"})
- .put("userPrivilegeNames", new String[] {"jcr:all"})
- .put("groupPrivilegeNames", new String[] {"jcr:read"})
- .asOption(),
- ConfigurationAdminOptions.newConfiguration("org.apache.jackrabbit.oak.spi.security.user.action.DefaultAuthorizableActionProvider")
- .create(true)
- .put("length", 21)
- .asOption(),
- ConfigurationAdminOptions.newConfiguration("org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService")
- .create(true)
- .put("name", "Default NodeStore")
- .asOption(),
- ConfigurationAdminOptions.newConfiguration("org.apache.sling.resourceresolver.impl.observation.OsgiObservationBridge")
- .create(true)
- .put("enabled", true)
- .asOption(),
- ConfigurationAdminOptions.factoryConfiguration("org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended")
- .create(true)
- .put("user.mapping", new String[]{"org.apache.sling.i18n=sling-i18n"})
- .asOption(),
- ConfigurationAdminOptions.newConfiguration("org.apache.sling.jcr.repoinit.impl.RepositoryInitializer")
- .put("references", new String[]{references()})
- .asOption(),
-
- // logging
- systemProperty("pax.exam.logging").value("none"),
- mavenBundle("org.apache.sling", "org.apache.sling.commons.log", "4.0.6"),
- mavenBundle("org.apache.sling", "org.apache.sling.commons.logservice", "1.0.6"),
- mavenBundle("org.slf4j", "slf4j-api", "1.7.13"),
- mavenBundle("org.slf4j", "jcl-over-slf4j", "1.7.13"),
- mavenBundle("org.slf4j", "log4j-over-slf4j", "1.7.13"),
-
- mavenBundle("commons-io", "commons-io", "2.4"),
- mavenBundle("commons-fileupload", "commons-fileupload", "1.3.1"),
- mavenBundle("commons-collections", "commons-collections", "3.2.2"),
- mavenBundle("commons-codec", "commons-codec", "1.10"),
- mavenBundle("commons-lang", "commons-lang", "2.6"),
- mavenBundle("org.apache.commons", "commons-lang3", "3.5"),
- mavenBundle("commons-pool", "commons-pool", "1.6"),
-
- mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.concurrent", "1.3.4_1"),
-
- mavenBundle("org.apache.geronimo.bundles", "commons-httpclient", "3.1_1"),
- mavenBundle("org.apache.tika", "tika-core", "1.9"),
- mavenBundle("org.apache.tika", "tika-bundle", "1.9"),
-
- // infrastructure
- mavenBundle("org.apache.felix", "org.apache.felix.http.servlet-api", "1.1.2"),
- mavenBundle("org.apache.felix", "org.apache.felix.http.jetty", "3.1.6"),
- mavenBundle("org.apache.felix", "org.apache.felix.eventadmin", "1.4.4"),
- mavenBundle("org.apache.felix", "org.apache.felix.scr", "2.0.4"),
- mavenBundle("org.apache.felix", "org.apache.felix.configadmin", "1.8.10"),
- mavenBundle("org.apache.felix", "org.apache.felix.inventory", "1.0.4"),
- mavenBundle("org.apache.felix", "org.apache.felix.metatype", "1.1.2"),
-
- // sling
- mavenBundle("org.apache.sling", "org.apache.sling.settings", "1.3.8"),
- mavenBundle("org.apache.sling", "org.apache.sling.commons.osgi", "2.3.0"),
- mavenBundle("org.apache.sling", "org.apache.sling.commons.mime", "2.1.8"),
- mavenBundle("org.apache.sling", "org.apache.sling.commons.classloader", "1.3.2"),
- mavenBundle("org.apache.sling", "org.apache.sling.commons.scheduler", "2.4.14"),
- mavenBundle("org.apache.sling", "org.apache.sling.commons.threads", "3.2.4"),
-
- mavenBundle("org.apache.sling", "org.apache.sling.auth.core", "1.3.12"),
- mavenBundle("org.apache.sling", "org.apache.sling.discovery.api", "1.0.2"),
- mavenBundle("org.apache.sling", "org.apache.sling.discovery.commons", "1.0.20"),
- mavenBundle("org.apache.sling", "org.apache.sling.discovery.standalone", "1.0.2"),
-
- mavenBundle("org.apache.sling", "org.apache.sling.api", "2.14.2"),
- mavenBundle("org.apache.sling", "org.apache.sling.resourceresolver", "1.4.18"),
- mavenBundle("org.apache.sling", "org.apache.sling.adapter", "2.1.10"),
- mavenBundle("org.apache.sling", "org.apache.sling.jcr.resource", "2.8.0"),
- mavenBundle("org.apache.sling", "org.apache.sling.jcr.classloader", "3.2.2"),
- mavenBundle("org.apache.sling", "org.apache.sling.jcr.contentloader", "2.2.4"),
- mavenBundle("org.apache.sling", "org.apache.sling.engine", "2.6.2"),
- mavenBundle("org.apache.sling", "org.apache.sling.serviceusermapper", "1.3.2"),
-
- mavenBundle("org.apache.sling", "org.apache.sling.jcr.jcr-wrapper", "2.0.0"),
- mavenBundle("org.apache.sling", "org.apache.sling.jcr.api", "2.4.0"),
- mavenBundle("org.apache.sling", "org.apache.sling.jcr.base", "2.4.0"),
- mavenBundle("org.apache.sling", "org.apache.sling.jcr.repoinit", "1.1.0"),
- mavenBundle("org.apache.sling", "org.apache.sling.repoinit.parser", "1.1.0"),
- mavenBundle("org.apache.sling", "org.apache.sling.provisioning.model", "1.4.2"),
-
- mavenBundle("com.google.guava", "guava", "15.0"),
- mavenBundle("org.apache.jackrabbit", "jackrabbit-api", jackrabbitVersion),
- mavenBundle("org.apache.jackrabbit", "jackrabbit-jcr-commons", jackrabbitVersion),
- mavenBundle("org.apache.jackrabbit", "jackrabbit-spi", jackrabbitVersion),
- mavenBundle("org.apache.jackrabbit", "jackrabbit-spi-commons", jackrabbitVersion),
- mavenBundle("org.apache.jackrabbit", "jackrabbit-jcr-rmi", jackrabbitVersion),
-
- mavenBundle("org.apache.felix", "org.apache.felix.jaas", "0.0.4"),
-
- mavenBundle("org.apache.jackrabbit", "oak-core", oakVersion),
- mavenBundle("org.apache.jackrabbit", "oak-commons", oakVersion),
- mavenBundle("org.apache.jackrabbit", "oak-lucene", oakVersion),
- mavenBundle("org.apache.jackrabbit", "oak-blob", oakVersion),
- mavenBundle("org.apache.jackrabbit", "oak-jcr", oakVersion),
-
- mavenBundle("org.apache.jackrabbit", "oak-segment", oakVersion),
-
- mavenBundle("org.apache.sling", "org.apache.sling.jcr.oak.server", "1.1.0"),
-
- mavenBundle("org.apache.sling", "org.apache.sling.testing.tools", "1.0.16"),
- mavenBundle("org.apache.sling", "org.apache.sling.commons.johnzon", "1.0.0"),
- mavenBundle("org.apache.httpcomponents", "httpcore-osgi", "4.1.2"),
- mavenBundle("org.apache.httpcomponents", "httpclient-osgi", "4.1.2"),
-
- junitBundles(),
-
- CoreOptions.bundle( bundleFile.toURI().toString() )
- );
- }
static abstract class Retry {
Retry(int timeoutMsec) {
final long timeout = System.currentTimeMillis() + timeoutMsec;
Throwable lastT = null;
- while(System.currentTimeMillis() < timeout) {
+ while (System.currentTimeMillis() < timeout) {
try {
lastT = null;
exec();
break;
- } catch(Throwable t) {
+ } catch (Throwable t) {
lastT = t;
}
}
- if(lastT != null) {
+ if (lastT != null) {
fail("Failed after " + timeoutMsec + " msec: " + lastT);
}
}
@@ -281,17 +93,17 @@ public class ResourceBundleProviderIT {
session = repository.loginAdministrative(null);
final Node root = session.getRootNode();
final Node libs;
- if(root.hasNode("libs")) {
- libs = root.getNode("libs");
+ if (root.hasNode("libs")) {
+ libs = root.getNode("libs");
} else {
- libs = root.addNode("libs", "nt:unstructured");
+ libs = root.addNode("libs", "nt:unstructured");
}
i18nRoot = libs.addNode("i18n", "nt:unstructured");
deRoot = addLanguageNode(i18nRoot, "de");
frRoot = addLanguageNode(i18nRoot, "fr");
deDeRoot = addLanguageNode(i18nRoot, "de_DE");
enRoot = addLanguageNode(i18nRoot, "en");
- enBasenameRoot = addLanguageNodeWithBasename(i18nRoot, "en",BASENAME);
+ enBasenameRoot = addLanguageNodeWithBasename(i18nRoot, "en", BASENAME);
session.save();
}
@@ -313,7 +125,7 @@ public class ResourceBundleProviderIT {
final Node child = parent.addNode(language + "-" + basename, "sling:Folder");
child.addMixin("mix:language");
child.setProperty("jcr:language", language);
- if(basename != null) {
+ if (basename != null) {
child.setProperty("sling:basename", basename);
}
return child;
@@ -341,7 +153,7 @@ public class ResourceBundleProviderIT {
private void setMessage(final Node rootNode, final String key, final String message) throws RepositoryException {
final String nodeName = "node_" + key;
final Node node;
- if ( rootNode.hasNode(nodeName) ) {
+ if (rootNode.hasNode(nodeName)) {
node = rootNode.getNode(nodeName);
} else {
node = rootNode.addNode(nodeName, "sling:MessageEntry");
@@ -405,12 +217,4 @@ public class ResourceBundleProviderIT {
assertMessage(MSG_KEY3, Locale.ENGLISH, BASENAME, "EN_basename_changed");
}
- private String references() {
- try {
- String repoInitUrl = getClass().getResource("/repoinit.txt").toURI().toString();
- return String.format("raw:%s", repoInitUrl);
- } catch (URISyntaxException e) {
- throw new RuntimeException("Failed to compute repoinit references", e);
- }
- }
}
diff --git a/src/test/resources/repoinit.txt b/src/test/resources/repoinit.txt
deleted file mode 100644
index 57b44f8..0000000
--- a/src/test/resources/repoinit.txt
+++ /dev/null
@@ -1,23 +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.
-#
-################################################################################
-
-# sling-i18n
-
-create service user sling-i18n
-