Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • V vadere
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 130
    • Issues 130
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 4
    • Merge requests 4
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

9.2.2023: Due to updates GitLab will be unavailable for some minutes between 9:00 and 11:00.

  • vadere
  • vadere
  • Merge requests
  • !25

Add Unit Test to Processors

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Stefan Schuhbaeck requested to merge processor_test into develop Mar 14, 2018
  • Overview 0
  • Commits 39
  • Pipelines 0
  • Changes 102

This Merge will fix #51 (closed) #53 (closed) #54 (closed)

To test a Processor a small environment mock around the simulation state is created. Each processor is called within the main loop to update its output based on the current simulation state. To test the processor in isolation a couple of simulationstate mocks (Mockito) are created. Within these mocked states only the needed data is provided to perform the tasks of the processor.

To ease the creation of tests some additional refactoring was introduced:

  • Factory Pattern for OutputFile (OutputFileFactory)
  • Factory Pattern for DataProcessor (DataProcessorFactory)
  • OutputFileMap Annotation
  • VadereWriter Interface with two implementations ( VadereStringWriter, VadereFileWriter)

Factory Pattern OutputFile/ DataProcessor

Both Classes are wrapper for the existing DynamicClassInstantiator. Additional functions within the OutputFileFactory are introduced to create OutputFiles based on the DataKey Class. 365ef142

OutputFileMap Annotation

Within the gui the creation of a list of all outputprocessors is created with reflection. This implementation created an exception (In ClassFinder.java) because the factory classes did not match the expected definition. As a hotfix this annotation was introduced to fix this issue. d7aaeb89

VadereWriter Interface

This interface allows to swap out how the collected data within a processor is persisted. The VadereFileWriter contains the standard implementation were data is written to an outputfile on the filesystem. VadereStringWriter will produce a String representation of the output which would be written to a file. The next possible implementation would be a database storage.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: processor_test

LRZ Homepage | Datenschutz | Dokumentation und Betriebsbedingungen | Impressum