1 package org.apache.archiva.admin.repository;
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
21 import junit.framework.TestCase;
22 import org.apache.archiva.admin.AuditInformation;
23 import org.apache.archiva.admin.mock.MockAuditListener;
24 import org.codehaus.plexus.redback.users.User;
25 import org.codehaus.plexus.redback.users.memory.SimpleUser;
26 import org.junit.runner.RunWith;
27 import org.slf4j.Logger;
28 import org.slf4j.LoggerFactory;
29 import org.springframework.test.context.ContextConfiguration;
30 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
32 import javax.inject.Inject;
35 * @author Olivier Lamy
37 @RunWith( SpringJUnit4ClassRunner.class )
38 @ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
39 public abstract class AbstractRepositoryAdminTest
42 protected Logger log = LoggerFactory.getLogger( getClass() );
44 public static final String APPSERVER_BASE_PATH = System.getProperty( "appserver.base" );
47 protected MockAuditListener mockAuditListener;
49 protected AuditInformation getFakeAuditInformation()
51 AuditInformation auditInformation = new AuditInformation( getFakeUser(), "archiva-localhost" );
52 return auditInformation;
55 protected User getFakeUser()
57 SimpleUser user = new SimpleUser()
60 public Object getPrincipal()
67 user.setUsername( "root" );
68 user.setFullName( "The top user" );