@Test public void dontConvertEventWithoutTargetTokens() { EventLog log = new EventLog(); log.setName("test"); Collection<CommonSchemaLog> convertedLogs = new CommonSchemaEventLogFactory().toCommonSchemaLogs(log); assertNotNull(convertedLogs); assertEquals(0, convertedLogs.size()); }
@Override public Collection<CommonSchemaLog> toCommonSchemaLogs(Log log) { Collection<CommonSchemaLog> commonSchemaLogs = new LinkedList<>(); for (String transmissionTarget : log.getTransmissionTargetTokens()) { CommonSchemaEventLog commonSchemaEventLog = new CommonSchemaEventLog(); EventLog eventLog = (EventLog) log; PartAUtils.setName(commonSchemaEventLog, eventLog.getName()); PartAUtils.addPartAFromLog(log, commonSchemaEventLog, transmissionTarget); CommonSchemaDataUtils.addCommonSchemaData(eventLog.getTypedProperties(), commonSchemaEventLog); commonSchemaLogs.add(commonSchemaEventLog); commonSchemaEventLog.setTag(log.getTag()); } return commonSchemaLogs; }
EventLogFactory extends AbstractLogFactory { @Override public Collection<CommonSchemaLog> toCommonSchemaLogs(Log log) { Collection<CommonSchemaLog> commonSchemaLogs = new LinkedList<>(); for (String transmissionTarget : log.getTransmissionTargetTokens()) { CommonSchemaEventLog commonSchemaEventLog = new CommonSchemaEventLog(); EventLog eventLog = (EventLog) log; PartAUtils.setName(commonSchemaEventLog, eventLog.getName()); PartAUtils.addPartAFromLog(log, commonSchemaEventLog, transmissionTarget); CommonSchemaDataUtils.addCommonSchemaData(eventLog.getTypedProperties(), commonSchemaEventLog); commonSchemaLogs.add(commonSchemaEventLog); commonSchemaEventLog.setTag(log.getTag()); } return commonSchemaLogs; } }
EventLogFactory extends AbstractLogFactory { @Override public Collection<CommonSchemaLog> toCommonSchemaLogs(Log log) { Collection<CommonSchemaLog> commonSchemaLogs = new LinkedList<>(); for (String transmissionTarget : log.getTransmissionTargetTokens()) { CommonSchemaEventLog commonSchemaEventLog = new CommonSchemaEventLog(); EventLog eventLog = (EventLog) log; PartAUtils.setName(commonSchemaEventLog, eventLog.getName()); PartAUtils.addPartAFromLog(log, commonSchemaEventLog, transmissionTarget); CommonSchemaDataUtils.addCommonSchemaData(eventLog.getTypedProperties(), commonSchemaEventLog); commonSchemaLogs.add(commonSchemaEventLog); commonSchemaEventLog.setTag(log.getTag()); } return commonSchemaLogs; }  }
EventLogFactory extends AbstractLogFactory { @Override public Collection<CommonSchemaLog> toCommonSchemaLogs(Log log) { Collection<CommonSchemaLog> commonSchemaLogs = new LinkedList<>(); for (String transmissionTarget : log.getTransmissionTargetTokens()) { CommonSchemaEventLog commonSchemaEventLog = new CommonSchemaEventLog(); EventLog eventLog = (EventLog) log; PartAUtils.setName(commonSchemaEventLog, eventLog.getName()); PartAUtils.addPartAFromLog(log, commonSchemaEventLog, transmissionTarget); CommonSchemaDataUtils.addCommonSchemaData(eventLog.getTypedProperties(), commonSchemaEventLog); commonSchemaLogs.add(commonSchemaEventLog); commonSchemaEventLog.setTag(log.getTag()); } return commonSchemaLogs; }  @Override EventLog create(); @Override Collection<CommonSchemaLog> toCommonSchemaLogs(Log log); }
EventLogFactory extends AbstractLogFactory { @Override public Collection<CommonSchemaLog> toCommonSchemaLogs(Log log) { Collection<CommonSchemaLog> commonSchemaLogs = new LinkedList<>(); for (String transmissionTarget : log.getTransmissionTargetTokens()) { CommonSchemaEventLog commonSchemaEventLog = new CommonSchemaEventLog(); EventLog eventLog = (EventLog) log; PartAUtils.setName(commonSchemaEventLog, eventLog.getName()); PartAUtils.addPartAFromLog(log, commonSchemaEventLog, transmissionTarget); CommonSchemaDataUtils.addCommonSchemaData(eventLog.getTypedProperties(), commonSchemaEventLog); commonSchemaLogs.add(commonSchemaEventLog); commonSchemaEventLog.setTag(log.getTag()); } return commonSchemaLogs; }  @Override EventLog create(); @Override Collection<CommonSchemaLog> toCommonSchemaLogs(Log log);  }