congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
EnvironmentUpdateEvent.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
rocks.inspectit.server.ci.event.EnvironmentUpdateEvent
constructor

Best Java code snippets using rocks.inspectit.server.ci.event.EnvironmentUpdateEvent.<init> (Showing top 12 results out of 315)

origin: inspectIT/inspectIT

/**
 * Notifies listeners about environment update.
 *
 * @param old
 *            Old environment instance.
 * @param updated
 *            Updated environment instance.
 */
private void publishEnvironmentUpdateEvent(Environment old, Environment updated) {
  Collection<Profile> removedProfiles = getProfileDifference(old, updated);
  Collection<Profile> addedProfiles = getProfileDifference(updated, old);
  EnvironmentUpdateEvent event = new EnvironmentUpdateEvent(this, old, updated, addedProfiles, removedProfiles);
  eventPublisher.publishEvent(event);
}
origin: inspectIT/inspectIT

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void idsNotMatching() {
    when(updated.getId()).thenReturn(ID);
    when(old.getId()).thenReturn("smth");
    new EnvironmentUpdateEvent(this, old, updated, null, null);
  }
}
origin: inspectIT/inspectIT

@Test
public void functionalAdded() {
  when(old.getId()).thenReturn(ID);
  when(updated.getId()).thenReturn(ID);
  SpecialMethodSensorAssignment functionalAssignment = mock(SpecialMethodSensorAssignment.class);
  when(functionalAssignmentFactory.getSpecialAssignments(old)).thenReturn(Collections.<SpecialMethodSensorAssignment> emptyList());
  when(functionalAssignmentFactory.getSpecialAssignments(updated)).thenReturn(Collections.singletonList(functionalAssignment));
  EnvironmentUpdateEvent event = new EnvironmentUpdateEvent(this, old, updated, null, null);
  Collection<AbstractClassSensorAssignment<?>> added = event.getAddedSensorAssignments(functionalAssignmentFactory);
  assertThat(added, hasSize(1));
  assertThat(added, hasItem(functionalAssignment));
}
origin: inspectIT/inspectIT

@Test
public void profileRemoved() {
  when(old.getId()).thenReturn(ID);
  when(updated.getId()).thenReturn(ID);
  AbstractClassSensorAssignment<?> assignment = mock(AbstractClassSensorAssignment.class);
  doReturn(Collections.singletonList(assignment)).when(profileData).getData(SensorAssignmentProfileData.class);
  when(profile.isActive()).thenReturn(true);
  EnvironmentUpdateEvent event = new EnvironmentUpdateEvent(this, old, updated, null, Collections.singletonList(profile));
  Collection<AbstractClassSensorAssignment<?>> removed = event.getRemovedSensorAssignments(functionalAssignmentFactory);
  assertThat(removed, hasSize(1));
  assertThat(removed, hasItem(assignment));
}
origin: inspectIT/inspectIT

@Test
public void functionalRemoved() {
  when(old.getId()).thenReturn(ID);
  when(updated.getId()).thenReturn(ID);
  SpecialMethodSensorAssignment functionalAssignment = mock(SpecialMethodSensorAssignment.class);
  when(functionalAssignmentFactory.getSpecialAssignments(old)).thenReturn(Collections.singletonList(functionalAssignment));
  when(functionalAssignmentFactory.getSpecialAssignments(updated)).thenReturn(Collections.<SpecialMethodSensorAssignment> emptyList());
  EnvironmentUpdateEvent event = new EnvironmentUpdateEvent(this, old, updated, null, null);
  Collection<AbstractClassSensorAssignment<?>> removed = event.getRemovedSensorAssignments(functionalAssignmentFactory);
  assertThat(removed, hasSize(1));
  assertThat(removed, hasItem(functionalAssignment));
}
origin: inspectIT/inspectIT

@Test
public void profileAdded() {
  when(old.getId()).thenReturn(ID);
  when(updated.getId()).thenReturn(ID);
  AbstractClassSensorAssignment<?> assignment = mock(AbstractClassSensorAssignment.class);
  doReturn(Collections.singletonList(assignment)).when(profileData).getData(SensorAssignmentProfileData.class);
  when(profile.isActive()).thenReturn(true);
  EnvironmentUpdateEvent event = new EnvironmentUpdateEvent(this, old, updated, Collections.singletonList(profile), null);
  Collection<AbstractClassSensorAssignment<?>> added = event.getAddedSensorAssignments(functionalAssignmentFactory);
  assertThat(added, hasSize(1));
  assertThat(added, hasItem(assignment));
}
origin: inspectIT/inspectIT

@Test
public void profileRemovedNotActive() {
  when(old.getId()).thenReturn(ID);
  when(updated.getId()).thenReturn(ID);
  AbstractClassSensorAssignment<?> assignment = mock(AbstractClassSensorAssignment.class);
  doReturn(Collections.singletonList(assignment)).when(profileData).getData(SensorAssignmentProfileData.class);
  when(profile.isActive()).thenReturn(false);
  EnvironmentUpdateEvent event = new EnvironmentUpdateEvent(this, old, updated, null, Collections.singletonList(profile));
  Collection<AbstractClassSensorAssignment<?>> removed = event.getRemovedSensorAssignments(functionalAssignmentFactory);
  assertThat(removed, is(empty()));
}
origin: inspectIT/inspectIT

@Test
public void profileRemovedNotActive() {
  when(old.getId()).thenReturn(ID);
  when(updated.getId()).thenReturn(ID);
  AbstractClassSensorAssignment<?> assignment = mock(AbstractClassSensorAssignment.class);
  doReturn(Collections.singletonList(assignment)).when(profileData).getData(SensorAssignmentProfileData.class);
  when(profile.isActive()).thenReturn(false);
  EnvironmentUpdateEvent event = new EnvironmentUpdateEvent(this, old, updated, Collections.singletonList(profile), null);
  Collection<AbstractClassSensorAssignment<?>> added = event.getAddedSensorAssignments(functionalAssignmentFactory);
  assertThat(added, is(empty()));
}
origin: inspectIT/inspectIT

@Test
public void functionalNoChange() {
  when(old.getId()).thenReturn(ID);
  when(updated.getId()).thenReturn(ID);
  SpecialMethodSensorAssignment functionalAssignment = mock(SpecialMethodSensorAssignment.class);
  when(functionalAssignmentFactory.getSpecialAssignments(old)).thenReturn(Collections.singletonList(functionalAssignment));
  when(functionalAssignmentFactory.getSpecialAssignments(updated)).thenReturn(Collections.singletonList(functionalAssignment));
  EnvironmentUpdateEvent event = new EnvironmentUpdateEvent(this, old, updated, null, null);
  Collection<AbstractClassSensorAssignment<?>> removed = event.getRemovedSensorAssignments(functionalAssignmentFactory);
  assertThat(removed, is(empty()));
}
origin: inspectIT/inspectIT

@Test
public void functionalNoChange() {
  when(old.getId()).thenReturn(ID);
  when(updated.getId()).thenReturn(ID);
  SpecialMethodSensorAssignment functionalAssignment = mock(SpecialMethodSensorAssignment.class);
  when(functionalAssignmentFactory.getSpecialAssignments(old)).thenReturn(Collections.singletonList(functionalAssignment));
  when(functionalAssignmentFactory.getSpecialAssignments(updated)).thenReturn(Collections.singletonList(functionalAssignment));
  EnvironmentUpdateEvent event = new EnvironmentUpdateEvent(this, old, updated, null, null);
  Collection<AbstractClassSensorAssignment<?>> added = event.getAddedSensorAssignments(functionalAssignmentFactory);
  assertThat(added, is(empty()));
}
origin: inspectIT/inspectIT

@Test
public void wrongProfileData() {
  when(old.getId()).thenReturn(ID);
  when(updated.getId()).thenReturn(ID);
  when(profileData.isOfType(SensorAssignmentProfileData.class)).thenReturn(false);
  when(profile.isActive()).thenReturn(true);
  EnvironmentUpdateEvent event = new EnvironmentUpdateEvent(this, old, updated, null, Collections.singletonList(profile));
  Collection<AbstractClassSensorAssignment<?>> removed = event.getRemovedSensorAssignments(functionalAssignmentFactory);
  assertThat(removed, is(empty()));
}
origin: inspectIT/inspectIT

  @Test
  public void wrongProfileData() {
    when(old.getId()).thenReturn(ID);
    when(updated.getId()).thenReturn(ID);
    when(profileData.isOfType(SensorAssignmentProfileData.class)).thenReturn(false);
    when(profile.isActive()).thenReturn(true);
    EnvironmentUpdateEvent event = new EnvironmentUpdateEvent(this, old, updated, null, Collections.singletonList(profile));
    Collection<AbstractClassSensorAssignment<?>> added = event.getAddedSensorAssignments(functionalAssignmentFactory);
    assertThat(added, is(empty()));
  }
}
rocks.inspectit.server.ci.eventEnvironmentUpdateEvent<init>

Javadoc

Default constructor.

Popular methods of EnvironmentUpdateEvent

  • getAddedSensorAssignments
    Returns all AbstractClassSensorAssignment that are contained in the added profiles. Only active prof
  • getAfter
    Gets #after.
  • getEnvironmentId
    Returns id of the environment being updated.
  • getRemovedSensorAssignments
    Returns all AbstractClassSensorAssignment that are contained in the removed profiles. Only active pr
  • getAddedProfiles
    Gets #addedProfiles.
  • getFunctionalAssignmentsDifference
    Returns the difference from the Functional assignments for the two environments. The resulting colle
  • getRemovedProfiles
    Gets #removedProfiles.
  • getSensorAssignments
    Collects all AbstractClassSensorAssignments from the given profiles. If profile is not active assign

Popular in Java

  • Creating JSON documents from java classes using gson
  • findViewById (Activity)
  • runOnUiThread (Activity)
  • onCreateOptionsMenu (Activity)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • JList (javax.swing)
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now