Class JsonSuiteMarshaller
- java.lang.Object
-
- guru.qas.martini.spring.standalone.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.FeatureSerializerfeatureSerializerprotected com.google.gson.Gsongsonprotected guru.qas.martini.runtime.event.json.HostSerializerhostSerializerprotected com.google.gson.stream.JsonWriterjsonWriterprotected static org.slf4j.LoggerLOGGERprotected guru.qas.martini.runtime.event.json.MartiniResultSerializermartiniResultSerializerprotected com.google.common.util.concurrent.Monitormonitorprotected org.springframework.core.io.WritableResourceoutputResourceprotected java.io.OutputStreamoutputStreamprotected java.util.HashSet<guru.qas.martini.gherkin.FeatureWrapper>serializedFeaturesprotected guru.qas.martini.runtime.event.json.StepImplementationSerializerstepImplementationSerializerprotected guru.qas.martini.runtime.event.json.StepResultSerializerstepResultSerializerprotected guru.qas.martini.runtime.event.json.SuiteIdentifierSerializersuiteIdentifierSerializer
-
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 voidafterPropertiesSet()protected voidcloseOutputStream()voiddestroy()protected com.google.gson.GsonBuildergetGsonBuilder()voidhandle(guru.qas.martini.event.AfterSuiteEvent ignored)voidhandle(guru.qas.martini.event.BeforeSuiteEvent event)voidhandleAfterScenarioEvent(guru.qas.martini.event.AfterScenarioEvent event)protected voidregisterTypeAdapters(com.google.gson.GsonBuilder builder)protected voidserialize(guru.qas.martini.event.SuiteIdentifier identifier)protected voidserialize(guru.qas.martini.gherkin.FeatureWrapper feature)protected voidserialize(guru.qas.martini.result.MartiniResult result)protected voidserializeFeature(guru.qas.martini.result.MartiniResult result)
-
-
-
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:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
java.lang.Exception
-
getGsonBuilder
protected com.google.gson.GsonBuilder getGsonBuilder()
-
registerTypeAdapters
protected void registerTypeAdapters(com.google.gson.GsonBuilder builder)
-
handle
@EventListener @Conditional(JsonSuiteMarshallerRequestedCondition.class) public void handle(guru.qas.martini.event.BeforeSuiteEvent event)
-
serialize
protected void serialize(guru.qas.martini.event.SuiteIdentifier identifier)
-
handleAfterScenarioEvent
@EventListener @Conditional(JsonSuiteMarshallerRequestedCondition.class) public void handleAfterScenarioEvent(guru.qas.martini.event.AfterScenarioEvent event)
-
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
-
handle
@EventListener @Conditional(JsonSuiteMarshallerRequestedCondition.class) public void handle(guru.qas.martini.event.AfterSuiteEvent ignored)
-
closeOutputStream
protected void closeOutputStream()
-
destroy
public void destroy()
- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean
-
-