Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Core changes were not applied to EasyMock objects in UTs.
git-svn-id: file:///opt/svn/repositories/sonatype.org/nexus/trunk/nexus@6566 2aa8b3fc-8ebb-4439-a84f-95066eaea8ab
  • Loading branch information
cstamas committed Jun 4, 2010
1 parent 0514415 commit c6fba89
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Expand Up @@ -38,6 +38,7 @@
import org.sonatype.nexus.proxy.repository.DefaultRepositoryKind;
import org.sonatype.nexus.proxy.repository.GroupRepository;
import org.sonatype.nexus.proxy.repository.HostedRepository;
import org.sonatype.nexus.proxy.repository.ProxyRepository;
import org.sonatype.nexus.proxy.repository.Repository;

public class PathBasedRequestRepositoryMapperTest
Expand Down Expand Up @@ -84,41 +85,47 @@ protected RequestRepositoryMapper prepare( Map<String, String[]> inclusions, Map
expect( repoA.getProviderRole() ).andReturn( Repository.class.getName() ).anyTimes();
expect( repoA.getProviderHint() ).andReturn( "maven2" ).anyTimes();
expect( repoA.isUserManaged() ).andReturn( true ).anyTimes();
expect( repoA.adaptToFacet( ProxyRepository.class ) ).andReturn( null ).anyTimes();

repoB = createMock( Repository.class );
makeThreadSafe( repoB, true );
expect( repoB.getId() ).andReturn( "repoB" ).anyTimes();
expect( repoB.getProviderRole() ).andReturn( Repository.class.getName() ).anyTimes();
expect( repoB.getProviderHint() ).andReturn( "maven2" ).anyTimes();
expect( repoB.isUserManaged() ).andReturn( true ).anyTimes();
expect( repoB.adaptToFacet( ProxyRepository.class ) ).andReturn( null ).anyTimes();

repoC = createMock( Repository.class );
makeThreadSafe( repoC, true );
expect( repoC.getId() ).andReturn( "repoC" ).anyTimes();
expect( repoC.getProviderRole() ).andReturn( Repository.class.getName() ).anyTimes();
expect( repoC.getProviderHint() ).andReturn( "maven2" ).anyTimes();
expect( repoC.isUserManaged() ).andReturn( true ).anyTimes();
expect( repoC.adaptToFacet( ProxyRepository.class ) ).andReturn( null ).anyTimes();

repoD = createMock( Repository.class );
makeThreadSafe( repoD, true );
expect( repoD.getId() ).andReturn( "repoD" ).anyTimes();
expect( repoD.getProviderRole() ).andReturn( Repository.class.getName() ).anyTimes();
expect( repoD.getProviderHint() ).andReturn( "maven2" ).anyTimes();
expect( repoD.isUserManaged() ).andReturn( true ).anyTimes();
expect( repoD.adaptToFacet( ProxyRepository.class ) ).andReturn( null ).anyTimes();

repoE = createMock( Repository.class );
makeThreadSafe( repoE, true );
expect( repoE.getId() ).andReturn( "repoE" ).anyTimes();
expect( repoE.getProviderRole() ).andReturn( Repository.class.getName() ).anyTimes();
expect( repoE.getProviderHint() ).andReturn( "maven2" ).anyTimes();
expect( repoE.isUserManaged() ).andReturn( true ).anyTimes();
expect( repoE.adaptToFacet( ProxyRepository.class ) ).andReturn( null ).anyTimes();

repoF = createMock( Repository.class );
makeThreadSafe( repoF, true );
expect( repoF.getId() ).andReturn( "repoF" ).anyTimes();
expect( repoF.getProviderRole() ).andReturn( Repository.class.getName() ).anyTimes();
expect( repoF.getProviderHint() ).andReturn( "maven2" ).anyTimes();
expect( repoF.isUserManaged() ).andReturn( true ).anyTimes();
expect( repoF.adaptToFacet( ProxyRepository.class ) ).andReturn( null ).anyTimes();

expect( repoA.getRepositoryContentClass() ).andReturn( new Maven2ContentClass() ).anyTimes();
expect( repoB.getRepositoryContentClass() ).andReturn( new Maven2ContentClass() ).anyTimes();
Expand Down
Expand Up @@ -33,6 +33,7 @@
import org.sonatype.nexus.proxy.repository.DefaultRepositoryKind;
import org.sonatype.nexus.proxy.repository.GroupRepository;
import org.sonatype.nexus.proxy.repository.HostedRepository;
import org.sonatype.nexus.proxy.repository.ProxyRepository;
import org.sonatype.nexus.proxy.repository.Repository;

public class DefaultRepositoryRegistryTest
Expand Down Expand Up @@ -89,6 +90,9 @@ public void testSimple()
expect( repoA.adaptToFacet( HostedRepository.class ) ).andReturn( repoA ).anyTimes();
expect( repoB.adaptToFacet( HostedRepository.class ) ).andReturn( repoB ).anyTimes();
expect( repoC.adaptToFacet( HostedRepository.class ) ).andReturn( repoC ).anyTimes();
expect( repoA.adaptToFacet( ProxyRepository.class ) ).andReturn( null ).anyTimes();
expect( repoB.adaptToFacet( ProxyRepository.class ) ).andReturn( null ).anyTimes();
expect( repoC.adaptToFacet( ProxyRepository.class ) ).andReturn( null ).anyTimes();

replay( repoA, repoB, repoC );

Expand Down

0 comments on commit c6fba89

Please sign in to comment.