Codota Logo
EnvironmentUpdateEvent.getAddedSensorAssignments
Code IndexAdd Codota to your IDE (free)

How to use
getAddedSensorAssignments
method
in
rocks.inspectit.server.ci.event.EnvironmentUpdateEvent

Best Java code snippets using rocks.inspectit.server.ci.event.EnvironmentUpdateEvent.getAddedSensorAssignments (Showing top 7 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
BufferedReader b =
  • Codota IconInputStream in;new BufferedReader(new InputStreamReader(in))
  • Codota IconReader in;new BufferedReader(in)
  • Codota IconFile file;new BufferedReader(new FileReader(file))
  • Smart code suggestions by Codota
}
origin: inspectIT/inspectIT

/**
 * {@inheritDoc}
 */
@Override
protected Collection<ImmutableType> execute() {
  // always update with new Environment
  getConfigurationHolder().update(environmentUpdateEvent.getAfter(), getAgentId());
  Collection<ImmutableType> changedClassTypes = new HashSet<>();
  // then process removed and added assignments
  changedClassTypes.addAll(super.processRemovedAssignments(environmentUpdateEvent.getRemovedSensorAssignments(functionalAssignmentFactory)));
  changedClassTypes.addAll(super.processAddedAssignments(environmentUpdateEvent.getAddedSensorAssignments(functionalAssignmentFactory)));
  return changedClassTypes;
}
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, 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<?>> added = event.getAddedSensorAssignments(functionalAssignmentFactory);
  assertThat(added, is(empty()));
}
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 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()));
  }
}
origin: inspectIT/inspectIT

@Test
public void addedAssignment() throws RemoteException, BusinessException {
  Collection<ClassType> types = Collections.singleton(classType);
  doReturn(instrumentationApplier).when(configurationResolver).getInstrumentationApplier(sensorAssignment, environment);
  doReturn(types).when(classCacheSearchNarrower).narrowByClassSensorAssignment(classCache, sensorAssignment);
  doReturn(types).when(instrumentationService).addInstrumentationPoints(eq(types), eq(agentConfiguration), Matchers.<Collection<IInstrumentationApplier>> any());
  doReturn(Collections.singletonList(sensorAssignment)).when(event).getAddedSensorAssignments(functionalAssignmentFactory);
  job.setEnvironmentUpdateEvent(event);
  job.run();
  verify(configurationHolder, times(1)).update(updateEnvironment, PLATFORM_ID);
  ArgumentCaptor<Collection> captor = ArgumentCaptor.forClass(Collection.class);
  verify(instrumentationService, times(1)).addInstrumentationPoints(eq(types), eq(agentConfiguration), captor.capture());
  assertThat((Collection<IInstrumentationApplier>) captor.getValue(), hasSize(1));
  assertThat(((Collection<IInstrumentationApplier>) captor.getValue()).iterator().next(), is(instrumentationApplier));
  ArgumentCaptor<ClassInstrumentationChangedEvent> eventCaptor = ArgumentCaptor.forClass(ClassInstrumentationChangedEvent.class);
  verify(eventPublisher).publishEvent(eventCaptor.capture());
  assertThat(eventCaptor.getValue().getAgentId(), is(equalTo(PLATFORM_ID)));
  assertThat(eventCaptor.getValue().getInstrumentationDefinitions(), contains(org.hamcrest.Matchers.<InstrumentationDefinition> hasProperty("className", equalTo("fqn"))));
  verifyNoMoreInteractions(eventPublisher);
  verifyZeroInteractions(environment, agentConfiguration);
}
rocks.inspectit.server.ci.eventEnvironmentUpdateEventgetAddedSensorAssignments

Javadoc

Returns all AbstractClassSensorAssignment that are contained in the added profiles. Only active profiles are taken into account. Also includes the functional assignments that might be added as the result of changes in the environment.

Popular methods of EnvironmentUpdateEvent

  • <init>
    Default constructor.
  • 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

  • Making http post requests using okhttp
  • onRequestPermissionsResult (Fragment)
  • startActivity (Activity)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • ArrayList (java.util)
    Resizable-array implementation of the List interface. Implements all optional list operations, and p
  • Properties (java.util)
    The Properties class represents a persistent set of properties. The Properties can be saved to a st
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now