aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-web/archiva-webdav/src/test
diff options
context:
space:
mode:
authorMartin Stockhammer <martin_s@apache.org>2019-06-22 19:31:49 +0200
committerMartin Stockhammer <martin_s@apache.org>2019-06-22 19:31:49 +0200
commit380c152114e6e8648558bb9f24ac529dc2d7d811 (patch)
treeee335c7b8390cf110c96db65966ba8fdf722f350 /archiva-modules/archiva-web/archiva-webdav/src/test
parent240292077ed8c622d3e3dbe43d01f738c6293bfc (diff)
downloadarchiva-380c152114e6e8648558bb9f24ac529dc2d7d811.tar.gz
archiva-380c152114e6e8648558bb9f24ac529dc2d7d811.zip
Using storageAsset for Index API
Diffstat (limited to 'archiva-modules/archiva-web/archiva-webdav/src/test')
-rw-r--r--archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/ArchivaDavResourceFactoryTest.java2
-rw-r--r--archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/DavResourceTest.java22
-rw-r--r--archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/UnauthenticatedDavResourceFactory.java2
3 files changed, 18 insertions, 8 deletions
diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/ArchivaDavResourceFactoryTest.java b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/ArchivaDavResourceFactoryTest.java
index e153a545f..8c7cf4a65 100644
--- a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/ArchivaDavResourceFactoryTest.java
+++ b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/ArchivaDavResourceFactoryTest.java
@@ -718,7 +718,7 @@ public class ArchivaDavResourceFactoryTest
ArchivaConfiguration archivaConfiguration )
throws PlexusSisuBridgeException
{
- super( applicationContext, plexusSisuBridge, archivaConfiguration );
+ super( applicationContext, archivaConfiguration );
}
@Override
diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/DavResourceTest.java b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/DavResourceTest.java
index a9bef0410..72b016f29 100644
--- a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/DavResourceTest.java
+++ b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/DavResourceTest.java
@@ -22,6 +22,8 @@ package org.apache.archiva.webdav;
import junit.framework.TestCase;
import org.apache.archiva.common.filelock.FileLockManager;
import org.apache.archiva.common.utils.FileUtils;
+import org.apache.archiva.repository.LayoutException;
+import org.apache.archiva.repository.content.FilesystemAsset;
import org.apache.archiva.repository.events.AuditListener;
import org.apache.archiva.repository.maven2.MavenManagedRepository;
import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
@@ -47,6 +49,7 @@ import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import javax.inject.Inject;
+import javax.servlet.http.HttpServletResponse;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -116,10 +119,10 @@ public class DavResourceTest
}
}
- private DavResource getDavResource( String logicalPath, Path file )
+ private DavResource getDavResource( String logicalPath, Path file ) throws LayoutException
{
- return new ArchivaDavResource( file.toAbsolutePath().toString(), logicalPath, repository, session, resourceLocator,
- resourceFactory, mimeTypes, Collections.<AuditListener> emptyList(), null, fileLockManager );
+ return new ArchivaDavResource( new FilesystemAsset( logicalPath, file.toAbsolutePath()) , logicalPath, repository, session, resourceLocator,
+ resourceFactory, mimeTypes, Collections.<AuditListener> emptyList(), null);
}
@Test
@@ -338,9 +341,16 @@ public class DavResourceTest
public DavResource createResource( DavResourceLocator locator, DavSession session )
throws DavException
{
- return new ArchivaDavResource( baseDir.toAbsolutePath().toString(), "/", repository, session, resourceLocator,
- resourceFactory, mimeTypes, Collections.<AuditListener> emptyList(),
- null, fileLockManager );
+ try
+ {
+ return new ArchivaDavResource( new FilesystemAsset( "/" , baseDir.toAbsolutePath()), "/", repository, session, resourceLocator,
+ resourceFactory, mimeTypes, Collections.<AuditListener> emptyList(),
+ null );
+ }
+ catch ( LayoutException e )
+ {
+ throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e );
+ }
}
}
}
diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/UnauthenticatedDavResourceFactory.java b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/UnauthenticatedDavResourceFactory.java
index 081f1c983..0390913a8 100644
--- a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/UnauthenticatedDavResourceFactory.java
+++ b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/UnauthenticatedDavResourceFactory.java
@@ -43,7 +43,7 @@ public class UnauthenticatedDavResourceFactory
ArchivaConfiguration archivaConfiguration )
throws PlexusSisuBridgeException
{
- super( applicationContext, plexusSisuBridge, archivaConfiguration );
+ super( applicationContext, archivaConfiguration );
}
@Override