use of com.google.common.eventbus.EventBus in project graylog2-server by Graylog2.
the class KafkaJournalTest method setUp.
@Before
public void setUp() throws IOException {
scheduler = new ScheduledThreadPoolExecutor(1);
scheduler.prestartCoreThread();
journalDirectory = temporaryFolder.newFolder();
final File nodeId = temporaryFolder.newFile("node-id");
Files.write(UUID.randomUUID().toString(), nodeId, StandardCharsets.UTF_8);
final Configuration configuration = new Configuration() {
@Override
public String getNodeIdFile() {
return nodeId.getAbsolutePath();
}
};
serverStatus = new ServerStatus(configuration, EnumSet.of(ServerStatus.Capability.MASTER), new EventBus("KafkaJournalTest"), NullAuditEventSender::new);
}
use of com.google.common.eventbus.EventBus 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));
}
use of com.google.common.eventbus.EventBus 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));
}
use of com.google.common.eventbus.EventBus in project SmartCity-Market by TechnionYP5777.
the class BarcodeEventHandler method initializeHandler.
@Override
public void initializeHandler() throws IOException {
this.scannerSocket = new ServerSocket(BARCODE_SCANNER_DEFAULT_PORT, backlog);
eventBus = new EventBus();
}
Aggregations