void (@NotNull final ServiceMessage msg) { final String name = msg.getMessageName(); if (LOG.isDebugEnabled()) { LOG.debug(msg.asString()); } switch (name) { case TESTING_STARTED -> { // Since a test reporter may not emit "testingStarted"/"testingFinished" events, // startTesting() is already invoked before starting processing messages. if (!myFirstTestingStartedEvent) { setupProcessor(); startTesting(); } myFirstTestingStartedEvent = false; } case TESTING_FINISHED -> finishTesting(); case KEY_TESTS_COUNT -> processTestCountInSuite(msg); case CUSTOM_STATUS -> processCustomStatus(msg); case MESSAGE -> { final Map<String, String> msgAttrs = msg.getAttributes(); final String text = msgAttrs.get(ATTR_KEY_TEXT); if (!StringUtil.isEmpty(text)) { // some other text // we cannot pass output type here but it is a service message // let's think that is was stdout fireOnUncapturedOutput(text, ProcessOutputTypes.STDOUT); } } case TEST_REPORTER_ATTACHED -> fireOnTestFrameworkAttached(TestDurationStrategyKt.getDurationStrategy(msg.getAttributes().get("durationStrategy"))); case SUITE_TREE_STARTED -> fireOnSuiteTreeStarted(msg.getAttributes().get("name"), msg.getAttributes().get(ATTR_KEY_LOCATION_URL), BaseStartedNodeEvent.getMetainfo(msg), TreeNodeEvent.getNodeId(msg), msg.getAttributes().get("parentNodeId")); case SUITE_TREE_ENDED -> fireOnSuiteTreeEnded(msg.getAttributes().get("name")); case SUITE_TREE_NODE -> fireOnSuiteTreeNodeAdded(msg.getAttributes().get("name"), msg.getAttributes().get(ATTR_KEY_LOCATION_URL), BaseStartedNodeEvent.getMetainfo(msg), TreeNodeEvent.getNodeId(msg), msg.getAttributes().get("parentNodeId")); case BUILD_TREE_ENDED_NODE -> fireOnBuildTreeEnded(); case ROOT_PRESENTATION -> { final Map<String, String> attributes = msg.getAttributes(); fireRootPresentationAdded(attributes.get("name"), attributes.get("comment"), attributes.get("location")); } case SET_NODE_PROPERTY -> { final NodePropertyKey propertyKey = TestSetNodePropertyEvent.getPropertyKey(msg); final String propertyValue = TestSetNodePropertyEvent.getPropertyValue(msg); if (propertyKey == null) { logProblem(LOG, "Missing/Unknown property key: " + msg.asString(), myTestFrameworkName); } else { fireSetNodeProperty(new TestSetNodePropertyEvent(TreeNodeEvent.getNodeId(msg), propertyKey, propertyValue)); } } default -> { logProblem(LOG, "Unexpected service message:" + name, myTestFrameworkName); fireOnUncapturedOutput(msg.asString() + "\n", ProcessOutputTypes.STDOUT); } } }