diff --git a/src/main/java/org/olat/core/commons/services/help/ConfluenceHelper.java b/src/main/java/org/olat/core/commons/services/help/ConfluenceHelper.java index 015e22a22ba8992ff39f3956cb47187b5c6dc159..93bfc07b30335d1375e28e1723e6553e23ee81f6 100644 --- a/src/main/java/org/olat/core/commons/services/help/ConfluenceHelper.java +++ b/src/main/java/org/olat/core/commons/services/help/ConfluenceHelper.java @@ -118,7 +118,7 @@ public class ConfluenceHelper { * @param locale * @return */ - private static final String generateSpace(String version, Locale locale) { + protected static final String generateSpace(String version, Locale locale) { StringBuilder sb = new StringBuilder(); sb.append("/OO"); diff --git a/src/test/java/org/olat/core/commons/services/help/ConfluenceHelperTest.java b/src/test/java/org/olat/core/commons/services/help/ConfluenceHelperTest.java new file mode 100644 index 0000000000000000000000000000000000000000..cd53e477603c290fb9e323fa4332405e8b31c53b --- /dev/null +++ b/src/test/java/org/olat/core/commons/services/help/ConfluenceHelperTest.java @@ -0,0 +1,53 @@ +/** + * <a href="http://www.openolat.org"> + * OpenOLAT - Online Learning and Training</a><br> + * <p> + * Licensed under the Apache License, Version 2.0 (the "License"); <br> + * you may not use this file except in compliance with the License.<br> + * You may obtain a copy of the License at the + * <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a> + * <p> + * Unless required by applicable law or agreed to in writing,<br> + * software distributed under the License is distributed on an "AS IS" BASIS, <br> + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br> + * See the License for the specific language governing permissions and <br> + * limitations under the License. + * <p> + * Initial code contributed and copyrighted by<br> + * frentix GmbH, http://www.frentix.com + * <p> + */ +package org.olat.core.commons.services.help; + +import java.util.Locale; + +import org.junit.Assert; +import org.junit.Test; + +/** + * + * Initial date: 07.01.2015<br> + * @author srosse, stephane.rosse@frentix.com, http://www.frentix.com + * + */ +public class ConfluenceHelperTest { + + @Test + public void getURL_confluence() { + String url1 = ConfluenceHelper.generateSpace("10.1.1", Locale.GERMAN); + Assert.assertNotNull(url1); + Assert.assertTrue(url1.startsWith("/OO101DE/")); + + String url2 = ConfluenceHelper.generateSpace("10.1", Locale.ENGLISH); + Assert.assertNotNull(url2); + Assert.assertTrue(url2.startsWith("/OO101EN/")); + + String url3 = ConfluenceHelper.generateSpace("10.1a", Locale.ENGLISH); + Assert.assertNotNull(url3); + Assert.assertTrue(url3.startsWith("/OO101EN/")); + + String url4 = ConfluenceHelper.generateSpace("11a", Locale.ENGLISH); + Assert.assertNotNull(url4); + Assert.assertTrue(url4.startsWith("/OO110EN/")); + } +} diff --git a/src/test/java/org/olat/core/commons/services/help/spi/ConfluenceLinkSPITest.java b/src/test/java/org/olat/core/commons/services/help/spi/ConfluenceLinkSPITest.java index 06214d3a6198aa46ef52c27875b8ff05354b3826..18789827fdc3b1c9a427d7492762a6e5d2eed982 100644 --- a/src/test/java/org/olat/core/commons/services/help/spi/ConfluenceLinkSPITest.java +++ b/src/test/java/org/olat/core/commons/services/help/spi/ConfluenceLinkSPITest.java @@ -38,28 +38,6 @@ public class ConfluenceLinkSPITest { private static final OLog log = Tracing.createLoggerFor(ConfluenceLinkSPITest.class); - /* - @Test - public void getURL_confluence() { - ConfluenceLinkSPI linkSPI = new ConfluenceLinkSPI(); - - String url1 = ConfluenceHelper.generateSpace("10.1.1", Locale.GERMAN); - Assert.assertNotNull(url1); - Assert.assertTrue(url1.startsWith("/OO101DE/")); - - String url2 = ConfluenceHelper.generateSpace("10.1", Locale.ENGLISH); - Assert.assertNotNull(url2); - Assert.assertTrue(url2.startsWith("/OO101EN/")); - - String url3 = ConfluenceHelper.generateSpace("10.1a", Locale.ENGLISH); - Assert.assertNotNull(url3); - Assert.assertTrue(url3.startsWith("/OO101EN/")); - - String url4 = ConfluenceHelper.generateSpace("11a", Locale.ENGLISH); - Assert.assertNotNull(url4); - Assert.assertTrue(url4.startsWith("/OO110EN/")); - }*/ - @Test public void getUrl() { // init settings to set version, required by ConfluenceLinkSPI diff --git a/src/test/java/org/olat/test/AllTestsJunit4.java b/src/test/java/org/olat/test/AllTestsJunit4.java index 4d10071147cfec8566761ed8af8421e967192db8..dec99017c5a2453e32b5a5475d2c4005b95bd6a6 100644 --- a/src/test/java/org/olat/test/AllTestsJunit4.java +++ b/src/test/java/org/olat/test/AllTestsJunit4.java @@ -85,6 +85,7 @@ import org.junit.runners.Suite; org.olat.commons.coordinate.cluster.jms.JMSTest.class, org.olat.commons.coordinate.cluster.lock.LockTest.class, org.olat.commons.coordinate.CoordinatorTest.class, + org.olat.core.commons.services.help.ConfluenceHelperTest.class, org.olat.core.commons.services.help.spi.ConfluenceLinkSPITest.class, org.olat.core.commons.services.webdav.WebDAVCommandsTest.class, org.olat.core.commons.services.webdav.manager.DigestAuthenticationTest.class,