Class FlexibleSearchServiceGetModelByExampleTest

All Implemented Interfaces:
JaloSessionHolder

@IntegrationTest public class FlexibleSearchServiceGetModelByExampleTest extends ServicelayerTransactionalBaseTest
The FlexibleSearchService.getModelByExample(Object) method will get a model (representing a persisted item) by passing an example model with partly filled values. For gathering the correct model a flexiblesearch has to be generated from filled model values to gather the persisted model.
  • Constructor Details

    • FlexibleSearchServiceGetModelByExampleTest

      public FlexibleSearchServiceGetModelByExampleTest()
  • Method Details

    • setUp

      public void setUp() throws Exception
      Throws:
      Exception
    • testWithNullFail

      public void testWithNullFail()
      A null value is not permitted and will throw a IllegalArgumentException.
    • testWithNoValuesFail

      public void testWithNoValuesFail()
      An example without any values set is not permitted and will throw a ModelLoadingException.
    • testWithUniqueValuesSuccess

      public void testWithUniqueValuesSuccess()
      A search by unique identifiers should succeed if there is exactly one entry fulfilling unique attribute values. The returned model is not same the passed one. If the entry was accessed within request already, the cached instance should be returned (here the model of setUp() method.
    • testWithUniqueValuesAttachedToSessionFail

      public void testWithUniqueValuesAttachedToSessionFail()
      A search with models attached to session can be used. Default values are also used as search params.
    • testWithUniqueValuesAttachedToSessionSuccess

      public void testWithUniqueValuesAttachedToSessionSuccess()
      A search with models attached to session can be used. Default values are also used as search params.
    • testWithUniqueValuesFail

      public void testWithUniqueValuesFail()
      If no entry with unique attribute set can be found a ModelNotFoundException will be thrown.
    • testWithUniqueAndOptionalValuesSuccess

      public void testWithUniqueAndOptionalValuesSuccess()
      A search with unique and optional values set should succeed in general where the optional values will be used too at query. Restrictions to kind of optional values will be defined in following test cases. The resulting model should be not same as passed one (because of model cache).
    • testWithUniqueAndOptionalValuesFail

      public void testWithUniqueAndOptionalValuesFail()
      A search with not matching optional values will throw a ModelNotFoundException.
    • testWithOptionalValuesSuccess

      public void testWithOptionalValuesSuccess()
      A search with only optional values set will succeed in general (like for unique values), restrictions on kind of optional attributes will be covered in later cases.
    • testWithOptionalValuesLocalizedSuccess

      public void testWithOptionalValuesLocalizedSuccess()
      Search with localized values is possible.
    • testWithOptionalValuesLocalizedFail

      public void testWithOptionalValuesLocalizedFail()
      Search with localized values is possible.
    • testWithOptionalValuesFail

      public void testWithOptionalValuesFail()
      A search with a wrong set of optional values set (no related entry in system) will fail with ModelNotFoundException.
    • testWithOptionalValuesAmbigiuous

      public void testWithOptionalValuesAmbigiuous()
      A search with an ambiguous set of optional values will will with AmbiguousIdentifierException.
    • testWithSavedExample

      public void testWithSavedExample()
      A search with an already persisted model will fail with a ModelLoadingException.
    • testWithNotSearchableValue

      public void testWithNotSearchableValue()
      A search with a wrong set of optional values set (no related entry in system) will fail with ModelNotFoundException.
    • testWithSuperTypeSuccess

      public void testWithSuperTypeSuccess()
      A search using a super model will succeed and return correct sub model.
    • testWithWrongType

      public void testWithWrongType()
      At search the composedtype of passed model has to be respected, means only models with that type or subtypes will be returned.
    • testWithNoModel

      public void testWithNoModel()
      Just in case: an exception should be thrown if the example isn't a model. In this case the exception is thrown by the model converter registry.
    • testWithSomeOptionalValuesLocalizedSuccess

      public void testWithSomeOptionalValuesLocalizedSuccess()
    • testWithSomeOptionalValuesLocalizedFail

      public void testWithSomeOptionalValuesLocalizedFail()
    • testBigChangedAttributeTestSuccessfull

      public void testBigChangedAttributeTestSuccessfull()
    • testBigChangedAttributeTestFail

      public void testBigChangedAttributeTestFail()
    • testSearchWithComposedTypeParameter

      public void testSearchWithComposedTypeParameter()
    • testModelNotFoundOnRemovedItem

      public void testModelNotFoundOnRemovedItem() throws ConsistencyCheckException
      Throws:
      ConsistencyCheckException