Class KodexServiceTest


  • public class KodexServiceTest
    extends java.lang.Object
    Tests the KODEX service. The utilized JSON framework is just for testing, no production use!
    Author:
    Holger Eichelberger, SSE
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private long count  
      private long endTime  
      private static boolean measure  
      private java.util.ArrayList<java.lang.Long[]> runtime  
      private long startTime  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private long calcRuntime()
      Calculate the runtime.
      private void createExcelFile​(java.util.ArrayList<java.lang.Long[]> runtimeList)
      Save runtime results as excel-file.
      private long getCount()
      Returns counter of the tuple.
      private long getEndTime()
      Returns the end time of the service.
      private long getStartTime()
      Returns the start time of the service.
      private static void process​(de.iip_ecosphere.platform.security.services.kodex.KodexService<InData,​OutData> service, InData data)
      Processes data on service and logs the sent input.
      private void setCount​(long newCount)
      Set the new count of the tuple.
      private void setEndTime​(long end)
      Set the new end time of the service.
      private void setStartTime​(long start)
      Set the start time of the service.
      void testKodexService()
      Tests the KODEX service.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • measure

        private static boolean measure
      • startTime

        private long startTime
      • endTime

        private long endTime
      • count

        private long count
      • runtime

        private java.util.ArrayList<java.lang.Long[]> runtime
    • Constructor Detail

      • KodexServiceTest

        public KodexServiceTest()
    • Method Detail

      • setStartTime

        private void setStartTime​(long start)
        Set the start time of the service.
        Parameters:
        start - the start time
      • setEndTime

        private void setEndTime​(long end)
        Set the new end time of the service.
        Parameters:
        end - the end time
      • setCount

        private void setCount​(long newCount)
        Set the new count of the tuple.
        Parameters:
        newCount - the count value
      • getStartTime

        private long getStartTime()
        Returns the start time of the service.
        Returns:
        startTime
      • getEndTime

        private long getEndTime()
        Returns the end time of the service.
        Returns:
        endTime
      • getCount

        private long getCount()
        Returns counter of the tuple.
        Returns:
        endTime
      • calcRuntime

        private long calcRuntime()
        Calculate the runtime.
        Returns:
        the runtime
      • createExcelFile

        private void createExcelFile​(java.util.ArrayList<java.lang.Long[]> runtimeList)
                              throws java.io.IOException
        Save runtime results as excel-file.
        Parameters:
        runtimeList - list of runtime measures
        Throws:
        java.io.IOException - if creating the file fails
      • process

        private static void process​(de.iip_ecosphere.platform.security.services.kodex.KodexService<InData,​OutData> service,
                                    InData data)
                             throws java.io.IOException
        Processes data on service and logs the sent input.
        Parameters:
        service - the service instance
        data - the input data
        Throws:
        java.io.IOException - if processing/serializing the input data fails
      • testKodexService

        public void testKodexService()
                              throws java.io.IOException,
                                     java.util.concurrent.ExecutionException
        Tests the KODEX service.
        Throws:
        java.util.concurrent.ExecutionException - in case of service execution failures
        java.io.IOException - in case of I/O related problems