diff options
author | Martin Stockhammer <martin_s@apache.org> | 2019-02-22 21:09:56 +0100 |
---|---|---|
committer | Martin Stockhammer <martin_s@apache.org> | 2019-05-03 20:48:31 +0200 |
commit | a9ebba65acafda26696d1ade1a19e909d93e8385 (patch) | |
tree | f81ea86dac5e89601881ede9b609908e85b24fbc /archiva-modules/archiva-base | |
parent | d1242030bf232c0d9b68e4402188ee261924bf4b (diff) | |
download | archiva-a9ebba65acafda26696d1ade1a19e909d93e8385.tar.gz archiva-a9ebba65acafda26696d1ade1a19e909d93e8385.zip |
Adding config file removal before tests
(cherry picked from commit 63154a6af822384907566f3998c7948d6d34eed8)
Diffstat (limited to 'archiva-modules/archiva-base')
-rw-r--r-- | archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/AbstractRepositoryAdminTest.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/AbstractRepositoryAdminTest.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/AbstractRepositoryAdminTest.java index d158b401d..b7c2091eb 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/AbstractRepositoryAdminTest.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/AbstractRepositoryAdminTest.java @@ -27,17 +27,21 @@ import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin; import org.apache.archiva.admin.model.proxyconnector.ProxyConnectorAdmin; import org.apache.archiva.admin.model.proxyconnectorrule.ProxyConnectorRuleAdmin; import org.apache.archiva.admin.model.remote.RemoteRepositoryAdmin; +import org.apache.archiva.configuration.ArchivaConfiguration; import org.apache.archiva.redback.role.RoleManager; import org.apache.archiva.redback.users.User; import org.apache.archiva.redback.users.memory.SimpleUser; import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner; import org.apache.commons.lang.StringUtils; +import org.junit.Before; +import org.junit.BeforeClass; import org.junit.runner.RunWith; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.test.context.ContextConfiguration; import javax.inject.Inject; +import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; @@ -77,6 +81,23 @@ public abstract class AbstractRepositoryAdminTest @Inject protected ProxyConnectorRuleAdmin proxyConnectorRuleAdmin; + @Inject + private ArchivaConfiguration archivaConfiguration; + + @Before + public void initialize() { + Path confFile = Paths.get(APPSERVER_BASE_PATH, "conf/archiva.xml"); + try + { + Files.deleteIfExists( confFile ); + archivaConfiguration.reload(); + } + catch ( IOException e ) + { + // ignore + } + } + protected AuditInformation getFakeAuditInformation() { AuditInformation auditInformation = new AuditInformation( getFakeUser(), "archiva-localhost" ); |