Package com.indeed.proctor.common
Class AbstractJsonProctorLoader
- java.lang.Object
-
- java.util.TimerTask
-
- com.indeed.util.core.DataLoadingTimerTask
-
- com.indeed.proctor.common.AbstractProctorLoader
-
- com.indeed.proctor.common.AbstractJsonProctorLoader
-
- All Implemented Interfaces:
com.google.common.base.Supplier<Proctor>,com.indeed.util.core.HasDataLoadingVariables,java.lang.Runnable
- Direct Known Subclasses:
ClasspathProctorLoader,FileProctorLoader,StringProctorLoader,UrlProctorLoader
public abstract class AbstractJsonProctorLoader extends AbstractProctorLoader
parses a Json source as TestMatrixArtifact
-
-
Field Summary
-
Fields inherited from class com.indeed.proctor.common.AbstractProctorLoader
dynamicFilters, requiredTests, VAR_EXPORTER
-
-
Constructor Summary
Constructors Constructor Description AbstractJsonProctorLoader(java.lang.Class<?> cls, ProctorSpecification specification, javax.el.FunctionMapper functionMapper)AbstractJsonProctorLoader(java.lang.Class<?> cls, ProctorSpecification specification, javax.el.FunctionMapper functionMapper, IdentifierValidator identifierValidator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Map<java.lang.String,ConsumableTestDefinition>extractReferencedTests(com.fasterxml.jackson.core.JsonParser jsonParser)protected booleanisTestReferenced(java.lang.String testName, ConsumableTestDefinition testDefinition)protected TestMatrixArtifactloadJsonTestMatrix(java.io.Reader reader)Load a part of test matrix json file as TestMatrixArtifact.-
Methods inherited from class com.indeed.proctor.common.AbstractProctorLoader
addLoadReporter, addLoadReporter, createProvidedContext, doLoad, exportDynamicTests, get, getLastAudit, getLastLoadErrorMessage, getLoggedDynamicTests, getProctorResultReporter, getRuleVerificationContext, isLoadedDataSuccessfullyRecently, load, logDynamicTests, setDiffReporter
-
-
-
-
Constructor Detail
-
AbstractJsonProctorLoader
public AbstractJsonProctorLoader(@Nonnull java.lang.Class<?> cls, @Nonnull ProctorSpecification specification, @Nonnull javax.el.FunctionMapper functionMapper)
-
AbstractJsonProctorLoader
public AbstractJsonProctorLoader(@Nonnull java.lang.Class<?> cls, @Nonnull ProctorSpecification specification, @Nonnull javax.el.FunctionMapper functionMapper, @Nonnull IdentifierValidator identifierValidator)
-
-
Method Detail
-
loadJsonTestMatrix
@CheckForNull protected TestMatrixArtifact loadJsonTestMatrix(@Nonnull java.io.Reader reader) throws java.io.IOException, TestMatrixOutdatedException
Load a part of test matrix json file as TestMatrixArtifact. Parsed test matrix json has the following structure: { "audit": { ... // audit fields }, "tests": { "test1": { ... // test definition fields }, "test2": { ... }, ... } }. The value for "tests" includes all of proctor tests, so it is very huge. In order to avoid big memory footprints, this method only loads referenced tests, which are determined by requiredTests and dynamicFilters, by iterating over entries under the value for "tests".- Parameters:
reader-- Returns:
- TestMatrixArtifact with referenced test definitions only
- Throws:
java.io.IOExceptionTestMatrixOutdatedException
-
extractReferencedTests
protected java.util.Map<java.lang.String,ConsumableTestDefinition> extractReferencedTests(@Nonnull com.fasterxml.jackson.core.JsonParser jsonParser) throws java.io.IOException
- Throws:
java.io.IOException
-
isTestReferenced
protected boolean isTestReferenced(java.lang.String testName, ConsumableTestDefinition testDefinition)
-
-