@Test public void verifyAsyncControlArguments() { ArgumentCaptor<Integer> bufferSizeCaptor = ArgumentCaptor.forClass(Integer.class); ArgumentCaptor<Long> timeoutSecondsCaptor = ArgumentCaptor.forClass(Long.class); when(storageTx .browse(anyString(), anyMapOf(String.class, Object.class), bufferSizeCaptor.capture(), timeoutSecondsCaptor.capture())) .thenReturn(emptyList()); new OrientMetadataRebuilder(10, 20).rebuild(repository, true, false, null, null, null); assertThat(bufferSizeCaptor.getValue(), equalTo(10)); assertThat(timeoutSecondsCaptor.getValue(), equalTo(20L)); }
@Override public boolean rebuild( final Repository repository, final boolean update, final boolean rebuildChecksums, @Nullable final String groupId, @Nullable final String artifactId, @Nullable final String baseVersion) { checkNotNull(repository); final StorageTx tx = repository.facet(StorageFacet.class).txSupplier().get(); UnitOfWork.beginBatch(tx); try { return rebuildInTransaction(repository, update, rebuildChecksums, groupId, artifactId, baseVersion); } finally { UnitOfWork.end(); } }
OrientMetadataRebuilder extends AbstractMetadataRebuilder { @Override public boolean rebuild( final Repository repository, final boolean update, final boolean rebuildChecksums, @Nullable final String groupId, @Nullable final String artifactId, @Nullable final String baseVersion) { checkNotNull(repository); final StorageTx tx = repository.facet(StorageFacet.class).txSupplier().get(); UnitOfWork.beginBatch(tx); try { return rebuildInTransaction(repository, update, rebuildChecksums, groupId, artifactId, baseVersion); } finally { UnitOfWork.end(); } } }
OrientMetadataRebuilder extends AbstractMetadataRebuilder { @Override public boolean rebuild( final Repository repository, final boolean update, final boolean rebuildChecksums, @Nullable final String groupId, @Nullable final String artifactId, @Nullable final String baseVersion) { checkNotNull(repository); final StorageTx tx = repository.facet(StorageFacet.class).txSupplier().get(); UnitOfWork.beginBatch(tx); try { return rebuildInTransaction(repository, update, rebuildChecksums, groupId, artifactId, baseVersion); } finally { UnitOfWork.end(); } } @Inject  OrientMetadataRebuilder(
      @Named("${nexus.maven.metadata.rebuild.bufferSize:-1000}") final int bufferSize,
      @Named("${nexus.maven.metadata.rebuild.timeoutSeconds:-60}") final int timeoutSeconds); }
OrientMetadataRebuilder extends AbstractMetadataRebuilder { @Override public boolean rebuild( final Repository repository, final boolean update, final boolean rebuildChecksums, @Nullable final String groupId, @Nullable final String artifactId, @Nullable final String baseVersion) { checkNotNull(repository); final StorageTx tx = repository.facet(StorageFacet.class).txSupplier().get(); UnitOfWork.beginBatch(tx); try { return rebuildInTransaction(repository, update, rebuildChecksums, groupId, artifactId, baseVersion); } finally { UnitOfWork.end(); } } @Inject  OrientMetadataRebuilder(
      @Named("${nexus.maven.metadata.rebuild.bufferSize:-1000}") final int bufferSize,
      @Named("${nexus.maven.metadata.rebuild.timeoutSeconds:-60}") final int timeoutSeconds); @Override boolean rebuild(
      final Repository repository,
      final boolean update,
      final boolean rebuildChecksums,
      @Nullable final String groupId,
      @Nullable final String artifactId,
      @Nullable final String baseVersion); @Override boolean rebuildInTransaction(
      final Repository repository,
      final boolean update,
      final boolean rebuildChecksums,
      @Nullable final String groupId,
      @Nullable final String artifactId,
      @Nullable final String baseVersion); @Override boolean exists(final Repository repository, final MavenPath mavenPath); @Override void deleteMetadata(final Repository repository, final List<String []> gavs); }
OrientMetadataRebuilder extends AbstractMetadataRebuilder { @Override public boolean rebuild( final Repository repository, final boolean update, final boolean rebuildChecksums, @Nullable final String groupId, @Nullable final String artifactId, @Nullable final String baseVersion) { checkNotNull(repository); final StorageTx tx = repository.facet(StorageFacet.class).txSupplier().get(); UnitOfWork.beginBatch(tx); try { return rebuildInTransaction(repository, update, rebuildChecksums, groupId, artifactId, baseVersion); } finally { UnitOfWork.end(); } } @Inject  OrientMetadataRebuilder(
      @Named("${nexus.maven.metadata.rebuild.bufferSize:-1000}") final int bufferSize,
      @Named("${nexus.maven.metadata.rebuild.timeoutSeconds:-60}") final int timeoutSeconds); @Override boolean rebuild(
      final Repository repository,
      final boolean update,
      final boolean rebuildChecksums,
      @Nullable final String groupId,
      @Nullable final String artifactId,
      @Nullable final String baseVersion); @Override boolean rebuildInTransaction(
      final Repository repository,
      final boolean update,
      final boolean rebuildChecksums,
      @Nullable final String groupId,
      @Nullable final String artifactId,
      @Nullable final String baseVersion); @Override boolean exists(final Repository repository, final MavenPath mavenPath); @Override void deleteMetadata(final Repository repository, final List<String []> gavs);  }