Class JsonSuiteMarshaller

  • All Implemented Interfaces:
    org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean

    @Component
    @Lazy
    @Conditional(JsonSuiteMarshallerRequestedCondition.class)
    public class JsonSuiteMarshaller
    extends java.lang.Object
    implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected guru.qas.martini.runtime.event.json.FeatureSerializer featureSerializer  
      protected com.google.gson.Gson gson  
      protected guru.qas.martini.runtime.event.json.HostSerializer hostSerializer  
      protected com.google.gson.stream.JsonWriter jsonWriter  
      protected static org.slf4j.Logger LOGGER  
      protected guru.qas.martini.runtime.event.json.MartiniResultSerializer martiniResultSerializer  
      protected com.google.common.util.concurrent.Monitor monitor  
      protected org.springframework.core.io.WritableResource outputResource  
      protected java.io.OutputStream outputStream  
      protected java.util.HashSet<guru.qas.martini.gherkin.FeatureWrapper> serializedFeatures  
      protected guru.qas.martini.runtime.event.json.StepImplementationSerializer stepImplementationSerializer  
      protected guru.qas.martini.runtime.event.json.StepResultSerializer stepResultSerializer  
      protected guru.qas.martini.runtime.event.json.SuiteIdentifierSerializer suiteIdentifierSerializer  
    • Constructor Summary

      Constructors 
      Constructor Description
      JsonSuiteMarshaller​(org.springframework.core.io.WritableResource outputResource, guru.qas.martini.runtime.event.json.MartiniResultSerializer martiniResultSerializer, guru.qas.martini.runtime.event.json.SuiteIdentifierSerializer suiteIdentifierSerializer, guru.qas.martini.runtime.event.json.FeatureSerializer featureSerializer, guru.qas.martini.runtime.event.json.StepResultSerializer stepResultSerializer, guru.qas.martini.runtime.event.json.StepImplementationSerializer stepImplementationSerializer, guru.qas.martini.runtime.event.json.HostSerializer hostSerializer)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void afterPropertiesSet()  
      protected void closeOutputStream()  
      void destroy()  
      protected com.google.gson.GsonBuilder getGsonBuilder()  
      void handle​(guru.qas.martini.event.AfterSuiteEvent ignored)  
      void handle​(guru.qas.martini.event.BeforeSuiteEvent event)  
      void handleAfterScenarioEvent​(guru.qas.martini.event.AfterScenarioEvent event)  
      protected void registerTypeAdapters​(com.google.gson.GsonBuilder builder)  
      protected void serialize​(guru.qas.martini.event.SuiteIdentifier identifier)  
      protected void serialize​(guru.qas.martini.gherkin.FeatureWrapper feature)  
      protected void serialize​(guru.qas.martini.result.MartiniResult result)  
      protected void serializeFeature​(guru.qas.martini.result.MartiniResult result)  
      • Methods inherited from class java.lang.Object

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

      • LOGGER

        protected static final org.slf4j.Logger LOGGER
      • outputResource

        protected final org.springframework.core.io.WritableResource outputResource
      • martiniResultSerializer

        protected final guru.qas.martini.runtime.event.json.MartiniResultSerializer martiniResultSerializer
      • suiteIdentifierSerializer

        protected final guru.qas.martini.runtime.event.json.SuiteIdentifierSerializer suiteIdentifierSerializer
      • featureSerializer

        protected final guru.qas.martini.runtime.event.json.FeatureSerializer featureSerializer
      • stepResultSerializer

        protected final guru.qas.martini.runtime.event.json.StepResultSerializer stepResultSerializer
      • stepImplementationSerializer

        protected final guru.qas.martini.runtime.event.json.StepImplementationSerializer stepImplementationSerializer
      • hostSerializer

        protected final guru.qas.martini.runtime.event.json.HostSerializer hostSerializer
      • monitor

        protected final com.google.common.util.concurrent.Monitor monitor
      • outputStream

        protected java.io.OutputStream outputStream
      • jsonWriter

        protected com.google.gson.stream.JsonWriter jsonWriter
      • gson

        protected com.google.gson.Gson gson
      • serializedFeatures

        protected java.util.HashSet<guru.qas.martini.gherkin.FeatureWrapper> serializedFeatures
    • Constructor Detail

      • JsonSuiteMarshaller

        @Autowired
        public JsonSuiteMarshaller​(@Qualifier("jsonOutputResource")
                                   org.springframework.core.io.WritableResource outputResource,
                                   guru.qas.martini.runtime.event.json.MartiniResultSerializer martiniResultSerializer,
                                   guru.qas.martini.runtime.event.json.SuiteIdentifierSerializer suiteIdentifierSerializer,
                                   guru.qas.martini.runtime.event.json.FeatureSerializer featureSerializer,
                                   guru.qas.martini.runtime.event.json.StepResultSerializer stepResultSerializer,
                                   guru.qas.martini.runtime.event.json.StepImplementationSerializer stepImplementationSerializer,
                                   guru.qas.martini.runtime.event.json.HostSerializer hostSerializer)
    • Method Detail

      • afterPropertiesSet

        @Conditional(JsonSuiteMarshallerRequestedCondition.class)
        public void afterPropertiesSet()
                                throws java.lang.Exception
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Throws:
        java.lang.Exception
      • getGsonBuilder

        protected com.google.gson.GsonBuilder getGsonBuilder()
      • registerTypeAdapters

        protected void registerTypeAdapters​(com.google.gson.GsonBuilder builder)
      • serialize

        protected void serialize​(guru.qas.martini.event.SuiteIdentifier identifier)
      • serializeFeature

        protected void serializeFeature​(guru.qas.martini.result.MartiniResult result)
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • serialize

        protected void serialize​(guru.qas.martini.gherkin.FeatureWrapper feature)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • serialize

        protected void serialize​(guru.qas.martini.result.MartiniResult result)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • closeOutputStream

        protected void closeOutputStream()
      • destroy

        public void destroy()
        Specified by:
        destroy in interface org.springframework.beans.factory.DisposableBean