Class KodexRestServiceTest


  • public class KodexRestServiceTest
    extends java.lang.Object
    Tests the KODEX local server. The utilized REST framework is just for testing, no production use!
    Author:
    Marcel Nöhre
    • 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.KodexRestService<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 testKodexRestService()
      Tests the KODEX local server.
      void testMultiKodexRestService()
      Tests MultiKodexRestService.
      • 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

      • KodexRestServiceTest

        public KodexRestServiceTest()
    • 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.KodexRestService<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
      • testKodexRestService

        public void testKodexRestService()
                                  throws java.io.IOException,
                                         java.util.concurrent.ExecutionException
        Tests the KODEX local server.
        Throws:
        java.io.IOException - if reading test data fails, shall not occur
        java.util.concurrent.ExecutionException - shall not occur
      • testMultiKodexRestService

        public void testMultiKodexRestService()
                                       throws java.util.concurrent.ExecutionException
        Tests MultiKodexRestService.
        Throws:
        java.util.concurrent.ExecutionException - shall not occur