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

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

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

origin: inspectIT/inspectIT

/**
 * Notifies listeners about profile update.
 *
 * @param old
 *            Old profile instance.
 * @param updated
 *            Updated profile instance.
 */
private void publishProfileUpdateEvent(Profile old, Profile updated) {
  ProfileUpdateEvent profileUpdateEvent = new ProfileUpdateEvent(this, old, updated);
  eventPublisher.publishEvent(profileUpdateEvent);
}
origin: inspectIT/inspectIT

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

@Test
public void noChange() {
  when(old.getId()).thenReturn(ID);
  when(updated.getId()).thenReturn(ID);
  doReturn(Collections.singletonList(assignment)).when(oldProfileData).getData(SensorAssignmentProfileData.class);
  doReturn(Collections.singletonList(assignment)).when(updatedProfileData).getData(SensorAssignmentProfileData.class);
  when(old.isActive()).thenReturn(true);
  when(updated.isActive()).thenReturn(true);
  ProfileUpdateEvent event = new ProfileUpdateEvent(this, old, updated);
  Collection<AbstractClassSensorAssignment<?>> removed = event.getRemovedSensorAssignments();
  assertThat(removed, is(empty()));
}
origin: inspectIT/inspectIT

@Test
public void wasActive() {
  when(old.getId()).thenReturn(ID);
  when(updated.getId()).thenReturn(ID);
  when(old.isActive()).thenReturn(true);
  when(updated.isActive()).thenReturn(true);
  ProfileUpdateEvent event = new ProfileUpdateEvent(this, old, updated);
  boolean activated = event.isProfileActivated();
  assertThat(activated, is(false));
}
origin: inspectIT/inspectIT

@Test
public void activated() {
  when(old.getId()).thenReturn(ID);
  when(updated.getId()).thenReturn(ID);
  doReturn(Collections.singletonList(assignment)).when(oldProfileData).getData(SensorAssignmentProfileData.class);
  doReturn(Collections.singletonList(assignment)).when(updatedProfileData).getData(SensorAssignmentProfileData.class);
  when(old.isActive()).thenReturn(false);
  when(updated.isActive()).thenReturn(true);
  ProfileUpdateEvent event = new ProfileUpdateEvent(this, old, updated);
  Collection<AbstractClassSensorAssignment<?>> removed = event.getRemovedSensorAssignments();
  assertThat(removed, is(empty()));
}
origin: inspectIT/inspectIT

@Test
public void noChange() {
  when(old.getId()).thenReturn(ID);
  when(updated.getId()).thenReturn(ID);
  doReturn(Collections.singletonList(assignment)).when(oldProfileData).getData(SensorAssignmentProfileData.class);
  doReturn(Collections.singletonList(assignment)).when(updatedProfileData).getData(SensorAssignmentProfileData.class);
  when(old.isActive()).thenReturn(true);
  when(updated.isActive()).thenReturn(true);
  ProfileUpdateEvent event = new ProfileUpdateEvent(this, old, updated);
  Collection<AbstractClassSensorAssignment<?>> added = event.getAddedSensorAssignments();
  assertThat(added, is(empty()));
}
origin: inspectIT/inspectIT

@Test
public void activated() {
  when(old.getId()).thenReturn(ID);
  when(updated.getId()).thenReturn(ID);
  when(old.isActive()).thenReturn(false);
  when(updated.isActive()).thenReturn(true);
  ProfileUpdateEvent event = new ProfileUpdateEvent(this, old, updated);
  boolean activated = event.isProfileActivated();
  assertThat(activated, is(true));
}
origin: inspectIT/inspectIT

  @Test
  public void stillActive() {
    when(old.getId()).thenReturn(ID);
    when(updated.getId()).thenReturn(ID);
    when(old.isActive()).thenReturn(true);
    when(updated.isActive()).thenReturn(true);
    ProfileUpdateEvent event = new ProfileUpdateEvent(this, old, updated);
    boolean deactivated = event.isProfileDeactivated();
    assertThat(deactivated, is(false));
  }
}
origin: inspectIT/inspectIT

@Test
public void deactivated() {
  when(old.getId()).thenReturn(ID);
  when(updated.getId()).thenReturn(ID);
  doReturn(Collections.singletonList(assignment)).when(oldProfileData).getData(SensorAssignmentProfileData.class);
  doReturn(Collections.singletonList(assignment)).when(updatedProfileData).getData(SensorAssignmentProfileData.class);
  when(old.isActive()).thenReturn(true);
  when(updated.isActive()).thenReturn(false);
  ProfileUpdateEvent event = new ProfileUpdateEvent(this, old, updated);
  Collection<AbstractClassSensorAssignment<?>> added = event.getAddedSensorAssignments();
  assertThat(added, is(empty()));
}
origin: inspectIT/inspectIT

@Test
public void deactivated() {
  when(old.getId()).thenReturn(ID);
  when(updated.getId()).thenReturn(ID);
  when(old.isActive()).thenReturn(true);
  when(updated.isActive()).thenReturn(false);
  ProfileUpdateEvent event = new ProfileUpdateEvent(this, old, updated);
  boolean deactivated = event.isProfileDeactivated();
  assertThat(deactivated, is(true));
}
origin: inspectIT/inspectIT

@Test
public void removedAssignments() {
  when(old.getId()).thenReturn(ID);
  when(updated.getId()).thenReturn(ID);
  doReturn(Collections.singletonList(assignment)).when(oldProfileData).getData(SensorAssignmentProfileData.class);
  doReturn(Collections.<AbstractClassSensorAssignment<?>> emptyList()).when(updatedProfileData).getData(SensorAssignmentProfileData.class);
  when(old.isActive()).thenReturn(true);
  when(updated.isActive()).thenReturn(true);
  ProfileUpdateEvent event = new ProfileUpdateEvent(this, old, updated);
  Collection<AbstractClassSensorAssignment<?>> removed = event.getRemovedSensorAssignments();
  assertThat(removed, hasSize(1));
  assertThat(removed, hasItem(assignment));
}
origin: inspectIT/inspectIT

@Test
public void addedAssignments() {
  when(old.getId()).thenReturn(ID);
  when(updated.getId()).thenReturn(ID);
  doReturn(Collections.<AbstractClassSensorAssignment<?>> emptyList()).when(oldProfileData).getData(SensorAssignmentProfileData.class);
  doReturn(Collections.singletonList(assignment)).when(updatedProfileData).getData(SensorAssignmentProfileData.class);
  when(old.isActive()).thenReturn(true);
  when(updated.isActive()).thenReturn(true);
  ProfileUpdateEvent event = new ProfileUpdateEvent(this, old, updated);
  Collection<AbstractClassSensorAssignment<?>> added = event.getAddedSensorAssignments();
  assertThat(added, hasSize(1));
  assertThat(added, hasItem(assignment));
}
origin: inspectIT/inspectIT

@Test
public void wasNotActive() {
  when(old.getId()).thenReturn(ID);
  when(updated.getId()).thenReturn(ID);
  when(old.isActive()).thenReturn(false);
  when(updated.isActive()).thenReturn(false);
  ProfileUpdateEvent event = new ProfileUpdateEvent(this, old, updated);
  boolean deactivated = event.isProfileDeactivated();
  assertThat(deactivated, is(false));
}
origin: inspectIT/inspectIT

  @Test
  public void stillNotActive() {
    when(old.getId()).thenReturn(ID);
    when(updated.getId()).thenReturn(ID);
    when(old.isActive()).thenReturn(false);
    when(updated.isActive()).thenReturn(false);
    ProfileUpdateEvent event = new ProfileUpdateEvent(this, old, updated);
    boolean activated = event.isProfileActivated();
    assertThat(activated, is(false));
  }
}
origin: inspectIT/inspectIT

@Test
public void deactivated() {
  when(old.getId()).thenReturn(ID);
  when(updated.getId()).thenReturn(ID);
  doReturn(Collections.singletonList(assignment)).when(oldProfileData).getData(SensorAssignmentProfileData.class);
  doReturn(Collections.singletonList(assignment)).when(updatedProfileData).getData(SensorAssignmentProfileData.class);
  when(old.isActive()).thenReturn(true);
  when(updated.isActive()).thenReturn(false);
  ProfileUpdateEvent event = new ProfileUpdateEvent(this, old, updated);
  Collection<AbstractClassSensorAssignment<?>> removed = event.getRemovedSensorAssignments();
  assertThat(removed, hasSize(1));
  assertThat(removed, hasItem(assignment));
}
origin: inspectIT/inspectIT

@Test
public void activated() {
  when(old.getId()).thenReturn(ID);
  when(updated.getId()).thenReturn(ID);
  doReturn(Collections.singletonList(assignment)).when(oldProfileData).getData(SensorAssignmentProfileData.class);
  doReturn(Collections.singletonList(assignment)).when(updatedProfileData).getData(SensorAssignmentProfileData.class);
  when(old.isActive()).thenReturn(false);
  when(updated.isActive()).thenReturn(true);
  ProfileUpdateEvent event = new ProfileUpdateEvent(this, old, updated);
  Collection<AbstractClassSensorAssignment<?>> added = event.getAddedSensorAssignments();
  assertThat(added, hasSize(1));
  assertThat(added, hasItem(assignment));
}
origin: inspectIT/inspectIT

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

  @Test
  public void wrongProfileData() {
    when(old.getId()).thenReturn(ID);
    when(updated.getId()).thenReturn(ID);
    when(oldProfileData.isOfType(SensorAssignmentProfileData.class)).thenReturn(false);
    when(updatedProfileData.isOfType(SensorAssignmentProfileData.class)).thenReturn(false);
    when(old.isActive()).thenReturn(true);
    when(updated.isActive()).thenReturn(true);
    ProfileUpdateEvent event = new ProfileUpdateEvent(this, old, updated);
    Collection<AbstractClassSensorAssignment<?>> added = event.getAddedSensorAssignments();
    assertThat(added, is(empty()));
  }
}
rocks.inspectit.server.ci.eventProfileUpdateEvent<init>

Javadoc

Default constructor.

Popular methods of ProfileUpdateEvent

  • getAddedSensorAssignments
    Returns all AbstractClassSensorAssignment that are "added" as result of this update. If profile was
  • getProfileId
    Returns id of the profile being updated.
  • getRemovedSensorAssignments
    Returns all AbstractClassSensorAssignment that are "removed" as result of this update. If profile wa
  • isProfileActivated
    If profile was activated as the result of the update action.
  • isProfileActive
    Returns if the profile is active.
  • isProfileDeactivated
    If profile was deactivated as the result of the update action.
  • getAllSensorAssignments
    Returns all AbstractClassSensorAssignments from the profile.
  • getAssignmentsDifference
    Finds AbstractClassSensorAssignments that exists in first profile and not in the second one.

Popular in Java

  • Running tasks concurrently on multiple threads
  • scheduleAtFixedRate (ScheduledExecutorService)
  • requestLocationUpdates (LocationManager)
  • getSupportFragmentManager (FragmentActivity)
  • String (java.lang)
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • 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