test.ts 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import { AcknowledgementService } from "../services/acknowledgement.service";
  2. import { StreamingService } from "./test-streamOBS";
  3. import { MessageSyncrhonizationService } from "../services/synchronization.service";
  4. import { IncomingMessageService } from "../services/incomingMessage.service";
  5. import { map, Observable } from "rxjs";
  6. import { LogSetting, MessageLog } from "../dependencies/fisloggingservice/type/datatype";
  7. import { BaseMessage } from "../dependencies/fisappmessagejsutilty/dependencies/dependencies";
  8. const incoming = new IncomingMessageService()
  9. const syncrhonize = new MessageSyncrhonizationService()
  10. const streamService = new StreamingService()
  11. /* -------------- TEST -------------------- */
  12. // change payload into Observable<BaseMessage>
  13. const payload: Observable<BaseMessage> = streamService.stream().pipe(
  14. map(dataSet => ({
  15. header: dataSet.appLogLocId,
  16. data: dataSet
  17. }))
  18. );
  19. // Configure Log Setting
  20. let storage: LogSetting = {
  21. storage: "File",
  22. setting: {
  23. appName: 'Default from client',
  24. appLocName: 'To be generated in client',
  25. logLocName: 'To be generated in client',
  26. }
  27. }
  28. let dataSet: LogSetting & { incomingObservable: Observable<BaseMessage> } = {
  29. storage: storage.storage,
  30. setting: storage.setting,
  31. customSetting: storage.customSetting,
  32. incomingObservable: payload
  33. }
  34. incoming.init(dataSet)