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 acknowledge = new AcknowledgementService()
  10. const syncrhonize = new MessageSyncrhonizationService()
  11. const streamService = new StreamingService()
  12. /* -------------- TEST -------------------- */
  13. // change payload into Observable<BaseMessage>
  14. const payload: Observable<BaseMessage> = streamService.stream();
  15. // Configure Log Setting
  16. let storage: LogSetting = {
  17. storage: "File",
  18. setting: {
  19. appName: 'Default from client',
  20. appLocName: 'To be generated in client',
  21. logLocName: 'To be generated in client',
  22. }
  23. }
  24. let dataSet: LogSetting & { incomingObservable: Observable<BaseMessage> } = {
  25. storage: storage.storage,
  26. setting: storage.setting,
  27. customSetting: storage.customSetting,
  28. incomingObservable: payload
  29. }
  30. incoming.init(dataSet)
  31. acknowledge.init(storage).then(() => {
  32. acknowledge.subscribe(dataSet.incomingObservable)
  33. })