* under the License.
*/
+import com.google.common.collect.Lists;
import com.opensymphony.xwork2.Action;
import org.apache.archiva.metadata.model.ProjectVersionMetadata;
import org.apache.archiva.metadata.repository.RepositorySession;
throws Exception
{
super.setUp();
+ setObservableRepos( Lists.<String>newArrayList( "test-repo" ) );
//action = (BrowseAction) lookup( Action.class, ACTION_HINT );
action = (BrowseAction) getActionProxy( "/browse.action" ).getAction();
metadataResolver = new TestMetadataResolver();
applicationContext.getBean( "repositorySessionFactory#test", TestRepositorySessionFactory.class );
factory.setRepositorySession( repositorySession );
}
+
+ protected void tearDown()
+ throws Exception
+ {
+ super.tearDown();
+ setObservableRepos( Lists.<String>newArrayList( "test-repo" ) );
+ }
}
\ No newline at end of file
super.setUp();
//action = (RepositoriesAction) lookup( Action.class.getName(), "repositoriesAction" );
- action = (RepositoriesAction) getActionProxy( "/admin/index.action" ).getAction();
+ action = (RepositoriesAction) getActionProxy( "/admin/index.action" ).getAction();
}
MetadataRepository metadataRepository = (MetadataRepository) control.getMock();
control.expectAndReturn( metadataRepository.getMetadataFacets( "internal", RepositoryStatistics.FACET_ID ),
Arrays.asList( "20091125.123456.678" ) );
- control.expectAndReturn( metadataRepository.getMetadataFacet( "internal", RepositoryStatistics.FACET_ID,
- "20091125.123456.678" ),
- new RepositoryStatistics() );
+ control.expectAndReturn(
+ metadataRepository.getMetadataFacet( "internal", RepositoryStatistics.FACET_ID, "20091125.123456.678" ),
+ new RepositoryStatistics() );
control.expectAndReturn( metadataRepository.getMetadataFacets( "snapshots", RepositoryStatistics.FACET_ID ),
Arrays.asList( "20091112.012345.012" ) );
- control.expectAndReturn( metadataRepository.getMetadataFacet( "snapshots", RepositoryStatistics.FACET_ID,
- "20091112.012345.012" ),
- new RepositoryStatistics() );
+ control.expectAndReturn(
+ metadataRepository.getMetadataFacet( "snapshots", RepositoryStatistics.FACET_ID, "20091112.012345.012" ),
+ new RepositoryStatistics() );
control.replay();
RepositorySession session = mock( RepositorySession.class );
when( session.getRepository() ).thenReturn( metadataRepository );
- //TestRepositorySessionFactory factory = (TestRepositorySessionFactory) lookup( RepositorySessionFactory.class );
- TestRepositorySessionFactory factory = new TestRepositorySessionFactory();
+ TestRepositorySessionFactory factory =
+ applicationContext.getBean( "repositorySessionFactory#test", TestRepositorySessionFactory.class );
factory.setRepositorySession( session );
ServletRunner sr = new ServletRunner();