Package org.ebayopensource.nexus.plugins.artifactusage.task

Examples of org.ebayopensource.nexus.plugins.artifactusage.task.ArtifactUsageCalculator


    assertFalse(eventInspector.accepts(mock(NexusStartedEvent.class)));
  }

  public void testInspectInvalidEventType() throws Exception {
    ArtifactUsageEventInspector eventInspector = new ArtifactUsageEventInspector();
    ArtifactUsageCalculator calculator = mock(ArtifactUsageCalculator.class);
    eventInspector.setArtifactUsageCalculator(calculator);
    eventInspector.inspect(mock(RepositoryItemEventRetrieve.class));
    verifyZeroInteractions(calculator);
  }
View Full Code Here


  }

  protected void testCreateEventWithPomFile(
      Class<? extends RepositoryItemEvent> eventClass) throws Exception {
    ArtifactUsageEventInspector eventInspector = new ArtifactUsageEventInspector();
    ArtifactUsageCalculator calculator = mock(ArtifactUsageCalculator.class);
    eventInspector.setArtifactUsageCalculator(calculator);
    StorageFileItem item = mock(StorageFileItem.class);
    when(item.getPath()).thenReturn("some.pom");
    RepositoryItemEvent event = mock(eventClass);
    when(event.getItem()).thenReturn(item);
View Full Code Here

    verify(calculator, only()).calculateArtifactUsage(item);
  }

  public void testRemoteEventWithPomFile() throws Exception {
    ArtifactUsageEventInspector eventInspector = new ArtifactUsageEventInspector();
    ArtifactUsageCalculator calculator = mock(ArtifactUsageCalculator.class);
    eventInspector.setArtifactUsageCalculator(calculator);
    StorageFileItem item = mock(StorageFileItem.class);
    when(item.getPath()).thenReturn("some.pom");
    RepositoryItemEvent event = mock(RepositoryItemEventDelete.class);
    when(event.getItem()).thenReturn(item);
View Full Code Here

  }

  protected void testEventWithJarFile(
      Class<? extends RepositoryItemEvent> eventClass) throws Exception {
    ArtifactUsageEventInspector eventInspector = new ArtifactUsageEventInspector();
    ArtifactUsageCalculator calculator = mock(ArtifactUsageCalculator.class);
    eventInspector.setArtifactUsageCalculator(calculator);
    StorageFileItem item = mock(StorageFileItem.class);
    when(item.getPath()).thenReturn("some.jar");
    RepositoryItemEvent event = mock(eventClass);
    when(event.getItem()).thenReturn(item);
View Full Code Here

TOP

Related Classes of org.ebayopensource.nexus.plugins.artifactusage.task.ArtifactUsageCalculator

Copyright © 2018 www.massapicom. 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.