summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
8f21b7d)
Highlights a bug in current master.
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
import static org.junit.Assert.fail;
import java.lang.reflect.Field;
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;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
assertEquals(10, handler.getEventCount());
}
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.
/**
* Get the singleton JUL Handler currently managed by the LTTngAgent. It is
* not public, so we need reflection to access it.
import static org.junit.Assert.fail;
import java.lang.reflect.Field;
import static org.junit.Assert.fail;
import java.lang.reflect.Field;
+import java.util.Arrays;
+import java.util.Collections;
import java.util.List;
import org.apache.log4j.Level;
import java.util.List;
import org.apache.log4j.Level;
assertEquals(10, handler.getEventCount());
}
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 Log4j Handler currently managed by the LTTngAgent. It
* is not public, so we need reflection to access it.
/**
* Get the singleton Log4j Handler currently managed by the LTTngAgent. It
* is not public, so we need reflection to access it.