File tree Expand file tree Collapse file tree 3 files changed +6
-9
lines changed
jmx-scraper/src/integrationTest/java/io/opentelemetry/contrib/jmxscraper Expand file tree Collapse file tree 3 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ private static void testConnector(ConnectorSupplier connectorSupplier) {
7676 .satisfies (
7777 connection -> {
7878 try {
79- ObjectName name = new ObjectName (TestApp . OBJECT_NAME );
79+ ObjectName name = new ObjectName ("io.opentelemetry.test:name=TestApp" );
8080 Object value = connection .getAttribute (name , "IntValue" );
8181 assertThat (value ).isEqualTo (42 );
8282 } catch (Exception e ) {
Original file line number Diff line number Diff line change 99import javax .management .MBeanServer ;
1010import javax .management .ObjectName ;
1111
12- @ SuppressWarnings ("all" )
1312public class TestApp implements TestAppMXBean {
1413
15- public static final String APP_STARTED_MSG = "app started" ;
16- public static final String OBJECT_NAME = "io.opentelemetry.test:name=TestApp" ;
17-
1814 private volatile boolean running ;
1915
16+ @ SuppressWarnings ("BusyWait" )
2017 public static void main (String [] args ) {
2118 TestApp app = TestApp .start ();
2219 while (app .isRunning ()) {
@@ -34,13 +31,13 @@ static TestApp start() {
3431 TestApp app = new TestApp ();
3532 MBeanServer mbs = ManagementFactory .getPlatformMBeanServer ();
3633 try {
37- ObjectName objectName = new ObjectName (OBJECT_NAME );
34+ ObjectName objectName = new ObjectName ("io.opentelemetry.test:name=TestApp" );
3835 mbs .registerMBean (app , objectName );
3936 } catch (Exception e ) {
4037 throw new RuntimeException (e );
4138 }
4239 app .running = true ;
43- System .out .println (APP_STARTED_MSG );
40+ System .out .println ("app started" );
4441 return app ;
4542 }
4643
Original file line number Diff line number Diff line change 2121import org .testcontainers .shaded .com .google .errorprone .annotations .CanIgnoreReturnValue ;
2222import org .testcontainers .utility .MountableFile ;
2323
24- /** Test container that allows to execute {@link TestApp} in an isolated container */
24+ /** Test container that allows to execute TestApp in an isolated container */
2525public class TestAppContainer extends GenericContainer <TestAppContainer > {
2626
2727 private final Map <String , String > properties ;
@@ -38,7 +38,7 @@ public TestAppContainer() {
3838
3939 this .withCopyFileToContainer (MountableFile .forHostPath (appJar ), "/app.jar" )
4040 .waitingFor (
41- Wait .forLogMessage (TestApp . APP_STARTED_MSG + " \\ n" , 1 )
41+ Wait .forLogMessage ("app started \\ n" , 1 )
4242 .withStartupTimeout (Duration .ofSeconds (5 )))
4343 .withCommand ("java" , "-jar" , "/app.jar" );
4444 }
You can’t perform that action at this time.
0 commit comments