Examples of TargetRegistry


Examples of org.sonatype.nexus.proxy.targets.TargetRegistry

    this.buildShadowRepository("repo3");
    this.buildShadowRepository("repo4");

    // create a target
    TargetRegistry targetRegistry = this.lookup(TargetRegistry.class);
    Target t1 =
        new Target("maven2-all", "All (Maven2)", new Maven2ContentClass(), Arrays.asList(new String[]{".*"}));
    targetRegistry.addRepositoryTarget(t1);
    nexusConfiguration().saveConfiguration();

    // setup security
    this.securitySystem = this.lookup(SecuritySystem.class);
    // this.securitySystem.setSecurityEnabled( true );
View Full Code Here

Examples of org.sonatype.nexus.proxy.targets.TargetRegistry

  @Test
  public void shouldFailOnProxyRepositories()
      throws Exception
  {
    final RepositoryRegistry repositoryRegistry = mock(RepositoryRegistry.class);
    final TargetRegistry targetRegistry = mock(TargetRegistry.class);
    final Repository proxyRepository = mock(Repository.class);
    final RepositoryKind proxyRepositoryKind = mock(RepositoryKind.class);

    when(repositoryRegistry.getRepository(REPO_ID)).thenReturn(proxyRepository);
    when(proxyRepository.getRepositoryContentClass()).thenReturn(MAVEN_2_CONTENT_CLASS);
View Full Code Here

Examples of org.sonatype.nexus.proxy.targets.TargetRegistry

  @Test
  public void shouldFailOnNonMaven2Repositories()
      throws Exception
  {
    final RepositoryRegistry repositoryRegistry = mock(RepositoryRegistry.class);
    final TargetRegistry targetRegistry = mock(TargetRegistry.class);
    final Repository repository = mock(Repository.class);

    when(repositoryRegistry.getRepository(REPO_ID)).thenReturn(repository);
    when(repository.getRepositoryContentClass()).thenReturn(MAVEN_1_CONTENT_CLASS);
View Full Code Here

Examples of org.sonatype.nexus.proxy.targets.TargetRegistry

  @Test
  public void shouldFailOnOutOfServiceRepositories()
      throws Exception
  {
    final RepositoryRegistry repositoryRegistry = mock(RepositoryRegistry.class);
    final TargetRegistry targetRegistry = mock(TargetRegistry.class);

    final Repository repository = mock(Repository.class);

    when(repositoryRegistry.getRepository(REPO_ID)).thenReturn(repository);
    when(repository.getRepositoryContentClass()).thenReturn(MAVEN_2_CONTENT_CLASS);
View Full Code Here

Examples of org.sonatype.nexus.proxy.targets.TargetRegistry

  @Test
  public void shouldFailOnGroupRepositories()
      throws Exception
  {
    final RepositoryRegistry repositoryRegistry = mock(RepositoryRegistry.class);
    final TargetRegistry targetRegistry = mock(TargetRegistry.class);
    final Repository repository = mock(Repository.class);
    final RepositoryKind repositoryKind = mock(RepositoryKind.class);

    when(repositoryRegistry.getRepository(REPO_ID)).thenReturn(repository);
    when(repository.getRepositoryContentClass()).thenReturn(MAVEN_2_CONTENT_CLASS);
View Full Code Here

Examples of org.sonatype.nexus.proxy.targets.TargetRegistry

  @Test
  public void shouldFailOnSnapshotRepositories()
      throws Exception
  {
    final RepositoryRegistry repositoryRegistry = mock(RepositoryRegistry.class);
    final TargetRegistry targetRegistry = mock(TargetRegistry.class);
    final Repository repository = mock(Repository.class);
    final RepositoryKind repositoryKind = mock(RepositoryKind.class);
    final MavenRepository mavenRepository = mock(MavenRepository.class);

    when(repositoryRegistry.getRepository(REPO_ID)).thenReturn(repository);
View Full Code Here

Examples of org.sonatype.nexus.proxy.targets.TargetRegistry

  @Test
  public void shouldFailOnMixedRepositories()
      throws Exception
  {
    final RepositoryRegistry repositoryRegistry = mock(RepositoryRegistry.class);
    final TargetRegistry targetRegistry = mock(TargetRegistry.class);
    final Repository repository = mock(Repository.class);
    final RepositoryKind repositoryKind = mock(RepositoryKind.class);
    final MavenRepository mavenRepository = mock(MavenRepository.class);

    when(repositoryRegistry.getRepository(REPO_ID)).thenReturn(repository);
View Full Code Here

Examples of org.sonatype.nexus.proxy.targets.TargetRegistry

  @Test
  public void shouldFailOnMissingTarget()
      throws Exception
  {
    final RepositoryRegistry repositoryRegistry = mock(RepositoryRegistry.class);
    final TargetRegistry targetRegistry = mock(TargetRegistry.class);
    final Repository repository = mock(Repository.class);

    when(repositoryRegistry.getRepository(REPO_ID)).thenReturn(repository);
    when(targetRegistry.getRepositoryTarget(TARGET_ID)).thenReturn(null);

    thrown.expect(IllegalStateException.class);
    new DefaultReleaseRemover(repositoryRegistry, targetRegistry, mock(Walker.class), MAVEN_2_CONTENT_CLASS)
        .removeReleases(new ReleaseRemovalRequest(REPO_ID, 1, TARGET_ID));
  }
View Full Code Here

Examples of org.sonatype.nexus.proxy.targets.TargetRegistry

  @Test
  public void testOnEmptyRepo()
      throws Exception
  {
    final RepositoryRegistry repositoryRegistry = mock(RepositoryRegistry.class);
    final TargetRegistry targetRegistry = mock(TargetRegistry.class);
    final Repository repository = mock(Repository.class);
    final RepositoryKind repositoryKind = mock(RepositoryKind.class);
    final MavenRepository mavenRepository = mock(MavenRepository.class);

    when(repositoryRegistry.getRepository(REPO_ID)).thenReturn(repository);
    when(targetRegistry.getRepositoryTarget(TARGET_ID)).thenReturn(null);
    when(repositoryRegistry.getRepository(REPO_ID)).thenReturn(repository);
    when(repository.getRepositoryContentClass()).thenReturn(MAVEN_2_CONTENT_CLASS);
    when(repository.getLocalStatus()).thenReturn(LocalStatus.IN_SERVICE);
    when(repository.getRepositoryKind()).thenReturn(repositoryKind);
    when(repositoryKind.isFacetAvailable(ProxyRepository.class)).thenReturn(false);
View Full Code Here

Examples of org.sonatype.nexus.proxy.targets.TargetRegistry

    // loads up config, defaults
    startNx();

    super.setUp();

    final TargetRegistry targetRegistry = this.lookup(TargetRegistry.class);

    // shave off defaults
    final Collection<Target> targets = new ArrayList<Target>(targetRegistry.getRepositoryTargets());
    for (Target t : targets) {
      targetRegistry.removeRepositoryTarget(t.getId());
    }

    // add target
    Target t1 =
        new Target("maven2-all", "All (Maven2)", new Maven2ContentClass(), Arrays.asList(new String[]{".*"}));

    targetRegistry.addRepositoryTarget(t1);

    getApplicationConfiguration().saveConfiguration();

    // setup security
    // setup security
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.