Class JsonFactoryContract<N, M extends JsonModel<N> & JsonFactory<N>>

java.lang.Object
ca.marcusdunn.jsonlens.testkit.JsonModelContract<N>
ca.marcusdunn.jsonlens.testkit.JsonFactoryContract<N,M>
Type Parameters:
N - the node type of the model
M - the type of the model
Direct Known Subclasses:
JsonEditorContract

public abstract class JsonFactoryContract<N, M extends JsonModel<N> & JsonFactory<N>> extends JsonModelContract<N>
Tests that a model that also implements JsonFactory is well-formed: each built node has the correct kind, and the read methods give the exact value again.
  • Constructor Details

    • JsonFactoryContract

      protected JsonFactoryContract()
      Makes the contract test. A subclass gives the model and a parser.
  • Method Details

    • factory

      protected abstract M factory()
      Returns the model under test.
      Returns:
      the model under test
    • model

      protected JsonModel<N> model()
      Description copied from class: JsonModelContract
      Returns the model under test.
      Specified by:
      model in class JsonModelContract<N>
      Returns:
      the model under test