Search in sources :

Example 6 with IOState

use of org.graylog2.plugin.IOState in project graylog2-server by Graylog2.

the class IOStateTest method testNotEqualIfDifferentState.

@Test
public void testNotEqualIfDifferentState() throws Exception {
    EventBus eventBus = mock(EventBus.class);
    MessageInput messageInput = mock(MessageInput.class);
    IOState<MessageInput> inputState1 = new IOState<>(eventBus, messageInput, IOState.Type.RUNNING);
    IOState<MessageInput> inputState2 = new IOState<>(eventBus, messageInput, IOState.Type.STOPPED);
    assertTrue(inputState1.equals(inputState2));
    assertTrue(inputState2.equals(inputState1));
}
Also used : IOState(org.graylog2.plugin.IOState) EventBus(com.google.common.eventbus.EventBus) Test(org.junit.Test)

Example 7 with IOState

use of org.graylog2.plugin.IOState in project graylog2-server by Graylog2.

the class IOStateTest method testEqualsSameState.

@Test
public void testEqualsSameState() throws Exception {
    EventBus eventBus = mock(EventBus.class);
    MessageInput messageInput = mock(MessageInput.class);
    IOState<MessageInput> inputState1 = new IOState<>(eventBus, messageInput, IOState.Type.RUNNING);
    IOState<MessageInput> inputState2 = new IOState<>(eventBus, messageInput, IOState.Type.RUNNING);
    assertTrue(inputState1.equals(inputState2));
    assertTrue(inputState2.equals(inputState1));
}
Also used : IOState(org.graylog2.plugin.IOState) EventBus(com.google.common.eventbus.EventBus) Test(org.junit.Test)

Aggregations

MessageInput (org.graylog2.plugin.inputs.MessageInput)4 EventBus (com.google.common.eventbus.EventBus)3 IOState (org.graylog2.plugin.IOState)3 Test (org.junit.Test)3 Subscribe (com.google.common.eventbus.Subscribe)2 Stopwatch (com.google.common.base.Stopwatch)1 NotFoundException (org.graylog2.database.NotFoundException)1 Notification (org.graylog2.notifications.Notification)1 InputRegistry (org.graylog2.shared.inputs.InputRegistry)1 NoSuchInputTypeException (org.graylog2.shared.inputs.NoSuchInputTypeException)1 Activity (org.graylog2.shared.system.activities.Activity)1