Process TestSuiteFinishedEvent. Using event.getUid() to access testSuite.
Then remove this suite from storage and marshal testSuite to xml using
AllureResultsUtils.writeTestSuiteResult()

@param event to process
333081
public void fire(TestSuiteFinishedEvent event) {
        String suiteUid = event.getUid();

        TestSuiteResult testSuite = testSuiteStorage.remove(suiteUid);
        if (testSuite == null) {
            return;
        }
        event.process(testSuite);

        testSuite.setVersion(getVersion());
        testSuite.getLabels().add(AllureModelUtils.createProgrammingLanguageLabel());

        writeTestSuiteResult(testSuite);

        notifier.fire(event);
    }
241191
@Subscribe
  public void onSuiteResult(AggregatedSuiteResultEvent e) {
    long millis = e.getExecutionTime();
    String suiteName = e.getDescription().getDisplayName();
    
    List<Long> values = hints.get(suiteName);
    if (values == null) {
      hints.put(suiteName, values = new ArrayList<>());
    }
    values.add(millis);
    while (values.size() > historyLength)
      values.remove(0);
  }
709268
@Override
    public void configurationEvent(ConfigurationEvent event) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "ConfigurationEvent:" + event.getType() + " pid=" + event.getPid() + " event:" + event);
        }
        if (event.getType() != ConfigurationEvent.CM_DELETED && pids.contains(event.getPid())) {
            processRolePids();
        }
    }
1256314
@Override
    public void processEvent(ListenerEvent event, SequenceVectors<T> sequenceVectors, long argument) {
        try {
            locker.acquire();

            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");

            StringBuilder builder = new StringBuilder(targetFolder.getAbsolutePath());
            builder.append("/").append(modelPrefix).append("_").append(sdf.format(new Date())).append(".seqvec");
            File targetFile = new File(builder.toString());

            if (useBinarySerialization) {
                SerializationUtils.saveObject(sequenceVectors, targetFile);
            } else {
                throw new UnsupportedOperationException("Not implemented yet");
            }

        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            locker.release();
        }
    }
1324561
@SuppressWarnings("unchecked")
   @CacheEntryModified
   public void cacheEntryModified(CacheEntryModifiedEvent<Serializable, Object> event)
   {
      if (!event.isPre() && event.getKey().equals(namesKey))
      {
         Set<String> set = (Set<String>)event.getValue();
         if (set != null)
         {
            refreshIndexes(set);
         }
      }
   }
58397
@Override
  public void parseProcess(Element processElement, ProcessDefinitionEntity processDefinition) {
    addStartEventListener(processDefinition);
    addEndEventListener(processDefinition);
  }
1238458
@Override
	public AuditFileWriter write(String event) {

		String str2 = event + CoreConstants.NEW_LINE;
		out.put(str2.getBytes(Charset.forName("UTF-8")));
		return this;
	}
590664
@Override
    public Source execute(Document testRunArgs) {
        RuntimeOptions runOpts = extractTestRunArguments(testRunArgs);
        runOpts.setLogDir(new File(System.getProperty("java.io.tmpdir")));
        if (null == runOpts.getSessionId()) {
            runOpts.setSessionId(UUID.randomUUID().toString());
        }
        String suiteName = null;
        try {
            Index masterIndex = Generator.generateXsl(this.setupOpts);
            SuiteEntry se = null;
            if (suiteName == null) {
              Iterator<String> it = masterIndex.getSuiteKeys().iterator();
              if (!it.hasNext()) {
                throw new Exception("Error: No suites in sources.");
              }
              se = masterIndex.getSuite(it.next());
            }
            suiteName = se.getTitle();
            TEClassLoader defaultLoader = new TEClassLoader(null);
            Engine engine = new Engine(masterIndex,
                    setupOpts.getSourcesName(), defaultLoader);
            TECore ctlRunner = new TECore(engine, masterIndex, runOpts);

            ctlRunner.execute();
        } catch (Exception ex) {
            Logger.getLogger(getClass().getName()).log(Level.SEVERE,
                    "Failed to execute test suite.", ex);
            throw new RuntimeException(ex);
        }
        File resultsDir = new File(runOpts.getLogDir(), runOpts.getSessionId());
        File testLog = new File(resultsDir, "report_logs.xml");
        
        CtlEarlReporter report = new CtlEarlReporter();
        try{
        	report.generateEarlReport (resultsDir, testLog, suiteName, this.testInputs);
        }  catch (IOException iox) {
            throw new RuntimeException("Failed to serialize EARL results to " + resultsDir.getAbsolutePath(), iox);
        }
        // NOTE: Final result should be transformed to EARL report (RDF/XML)
        // resolve xinclude directives in CTL results
        DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
        docFactory.setNamespaceAware(true);
        docFactory.setXIncludeAware(true);
        Source results = null;
        try {
            File resultsFile = getResultsFile(getPreferredMediaType(testRunArgs), resultsDir.toString());
            if(getPreferredMediaType(testRunArgs).endsWith("zip")){
              InputStream inStream = new FileInputStream(resultsFile);
              InputSource inSource = new InputSource(new InputStreamReader(inStream, StandardCharsets.UTF_8));
              results = new SAXSource(inSource);
              results.setSystemId(resultsFile.toURI().toString());
              } else {
              	Document resultsDoc = docFactory.newDocumentBuilder().parse(resultsFile);
              	results = new DOMSource(resultsDoc, resultsFile.toURI().toString());
              }
        } catch (IOException | SAXException | ParserConfigurationException e) {
            throw new RuntimeException(e);
        }
        Logger.getLogger(getClass().getName()).log(Level.INFO,
                "Test results: {0}", results.getSystemId());
        return results;
    }
1285796
public void handleEvent(Event event) {
        String topic = event.getTopic();
        if (topic.equals(TOPIC_QUEUED_WORK_NAME)) {
            Runnable r = event.getProperty(KEY_RUNNABLE, Runnable.class);
            if (null != r) {
                r.run();
            } else {
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                    Tr.event(tc, "Unable to find runnable in event; " + topic);
                }
            }
        }
    }
283136
@Override
	public void processEvent(SystemEvent event) throws AbortProcessingException {
		if (!FacesContext.getCurrentInstance().isPostback()) {
			// if (!(getParent() instanceof Column)) {
			insertLabelBeforeThisInputField();
			insertMessageBehindThisInputField();
		}
		// }
	}
1053566
@Override
    public void configurationEvent(ConfigurationEvent event) {
        if (event.getType() == ConfigurationEvent.CM_UPDATED && pids.contains(event.getPid())) {
            populateDestinationPermissions();
            runtimeSecurityService.modifyMessagingServices(this);
        }

    }
815161
@Override
    public void add(Event event) {
        if (getNumStoredEvents() >= maxEvents) {
            logger.warn("Not adding Event because at least "
                + Integer.toString(maxEvents) + " events are already stored: " + event.getId());
            return;
        }

        File eventFile = new File(bufferDir.getAbsolutePath(), event.getId().toString() + FILE_SUFFIX);
        if (eventFile.exists()) {
            logger.trace("Not adding Event to offline storage because it already exists: "
                + eventFile.getAbsolutePath());
            return;
        } else {
            logger.debug("Adding Event to offline storage: " + eventFile.getAbsolutePath());
        }

        try (FileOutputStream fileOutputStream = new FileOutputStream(eventFile);
             ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream)) {
            objectOutputStream.writeObject(event);
        } catch (Exception e) {
            logger.error("Error writing Event to offline storage: " + event.getId(), e);
        }

        logger.debug(Integer.toString(getNumStoredEvents())
            + " stored events are now in dir: "
            + bufferDir.getAbsolutePath());
    }
197538
protected void processEvent (DEvent event)
    {
        // look up the target object
        DObject target = _objects.get(event.getTargetOid());
        if (target == null) {
            log.debug("Event target no longer exists", "event", event);
            return;
        }

        // check the event's permissions
        if (!target.checkPermissions(event)) {
            log.warning("Event failed permissions check", "event", event, "target", target);
            return;
        }

        if (dispatchEvent(event, target)) {
            // unless requested not to, notify any proxies
            target.notifyProxies(event);
        }
    }
752805
@SuppressWarnings("PMD.SwitchStmtsShouldHaveDefault")
  public void dispatch(@NonNull JCacheEntryEvent<K, V> event) {
    try {
      if (event.getSource().isClosed()) {
        return;
      }
      switch (event.getEventType()) {
        case CREATED:
          onCreated(event);
          return;
        case UPDATED:
          onUpdated(event);
          return;
        case REMOVED:
          onRemoved(event);
          return;
        case EXPIRED:
          onExpired(event);
          return;
      }
      throw new IllegalStateException("Unknown event type: " + event.getEventType());
    } catch (Exception e) {
      logger.log(Level.WARNING, null, e);
    } catch (Throwable t) {
      logger.log(Level.SEVERE, null, t);
    }
  }
232549
private void invokeMethods(Event event) {
        try {
            List<MethodWrapper> methodWrappers = eventToMethodsMap.get(event.getType().name().toUpperCase());
            if (methodWrappers == null) return;

            methodWrappers = new ArrayList<>(methodWrappers);
            MethodWrapper matchedMethod =
                    getMethodWithMatchingPatternAndFilterUnmatchedMethods(getPatternFromEventType(event), methodWrappers);
            if (matchedMethod != null) {
                methodWrappers = new ArrayList<>();
                methodWrappers.add(matchedMethod);
            }

            for (MethodWrapper methodWrapper : methodWrappers) {
                Method method = methodWrapper.getMethod();
                if (Arrays.asList(method.getParameterTypes()).contains(Matcher.class)) {
                    method.invoke(this, event, methodWrapper.getMatcher());
                } else {
                    method.invoke(this, event);
                }
            }
        } catch (Exception e) {
            logger.error("Error invoking controller: ", e);
        }
    }
150688
@MainThread
    private void handleEventResult(Event event, EventResult result) {
        if (!activeEvents.contains(event)) {
            Utils.logE(event.getKey(), "Cannot send result of finished event");
            return;
        }

        scheduleResultCallbacks(event, result);
        executeTasks(false);
    }
986797
@Override
    public AuditEventOutputStream write(AuditEvent event) {
        if (LifeCycleContext.getInstance().getStatus().equals(RunStatus.RUNNING)) {
            try {
                ValidationManager.validateEvent(event);
                if (configContext.getFilters().isEmpty() || filterAccepts(event)) {
                    outputStream.write(event);
                }
            } catch (ValidationException e) {

            }
        }
        return this;
    }