Codota Logo
EnvironmentUpdateJob.run
Code IndexAdd Codota to your IDE (free)

How to use
run
method
in
rocks.inspectit.server.instrumentation.config.job.EnvironmentUpdateJob

Best Java code snippets using rocks.inspectit.server.instrumentation.config.job.EnvironmentUpdateJob.run (Showing top 4 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Connection c =
  • Codota IconDataSource dataSource;dataSource.getConnection()
  • Codota IconString url;DriverManager.getConnection(url)
  • Codota IconIdentityDatabaseUtil.getDBConnection()
  • Smart code suggestions by Codota
}
origin: inspectIT/inspectIT

  @Test
  public void removedAssignmentNoChange() {
    Collection<ClassType> types = Collections.singleton(classType);
    doReturn(instrumentationApplier).when(configurationResolver).getInstrumentationApplier(sensorAssignment, environment);
    doReturn(types).when(classCacheSearchNarrower).narrowByClassSensorAssignment(classCache, sensorAssignment);
    doReturn(Collections.emptyList()).when(instrumentationService).removeInstrumentationPoints(eq(types), Matchers.<Collection<IInstrumentationApplier>> any());
    doReturn(Collections.singletonList(sensorAssignment)).when(event).getRemovedSensorAssignments(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)).removeInstrumentationPoints(types, Collections.singleton(instrumentationApplier));
    verifyNoMoreInteractions(instrumentationService);
    verifyZeroInteractions(environment, agentConfiguration, eventPublisher);
  }
}
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);
}
origin: inspectIT/inspectIT

@Test
public void onlyConfigurationUpdate() throws RemoteException, BusinessException {
  job.setEnvironmentUpdateEvent(event);
  job.run();
  verify(configurationHolder, times(1)).update(updateEnvironment, PLATFORM_ID);
  verify(agentConfiguration, times(0)).setInitialInstrumentationResults(Matchers.anyMap());
  verify(agentConfiguration, times(0)).setClassCacheExistsOnCmr(Matchers.anyBoolean());
  verifyZeroInteractions(classCache, environment, classCacheSearchNarrower, agentConfiguration, instrumentationService, eventPublisher);
}
origin: inspectIT/inspectIT

@Test
public void removedAssignment() 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).removeInstrumentationPoints(eq(types), Matchers.<Collection<IInstrumentationApplier>> any());
  doReturn(Collections.singletonList(sensorAssignment)).when(event).getRemovedSensorAssignments(functionalAssignmentFactory);
  job.setEnvironmentUpdateEvent(event);
  job.run();
  verify(configurationHolder, times(1)).update(updateEnvironment, PLATFORM_ID);
  verify(instrumentationService, times(1)).removeInstrumentationPoints(types, Collections.singleton(instrumentationApplier));
  ArgumentCaptor<Collection> captor = ArgumentCaptor.forClass(Collection.class);
  Collection<IInstrumentationApplier> appliers = configurationHolder.getInstrumentationAppliers();
  verify(instrumentationService, times(1)).addInstrumentationPoints(captor.capture(), eq(agentConfiguration), eq(appliers));
  assertThat((Collection<ClassType>) captor.getValue(), hasSize(1));
  assertThat(((Collection<ClassType>) captor.getValue()).iterator().next(), is(classType));
  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.instrumentation.config.jobEnvironmentUpdateJobrun

Popular methods of EnvironmentUpdateJob

  • setAgentCacheEntry
  • setEnvironmentUpdateEvent
    Sets #environmentUpdateEvent.
  • getAgentId
  • getConfigurationHolder

Popular in Java

  • Start an intent from android
  • getContentResolver (Context)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Path (java.nio.file)
  • ArrayList (java.util)
    Resizable-array implementation of the List interface. Implements all optional list operations, and p
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
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