tck/src/main/java/org/apache/jdo/tck/query/jdoql/operators/ConditionalAND.java [55:105]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  public void testPositive() {
    PersistenceManager pm = getPM();
    if (debug) logger.debug("\nExecuting test ConditionalAND() ...");

    Transaction tx = pm.currentTransaction();
    tx.begin();

    List<PrimitiveTypes> instance9 = pm.newQuery(PrimitiveTypes.class, "id == 9").executeList();
    List<PrimitiveTypes> allOddInstances =
        pm.newQuery(PrimitiveTypes.class, "booleanNull").executeList();
    List<PrimitiveTypes> allInstances = pm.newQuery(PrimitiveTypes.class, "true").executeList();
    List<PrimitiveTypes> empty = Collections.emptyList();

    // case true && true
    runSimplePrimitiveTypesQuery("true && true", pm, allInstances, ASSERTION_FAILED);

    // case true && false
    runSimplePrimitiveTypesQuery("true && false", pm, empty, ASSERTION_FAILED);

    // case false && true
    runSimplePrimitiveTypesQuery("false && true", pm, empty, ASSERTION_FAILED);

    // case false && false
    runSimplePrimitiveTypesQuery("false && false", pm, empty, ASSERTION_FAILED);

    // case boolean && boolean
    runSimplePrimitiveTypesQuery(
        "intNotNull == 9 && booleanNotNull", pm, instance9, ASSERTION_FAILED);

    // case boolean && Boolean
    runSimplePrimitiveTypesQuery("intNotNull == 9 && booleanNull", pm, instance9, ASSERTION_FAILED);
    // case Boolean && boolean
    runSimplePrimitiveTypesQuery("booleanNull && intNotNull == 9", pm, instance9, ASSERTION_FAILED);
    // case Boolean && Boolean
    runSimplePrimitiveTypesQuery(
        "booleanNull && booleanNull", pm, allOddInstances, ASSERTION_FAILED);

    // case Boolean parameter
    runParameterPrimitiveTypesQuery(
        "param && id == 9", "Boolean param", Boolean.TRUE, pm, instance9, ASSERTION_FAILED);
    runParameterPrimitiveTypesQuery(
        "param && id == 9", "Boolean param", Boolean.FALSE, pm, empty, ASSERTION_FAILED);

    // case boolean parameter
    runParameterPrimitiveTypesQuery(
        "param && id == 9", "boolean param", Boolean.TRUE, pm, instance9, ASSERTION_FAILED);
    runParameterPrimitiveTypesQuery(
        "param && id == 9", "boolean param", Boolean.FALSE, pm, empty, ASSERTION_FAILED);

    tx.commit();
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



tck/src/main/java/org/apache/jdo/tck/query/jdoql/operators/BooleanLogicalAND.java [56:106]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  public void testPositive() {
    PersistenceManager pm = getPM();
    if (debug) logger.debug("\nExecuting positive test BooleanLogicalAND() ...");

    Transaction tx = pm.currentTransaction();
    tx.begin();

    List<PrimitiveTypes> instance9 = pm.newQuery(PrimitiveTypes.class, "id == 9").executeList();
    List<PrimitiveTypes> allOddInstances =
        pm.newQuery(PrimitiveTypes.class, "booleanNull").executeList();
    List<PrimitiveTypes> allInstances = pm.newQuery(PrimitiveTypes.class, "true").executeList();
    List<PrimitiveTypes> empty = Collections.emptyList();

    // case true & true
    runSimplePrimitiveTypesQuery("true & true", pm, allInstances, ASSERTION_FAILED);

    // case true & false
    runSimplePrimitiveTypesQuery("true & false", pm, empty, ASSERTION_FAILED);

    // case false & true
    runSimplePrimitiveTypesQuery("false & true", pm, empty, ASSERTION_FAILED);

    // case false & false
    runSimplePrimitiveTypesQuery("false & false", pm, empty, ASSERTION_FAILED);

    // case boolean & boolean
    runSimplePrimitiveTypesQuery(
        "intNotNull == 9 & booleanNotNull", pm, instance9, ASSERTION_FAILED);

    // case boolean & Boolean
    runSimplePrimitiveTypesQuery("intNotNull == 9 & booleanNull", pm, instance9, ASSERTION_FAILED);
    // case Boolean & boolean
    runSimplePrimitiveTypesQuery("booleanNull & intNotNull == 9", pm, instance9, ASSERTION_FAILED);
    // case Boolean & Boolean
    runSimplePrimitiveTypesQuery(
        "booleanNull & booleanNull", pm, allOddInstances, ASSERTION_FAILED);

    // case Boolean parameter
    runParameterPrimitiveTypesQuery(
        "param & id == 9", "Boolean param", Boolean.TRUE, pm, instance9, ASSERTION_FAILED);
    runParameterPrimitiveTypesQuery(
        "param & id == 9", "Boolean param", Boolean.FALSE, pm, empty, ASSERTION_FAILED);

    // case boolean parameter
    runParameterPrimitiveTypesQuery(
        "param & id == 9", "boolean param", Boolean.TRUE, pm, instance9, ASSERTION_FAILED);
    runParameterPrimitiveTypesQuery(
        "param & id == 9", "boolean param", Boolean.FALSE, pm, empty, ASSERTION_FAILED);

    tx.commit();
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



