<groupId>org.eclipse.sisu</groupId>
<artifactId>org.eclipse.sisu.plexus</artifactId>
</dependency>
+
+
+ <dependency>
+ <groupId>org.junit.platform</groupId>
+ <artifactId>junit-platform-launcher</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.platform</groupId>
+ <artifactId>junit-platform-console-standalone</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-engine</artifactId>
+ <scope>test</scope>
+ </dependency>
+
</dependencies>
<build>
<pluginManagement>
-package org.apache.archiva.repository.events;
+package org.apache.archiva.event;
/*
* Licensed to the Apache Software Foundation (ASF) under one
-package org.apache.archiva.repository.events;
+package org.apache.archiva.event;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* under the License.
*/
+import org.apache.archiva.event.Event;
+
import java.util.EventListener;
/**
-package org.apache.archiva.repository.events;
+package org.apache.archiva.event;
/*
* Licensed to the Apache Software Foundation (ASF) under one
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
-public class EventManager implements EventSource {
+public class EventManager implements EventSource
+{
private static final Logger log = LoggerFactory.getLogger(EventManager.class);
-package org.apache.archiva.repository.events;
+package org.apache.archiva.event;
/*
* Licensed to the Apache Software Foundation (ASF) under one
*/
public interface EventSource {
- <T extends Event> void registerEventHandler(EventType<T> type, EventHandler<? super T> eventHandler);
+ <T extends Event> void registerEventHandler( EventType<T> type, EventHandler<? super T> eventHandler);
<T extends Event> void unregisterEventHandler(EventType<T> type, EventHandler<? super T> eventHandler);
-package org.apache.archiva.repository.events;
+package org.apache.archiva.event;
/*
* Licensed to the Apache Software Foundation (ASF) under one
--- /dev/null
+package org.apache.archiva.event;
+
+/*
+ * 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.
+ */
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * @author Martin Stockhammer <martin_s@apache.org>
+ */
+public class EventManagerTest
+{
+
+ @Test
+ public void registerEventHandler( )
+ {
+ }
+
+ @Test
+ public void unregisterEventHandler( )
+ {
+ }
+
+ @Test
+ public void fireEvent( )
+ {
+ }
+}
\ No newline at end of file
import org.apache.archiva.repository.RepositoryException;
import org.apache.archiva.repository.RepositoryProvider;
import org.apache.archiva.repository.RepositoryType;
-import org.apache.archiva.repository.events.Event;
+import org.apache.archiva.event.Event;
import org.apache.archiva.repository.features.ArtifactCleanupFeature;
import org.apache.archiva.repository.features.IndexCreationFeature;
import org.apache.archiva.repository.features.RemoteIndexFeature;
import org.apache.archiva.model.ArtifactReference;
import org.apache.archiva.repository.ContentNotFoundException;
import org.apache.archiva.repository.ManagedRepositoryContent;
-import org.apache.archiva.repository.events.RepositoryListener;
+import org.apache.archiva.repository.event.RepositoryListener;
import org.apache.archiva.repository.storage.StorageAsset;
import org.apache.archiva.repository.storage.StorageUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.archiva.repository.ReleaseScheme;
import org.apache.archiva.repository.RepositoryException;
import org.apache.archiva.repository.RepositoryRegistry;
-import org.apache.archiva.repository.events.RepositoryListener;
+import org.apache.archiva.repository.event.RepositoryListener;
import org.apache.archiva.repository.metadata.MetadataTools;
import org.apache.archiva.repository.metadata.RepositoryMetadataException;
import org.apache.archiva.repository.ContentNotFoundException;
import org.apache.archiva.repository.LayoutException;
import org.apache.archiva.repository.ManagedRepositoryContent;
-import org.apache.archiva.repository.events.RepositoryListener;
+import org.apache.archiva.repository.event.RepositoryListener;
import org.apache.archiva.repository.storage.StorageAsset;
-import org.apache.commons.lang3.time.DateUtils;
-import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import org.apache.archiva.repository.ManagedRepositoryContent;
import org.apache.archiva.repository.RepositoryContentFactory;
import org.apache.archiva.repository.RepositoryRegistry;
-import org.apache.archiva.repository.events.RepositoryListener;
+import org.apache.archiva.repository.event.RepositoryListener;
import org.apache.archiva.repository.features.ArtifactCleanupFeature;
import org.apache.archiva.repository.metadata.MetadataTools;
import org.springframework.beans.factory.annotation.Autowired;
import org.apache.archiva.repository.ContentNotFoundException;
import org.apache.archiva.repository.LayoutException;
import org.apache.archiva.repository.ManagedRepositoryContent;
-import org.apache.archiva.repository.events.RepositoryListener;
+import org.apache.archiva.repository.event.RepositoryListener;
import java.nio.file.Files;
import java.nio.file.Path;
import org.apache.archiva.repository.ManagedRepositoryContent;
import org.apache.archiva.repository.ReleaseScheme;
import org.apache.archiva.repository.RepositoryContentProvider;
-import org.apache.archiva.repository.events.RepositoryListener;
+import org.apache.archiva.repository.event.RepositoryListener;
import org.apache.archiva.repository.features.ArtifactCleanupFeature;
import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
import org.apache.commons.io.FileUtils;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
/**
*/
import org.apache.archiva.repository.ManagedRepository;
import org.apache.archiva.repository.RepositoryContentFactory;
import org.apache.archiva.repository.RepositoryRegistry;
-import org.apache.archiva.repository.events.RepositoryListener;
+import org.apache.archiva.repository.event.RepositoryListener;
import org.apache.archiva.repository.metadata.MetadataTools;
import org.custommonkey.xmlunit.XMLAssert;
import org.easymock.EasyMock;
*/
import org.apache.archiva.metadata.model.ArtifactMetadata;
-import org.apache.archiva.repository.events.RepositoryListener;
+import org.apache.archiva.repository.event.RepositoryListener;
import org.apache.archiva.repository.features.ArtifactCleanupFeature;
-import org.apache.commons.lang3.time.DateUtils;
import org.easymock.EasyMock;
import org.junit.After;
import org.junit.Test;
*/
import org.apache.archiva.metadata.model.ArtifactMetadata;
-import org.apache.archiva.repository.events.RepositoryListener;
+import org.apache.archiva.repository.event.RepositoryListener;
import org.apache.archiva.repository.features.ArtifactCleanupFeature;
import org.easymock.EasyMock;
import org.junit.After;
import org.apache.archiva.repository.ReleaseScheme;
import org.apache.archiva.repository.RemoteRepository;
import org.apache.archiva.repository.RepositoryCredentials;
-import org.apache.archiva.repository.events.Event;
-import org.apache.archiva.repository.events.RepositoryValueEvent;
+import org.apache.archiva.event.Event;
import org.apache.archiva.repository.RepositoryException;
import org.apache.archiva.repository.RepositoryGroup;
import org.apache.archiva.repository.RepositoryProvider;
import org.apache.archiva.repository.RemoteRepository;
import org.apache.archiva.repository.RepositoryRegistry;
import org.apache.archiva.repository.RepositoryType;
-import org.apache.archiva.repository.events.EventHandler;
-import org.apache.archiva.repository.events.RepositoryRegistryEvent;
+import org.apache.archiva.event.EventHandler;
+import org.apache.archiva.repository.event.RepositoryRegistryEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
*/
import org.apache.archiva.indexer.ArchivaIndexingContext;
-import org.apache.archiva.repository.events.EventSource;
+import org.apache.archiva.event.EventSource;
import org.apache.archiva.repository.storage.RepositoryStorage;
import org.apache.archiva.repository.features.RepositoryFeature;
import org.apache.archiva.repository.storage.StorageAsset;
import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
import org.apache.archiva.configuration.RepositoryGroupConfiguration;
-import org.apache.archiva.repository.events.EventHandler;
+import org.apache.archiva.event.EventHandler;
import java.io.IOException;
import java.util.Set;
-package org.apache.archiva.repository.events;
+package org.apache.archiva.repository.event;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* under the License.
*/
+import org.apache.archiva.event.EventType;
import org.apache.archiva.repository.Repository;
/**
-package org.apache.archiva.repository.events;
+package org.apache.archiva.repository.event;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* under the License.
*/
+import org.apache.archiva.event.Event;
+import org.apache.archiva.event.EventType;
import org.apache.archiva.repository.Repository;
/**
* A repository event is specific to a repository and holds a reference to the repository that
* is related to this event.
*/
-public class RepositoryEvent extends Event {
+public class RepositoryEvent extends Event
+{
private static final long serialVersionUID = 4676673476606414834L;
-package org.apache.archiva.repository.events;
+package org.apache.archiva.repository.event;
/*
* Licensed to the Apache Software Foundation (ASF) under one
*/
+import org.apache.archiva.event.EventType;
import org.apache.archiva.repository.Repository;
import java.net.URI;
-package org.apache.archiva.repository.events;
+package org.apache.archiva.repository.event;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* under the License.
*/
+import org.apache.archiva.event.Event;
+import org.apache.archiva.event.EventType;
+
/**
* Repository registry events are raised by the repository registry itself.
*/
-public class RepositoryRegistryEvent extends Event {
+public class RepositoryRegistryEvent extends Event
+{
private static final long serialVersionUID = -4740127827269612094L;
-package org.apache.archiva.repository.events;
+package org.apache.archiva.repository.event;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* under the License.
*/
+import org.apache.archiva.event.EventType;
import org.apache.archiva.repository.Repository;
/**
* under the License.
*/
-import org.apache.archiva.repository.events.Event;
-import org.apache.archiva.repository.events.EventHandler;
+import org.apache.archiva.event.Event;
+import org.apache.archiva.event.EventHandler;
import java.util.ArrayList;
import java.util.Collection;
import org.apache.archiva.repository.Repository;
-import org.apache.archiva.repository.events.RepositoryIndexEvent;
-import org.apache.archiva.repository.events.EventHandler;
+import org.apache.archiva.repository.event.RepositoryIndexEvent;
+import org.apache.archiva.event.EventHandler;
import org.apache.archiva.repository.storage.StorageAsset;
import org.apache.commons.lang3.StringUtils;
import com.cronutils.model.definition.CronDefinition;
import com.cronutils.model.definition.CronDefinitionBuilder;
import com.cronutils.parser.CronParser;
+import org.apache.archiva.event.Event;
+import org.apache.archiva.event.EventHandler;
+import org.apache.archiva.event.EventManager;
+import org.apache.archiva.event.EventType;
import org.apache.archiva.indexer.ArchivaIndexingContext;
-import org.apache.archiva.repository.events.*;
+import org.apache.archiva.repository.event.*;
import org.apache.archiva.repository.storage.RepositoryStorage;
import org.apache.archiva.repository.storage.StorageAsset;
import org.apache.archiva.repository.features.RepositoryFeature;
import java.nio.channels.ReadableByteChannel;
import java.nio.channels.WritableByteChannel;
import java.nio.file.CopyOption;
-import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
}
@Override
- public <T extends Event> void registerEventHandler(EventType<T> eventType, EventHandler<? super T> eventHandler) {
+ public <T extends Event> void registerEventHandler( EventType<T> eventType, EventHandler<? super T> eventHandler) {
if (!EventType.isInstanceOf(eventType, RepositoryEvent.ANY)) {
throw new IllegalArgumentException("Can only register RepositoryEvent Handlers");
}
*/
import org.apache.archiva.configuration.*;
+import org.apache.archiva.event.Event;
+import org.apache.archiva.event.EventManager;
+import org.apache.archiva.event.EventSource;
+import org.apache.archiva.event.EventType;
import org.apache.archiva.indexer.*;
import org.apache.archiva.redback.components.registry.RegistryException;
-import org.apache.archiva.repository.events.*;
-import org.apache.archiva.repository.events.EventHandler;
+import org.apache.archiva.repository.event.*;
+import org.apache.archiva.event.EventHandler;
import org.apache.archiva.repository.features.IndexCreationFeature;
import org.apache.archiva.repository.features.StagingRepositoryFeature;
import org.apache.commons.lang3.StringUtils;
@Override
- public <T extends Event> void registerEventHandler(EventType<T> type, EventHandler<? super T> eventHandler) {
+ public <T extends Event> void registerEventHandler( EventType<T> type, EventHandler<? super T> eventHandler) {
eventManager.registerEventHandler(type, eventHandler);
}
import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
import org.apache.archiva.configuration.RepositoryGroupConfiguration;
import org.apache.archiva.repository.*;
-import org.apache.archiva.repository.events.Event;
-import org.apache.archiva.repository.events.RepositoryValueEvent;
+import org.apache.archiva.event.Event;
import org.apache.archiva.repository.features.ArtifactCleanupFeature;
import org.apache.archiva.repository.features.IndexCreationFeature;
import org.apache.archiva.repository.features.RemoteIndexFeature;
import org.apache.archiva.repository.ReleaseScheme;
import org.apache.archiva.repository.RemoteRepository;
import org.apache.archiva.repository.RepositoryCredentials;
-import org.apache.archiva.repository.events.Event;
-import org.apache.archiva.repository.events.RepositoryValueEvent;
+import org.apache.archiva.event.Event;
import org.apache.archiva.repository.RepositoryException;
import org.apache.archiva.repository.RepositoryGroup;
import org.apache.archiva.repository.RepositoryProvider;
import org.apache.archiva.common.filelock.FileLockManager;
import org.apache.archiva.configuration.*;
import org.apache.archiva.repository.*;
-import org.apache.archiva.repository.events.Event;
+import org.apache.archiva.event.Event;
import org.apache.archiva.repository.features.ArtifactCleanupFeature;
import org.apache.archiva.repository.features.IndexCreationFeature;
import org.apache.archiva.repository.features.RemoteIndexFeature;
import org.apache.archiva.repository.storage.RepositoryStorage;
import org.apache.archiva.repository.storage.StorageAsset;
import org.apache.archiva.repository.storage.StorageUtil;
-import org.apache.archiva.repository.events.RepositoryListener;
+import org.apache.archiva.repository.event.RepositoryListener;
import org.apache.archiva.repository.metadata.MetadataTools;
import org.apache.archiva.repository.metadata.RepositoryMetadataException;
import org.apache.archiva.repository.metadata.RepositoryMetadataWriter;
import org.apache.archiva.redback.components.taskqueue.TaskQueueException;
import org.apache.archiva.repository.ManagedRepository;
import org.apache.archiva.repository.ManagedRepositoryContent;
-import org.apache.archiva.repository.events.RepositoryListener;
+import org.apache.archiva.repository.event.RepositoryListener;
import org.apache.archiva.scheduler.repository.model.RepositoryArchivaTaskScheduler;
import org.apache.archiva.scheduler.repository.model.RepositoryTask;
import org.apache.archiva.xml.XMLException;
import org.apache.archiva.metadata.repository.storage.RepositoryStorageMetadataNotFoundException;
import org.apache.archiva.metadata.repository.storage.RepositoryStorageRuntimeException;
import org.apache.archiva.redback.components.cache.Cache;
-import org.apache.archiva.repository.events.RepositoryListener;
+import org.apache.archiva.repository.event.RepositoryListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
-package org.apache.archiva.repository.events;
+package org.apache.archiva.repository.event;
/*
* Licensed to the Apache Software Foundation (ASF) under one
import org.apache.archiva.policies.ProxyDownloadException;
import org.apache.archiva.repository.ManagedRepository;
import org.apache.archiva.repository.ManagedRepositoryContent;
-import org.apache.archiva.repository.events.RepositoryListener;
+import org.apache.archiva.repository.event.RepositoryListener;
import org.apache.archiva.xml.XMLException;
import java.io.IOException;
import org.apache.archiva.metadata.repository.RepositorySession;
import org.apache.archiva.metadata.repository.RepositorySessionFactory;
import org.apache.archiva.metadata.repository.storage.RepositoryStorageMetadataException;
-import org.apache.archiva.repository.events.RepositoryListener;
+import org.apache.archiva.repository.event.RepositoryListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;