aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-base
diff options
context:
space:
mode:
authorEric Barboni <skygo@apache.org>2020-02-11 20:37:01 +0100
committerEric Barboni <skygo@apache.org>2020-02-11 20:37:01 +0100
commitc3003b149d7dc85e976719f72b45cd737ff20c22 (patch)
tree02487178278a97611d007d3e02b67559ba404608 /archiva-modules/archiva-base
parentf6f495d494ac2607ae1f850920673c4f64b241cf (diff)
downloadarchiva-c3003b149d7dc85e976719f72b45cd737ff20c22.tar.gz
archiva-c3003b149d7dc85e976719f72b45cd737ff20c22.zip
Test for windows, import fix
Diffstat (limited to 'archiva-modules/archiva-base')
-rw-r--r--archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/utils/PathUtil.java2
-rw-r--r--archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/event/EventHandler.java1
-rw-r--r--archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/event/EventManager.java4
-rw-r--r--archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/event/EventType.java2
-rw-r--r--archiva-modules/archiva-base/archiva-common/src/test/java/org/apache/archiva/common/utils/PathUtilTest.java8
5 files changed, 8 insertions, 9 deletions
diff --git a/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/utils/PathUtil.java b/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/utils/PathUtil.java
index 8c9a437a4..b8d14bb83 100644
--- a/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/utils/PathUtil.java
+++ b/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/utils/PathUtil.java
@@ -26,8 +26,6 @@ import java.net.URI;
import java.nio.file.FileSystems;
import java.nio.file.Path;
import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.List;
import java.util.StringTokenizer;
import java.util.Vector;
import java.util.stream.StreamSupport;
diff --git a/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/event/EventHandler.java b/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/event/EventHandler.java
index 5217f1152..f98adcdab 100644
--- a/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/event/EventHandler.java
+++ b/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/event/EventHandler.java
@@ -19,7 +19,6 @@ package org.apache.archiva.event;
* under the License.
*/
-import org.apache.archiva.event.Event;
import java.util.EventListener;
diff --git a/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/event/EventManager.java b/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/event/EventManager.java
index 189f9500e..00a240066 100644
--- a/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/event/EventManager.java
+++ b/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/event/EventManager.java
@@ -28,7 +28,7 @@ import java.util.concurrent.ConcurrentHashMap;
public class EventManager implements EventSource
{
- private static final Logger log = LoggerFactory.getLogger(EventManager.class);
+ private static final Logger LOG = LoggerFactory.getLogger(EventManager.class);
private final ConcurrentHashMap<EventType<? extends Event>, Set<EventHandler>> handlerMap = new ConcurrentHashMap<>();
@@ -71,7 +71,7 @@ public class EventManager implements EventSource
handler.handle(event);
} catch (Exception e) {
// We catch all errors from handlers
- log.error("An error occured during event handling: {}", e.getMessage(), e);
+ LOG.error("An error occured during event handling: {}", e.getMessage(), e);
}
}
}
diff --git a/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/event/EventType.java b/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/event/EventType.java
index 58a921382..50d42679e 100644
--- a/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/event/EventType.java
+++ b/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/event/EventType.java
@@ -119,7 +119,7 @@ public class EventType<T extends Event> implements Serializable {
private Object writeReplace() throws ObjectStreamException {
- Deque<String> path = new LinkedList<String>();
+ Deque<String> path = new LinkedList<>();
EventType<?> t = this;
while (t != ROOT) {
path.addFirst(t.name);
diff --git a/archiva-modules/archiva-base/archiva-common/src/test/java/org/apache/archiva/common/utils/PathUtilTest.java b/archiva-modules/archiva-base/archiva-common/src/test/java/org/apache/archiva/common/utils/PathUtilTest.java
index dfd5b9014..af2c42389 100644
--- a/archiva-modules/archiva-base/archiva-common/src/test/java/org/apache/archiva/common/utils/PathUtilTest.java
+++ b/archiva-modules/archiva-base/archiva-common/src/test/java/org/apache/archiva/common/utils/PathUtilTest.java
@@ -24,6 +24,7 @@ import org.apache.commons.lang3.StringUtils;
import java.nio.file.Path;
import java.nio.file.Paths;
+import org.apache.commons.io.FilenameUtils;
/**
* PathUtilTest
@@ -33,15 +34,16 @@ import java.nio.file.Paths;
public class PathUtilTest
extends TestCase
{
+
public void testToRelativeWithoutSlash()
{
- assertEquals( "path/to/resource.xml", PathUtil.getRelative( "/home/user/foo/repository",
+ assertEquals( FilenameUtils.separatorsToSystem( "path/to/resource.xml" ), PathUtil.getRelative( "/home/user/foo/repository",
"/home/user/foo/repository/path/to/resource.xml" ) );
}
public void testToRelativeWithSlash()
{
- assertEquals( "path/to/resource.xml", PathUtil.getRelative( "/home/user/foo/repository/",
+ assertEquals( FilenameUtils.separatorsToSystem( "path/to/resource.xml" ), PathUtil.getRelative( "/home/user/foo/repository/",
"/home/user/foo/repository/path/to/resource.xml" ) );
}
@@ -87,7 +89,7 @@ public class PathUtilTest
String path = "path/to/resource.xml";
String expectedPath = "file:" + workingDirname + "/" + path;
-
+
assertEquals( expectedPath, PathUtil.toUrl( expectedPath ) );
}
}