Package org.sonatype.nexus.templates.repository

Examples of org.sonatype.nexus.templates.repository.RepositoryTemplate.create()


      template.getConfigurableRepository().setExposed(model.isExposed());

      template.getConfigurableRepository().setLocalStatus(LocalStatus.IN_SERVICE);

      // we create an empty group
      GroupRepository groupRepository = (GroupRepository) template.create();

      ArrayList<String> memberIds = new ArrayList<String>(model.getRepositories().size());

      for (RepositoryGroupMemberRepository member : (List<RepositoryGroupMemberRepository>) model
          .getRepositories()) {
View Full Code Here


    template.getConfigurableRepository().setLocalStatus(LocalStatus.IN_SERVICE);

    boolean passed = false;

    try {
      template.create();

      passed = !shouldFail;
    }
    catch (ConfigurationException e) {
      passed = shouldFail;
View Full Code Here

    repoTemplate.getConfigurableRepository().setLocalStatus(LocalStatus.IN_SERVICE);

    repoTemplate.getConfigurableRepository().setIndexable(true);

    // will not fail, just create a warning and silently override it
    Repository repository = repoTemplate.create();

    assertFalse("The repository should be non-indexable!", repository.isIndexable());
  }

  @Test
View Full Code Here

    // Assert.assertEquals( "group-name", group.getName() );
    repoTemplate.getConfigurableRepository().setExposed(true);
    repoTemplate.getConfigurableRepository().setLocalStatus(LocalStatus.IN_SERVICE);
    repoTemplate.getConfigurableRepository().setIndexable(true);

    repoTemplate.create();
  }

  @Test
  public void testCreateNonIndexableM2()
      throws Exception
View Full Code Here

    // Assert.assertEquals( "group-name", group.getName() );
    repoTemplate.getConfigurableRepository().setExposed(true);
    repoTemplate.getConfigurableRepository().setLocalStatus(LocalStatus.IN_SERVICE);
    repoTemplate.getConfigurableRepository().setIndexable(false);

    repoTemplate.create();
  }

}
View Full Code Here

    // create this new repo type
    final RepositoryTemplate template =
        (RepositoryTemplate) templateManager.getTemplates().getTemplateById("nexus4807");
    template.getConfigurableRepository().setId("peter");
    template.getConfigurableRepository().setName("We all love Peter!");
    final Repository repository = template.create();

    // do some simple assertion
    assertThat(repository.getId(), equalTo("peter"));
    assertThat(repository.getName(), equalTo("We all love Peter!"));
    // assert peter is here simply, by having this below not throw any exception and returning non-null
View Full Code Here

      hostedRepoTemplate.getConfigurableRepository().setId("test");
      hostedRepoTemplate.getConfigurableRepository().setName("Test");
      hostedRepoTemplate.getConfigurableRepository().setLocalStatus(LocalStatus.IN_SERVICE);

      hostedRepoTemplate.create().recreateAttributes(new ResourceStoreRequest(RepositoryItemUid.PATH_ROOT), null);
    }
    catch (ConfigurationException e) {
      Assert.fail("ConfigurationException creating repository");
    }
  }
View Full Code Here

    templateConf.setId("test");
    templateConf.setName("Test");
    final CRemoteStorage remoteStorageConf = new CRemoteStorage();
    remoteStorageConf.setUrl("http://localhost:" + server.getPort());
    template.getCoreConfiguration().getConfiguration(true).setRemoteStorage(remoteStorageConf);
    final MavenProxyRepository mavenProxyRepository = (MavenProxyRepository) template.create();

    return mavenProxyRepository;
  }

  protected List<String> getRecordedRequests() {
View Full Code Here

                (RepositoryTemplate) templateProvider.getTemplateById( "default_proxy_release" );

            template.getConfigurableRepository().setId( "flexmojos" );
            template.getConfigurableRepository().setName( "Flexmojos Repository" );

            Repository repo = template.create();
            repositoryRegistry.addRepository( repo );

            return repo;
        }
        catch ( Exception e )
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.