Add tests for "lttng list" when using the legacy agent
[lttng-ust-java-tests.git] / lttng-ust-java-tests-jul / src / test / java / org / lttng / ust / agent / integration / events / JulLegacyApiIT.java
index e8bcb9d39c7ef4f8fd8262c7c112a3c2f3bb04a3..674ca7985b9bff499d821b563a53c7f169fc4af7 100644 (file)
@@ -24,6 +24,8 @@ import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
 import java.lang.reflect.Field;
+import java.util.Arrays;
+import java.util.Collections;
 import java.util.List;
 import java.util.logging.Level;
 import java.util.logging.Logger;
@@ -165,6 +167,20 @@ public class JulLegacyApiIT {
         assertEquals(10, handler.getEventCount());
     }
 
+    /**
+     * Test that the "lttng list" commands lists the expected events.
+     */
+    @Test
+    public void testListEvents() {
+        List<String> enabledEvents = session.listEvents();
+        List<String> expectedEvents = Arrays.asList(EVENT_NAME_A, EVENT_NAME_B);
+
+        Collections.sort(enabledEvents);
+        Collections.sort(expectedEvents);
+
+        assertEquals(expectedEvents, enabledEvents);
+    }
+
     /**
      * Get the singleton JUL Handler currently managed by the LTTngAgent. It is
      * not public, so we need reflection to access it.
This page took 0.023084 seconds and 4 git commands to generate.