Beispiel #1
0
  public void run(STClass[] classes, STEngine[] engines, boolean a_quiet) {
    begin();
    setSodaTestOn(classes);

    for (int i = 0; i < engines.length; i++) {
      engine = engines[i];
      engine.reset();
      engine.open();
      store(classes);
      engine.commit();
      engine.close();
      engine.open();
      test(classes);
      engine.close();
      engine.reset();
    }

    if (failedTestClasses.size() > 0) {
      System.err.println("\nFailed test classes:\n");
      Iterator4 i = failedTestClasses.iterator();
      while (i.moveNext()) {
        System.err.println(i.current().getClass().getName());
      }
      System.err.println("\n");
    }
  }
 private void writeCachedDirty() {
   Iterator4 i = _dirtyClassMetadata.iterator();
   while (i.moveNext()) {
     PersistentBase dirty = (PersistentBase) i.current();
     dirty.write(systemTransaction());
     dirty.notCachedDirty();
   }
   _dirtyClassMetadata.clear();
 }
Beispiel #3
0
  public Iterator4 executeSnapshot() {
    final CreateCandidateCollectionResult r = createCandidateCollection();

    final Collection4 executionPath = executionPath(r);

    Iterator4 candidatesIterator = new Iterator4Impl(r.candidateCollection);

    Collection4 snapshots = new Collection4();
    while (candidatesIterator.moveNext()) {
      QCandidates candidates = (QCandidates) candidatesIterator.current();
      snapshots.add(candidates.executeSnapshot(executionPath));
    }

    Iterator4 snapshotsIterator = snapshots.iterator();
    final CompositeIterator4 resultingIDs = new CompositeIterator4(snapshotsIterator);

    if (!r.checkDuplicates) {
      return resultingIDs;
    }

    return checkDuplicates(resultingIDs);
  }
Beispiel #4
0
 private Constraint addInterfaceConstraint(ReflectClass claxx) {
   Collection4 classes = stream().classCollection().forInterface(claxx);
   if (classes.size() == 0) {
     QConClass qcc = new QConClass(_trans, null, null, claxx);
     addConstraint(qcc);
     return qcc;
   }
   Iterator4 i = classes.iterator();
   Constraint constr = null;
   while (i.moveNext()) {
     ClassMetadata classMetadata = (ClassMetadata) i.current();
     ReflectClass classMetadataClaxx = classMetadata.classReflector();
     if (classMetadataClaxx != null) {
       if (!classMetadataClaxx.isInterface()) {
         if (constr == null) {
           constr = constrain(classMetadataClaxx);
         } else {
           constr = constr.or(constrain(classMetadata.classReflector()));
         }
       }
     }
   }
   return constr;
 }