Examples of RepositoryItemEventStoreCreate


Examples of org.sonatype.nexus.proxy.events.RepositoryItemEventStoreCreate

    // remove the "request" item from n-cache if there
    removeFromNotFoundCache(item.getResourceStoreRequest());

    if (Action.create.equals(action)) {
      eventBus().post(new RepositoryItemEventStoreCreate(this, item));
    }
    else {
      eventBus().post(new RepositoryItemEventStoreUpdate(this, item));
    }
  }
View Full Code Here

Examples of org.sonatype.nexus.proxy.events.RepositoryItemEventStoreCreate

  @Test
  public void shouldNotCreateRepo() {
    Repository repo = createRepository(true);
    repositoryRegistry.unregister(repo.getId());
    eventsRouter.on(new RepositoryItemEventStoreCreate(repo, createItem("VERSION", "test-source.jar")));
  }
View Full Code Here

Examples of org.sonatype.nexus.proxy.events.RepositoryItemEventStoreCreate

  @Test
  public void shouldNotCreateRepoForPom() {
    MavenRepository repo = createRepository(true);
    repositoryRegistry.register(repo);
    eventsRouter.on(new RepositoryItemEventStoreCreate(repo, createItem("VERSION", "test.pom")));
  }
View Full Code Here

Examples of org.sonatype.nexus.proxy.events.RepositoryItemEventStoreCreate

  @Test
  public void shouldCreateRepoForRpm() {
    MavenRepository repo = createRepository(true);
    repositoryRegistry.register(repo);
    eventsRouter.on(new RepositoryItemEventStoreCreate(repo, createItem("VERSION", "test.rpm")));
  }
View Full Code Here

Examples of org.sonatype.nexus.proxy.events.RepositoryItemEventStoreCreate

    File outputDirectory = new File(new URL(repo.getLocalUrl() + "/blalu/" + versionStr).toURI());
    File rpmFile = createDummyRpm("test-artifact", versionStr, outputDirectory);

    StorageItem storageItem = createItem(versionStr, rpmFile.getName());

    handler.on(new RepositoryItemEventStoreCreate(repo, storageItem));

    final int activeWorker = getRunningTasks();
    LOG.debug("active worker: " + activeWorker);
    assertThat(activeWorker, is(lessThanOrEqualTo(10)));
  }
View Full Code Here

Examples of org.sonatype.nexus.proxy.events.RepositoryItemEventStoreCreate

  @Test
  public void eventsOnHiddenFilesAreNotRecorded() {
    final ItemSubscriber underTest =
        new ItemSubscriber(feedRecorder);
    final RepositoryItemEventStoreCreate evt = new RepositoryItemEventStoreCreate(repository, storageFileItem);
    when(storageFileItem.getPath()).thenReturn("/some/path");
    when(storageFileItem.getRepositoryId()).thenReturn("central");
    when(storageFileItem.getRemoteUrl()).thenReturn("http://repo1.maven.org/maven2");
    when(repositoryItemUid.getBooleanAttributeValue(IsHiddenAttribute.class)).thenReturn(true);
    underTest.on(evt);
View Full Code Here

Examples of org.sonatype.nexus.proxy.events.RepositoryItemEventStoreCreate

        new ItemSubscriber(feedRecorder);
    when(storageFileItem.getPath()).thenReturn("/some/path");
    when(storageFileItem.getRepositoryId()).thenReturn("central");
    when(storageFileItem.getRemoteUrl()).thenReturn("http://repo1.maven.org/maven2");
    {
      final RepositoryItemEventStoreCreate evt = new RepositoryItemEventStoreCreate(repository, storageFileItem);
      when(repositoryItemUid.getBooleanAttributeValue(IsMavenRepositoryMetadataAttribute.class)).thenReturn(
          true);
      underTest.on(evt);
    }
    {
      final RepositoryItemEventStoreCreate evt = new RepositoryItemEventStoreCreate(repository, storageFileItem);
      when(repositoryItemUid.getBooleanAttributeValue(IsMavenArtifactSignatureAttribute.class)).thenReturn(
          true);
      underTest.on(evt);
    }
    {
      final RepositoryItemEventStoreCreate evt = new RepositoryItemEventStoreCreate(repository, storageFileItem);
      when(repositoryItemUid.getBooleanAttributeValue(IsMavenChecksumAttribute.class)).thenReturn(true);
      underTest.on(evt);
    }

    // these events above should be filtered out by ItemChangesFeedEventInspector, feedRecordes shall be untouched
    verifyNoMoreInteractions(feedRecorder);

    // now do touch it (with event that has all the flags we added false)
    final RepositoryItemEventStoreCreate evt = new RepositoryItemEventStoreCreate(repository, storageFileItem);
    when(repositoryItemUid.getBooleanAttributeValue(IsMavenRepositoryMetadataAttribute.class)).thenReturn(
        false);
    when(repositoryItemUid.getBooleanAttributeValue(IsMavenArtifactSignatureAttribute.class)).thenReturn(false);
    when(repositoryItemUid.getBooleanAttributeValue(IsMavenChecksumAttribute.class)).thenReturn(false);
    underTest.on(evt);
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.