Assert delete statement count

@param expectedDeleteCount expected delete statement count
544840
public static void assertDeleteCount(long expectedDeleteCount) {
        QueryCount queryCount = QueryCountHolder.getGrandTotal();
        long recordedDeleteCount = queryCount.getDelete();
        if (expectedDeleteCount != recordedDeleteCount) {
            throw new SQLDeleteCountMismatchException(expectedDeleteCount, recordedDeleteCount);
        }
    }
1141958
public void incrementCounter(BugChecker bugChecker, String key, int count) {
    statisticsCollector.incrementCounter(statsKey(bugChecker.canonicalName() + "-" + key), count);
  }
1255472
public void preDelete(Transaction transaction)
                    throws ObjectManagerException
    {
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this, cclass,
                        "preDelete",
                        "transaction=" + transaction + "(Transaction)");

        synchronized (headSequenceNumberLock) {
            tailSequenceNumberLock.lock();
            try {
                // Defect 322295
                // We only need to do this check at runtime. At recovery time we can rely on the
                // check been done before the OM went down. Also in some cases the subList array may
                // be padded with nulls depending on how many were successfully deleted from the
                // object store before the OM went down.
                if (transaction.getObjectManagerStateState() != ObjectManagerState.stateReplayingLog) {
                    // Check that the sublists are empty.
                    for (int i = 0; i < subLists.length; i++) {
                        // The list must be empty, apart from links this transaction will delete.
                        Token nextToken = subLists[i].head;
                        while (nextToken != null) {
                            LinkedList.Link nextLink = (LinkedList.Link) nextToken.getManagedObject();
                            if (nextLink.willBeDeleted(transaction))
                                nextToken = nextLink.next;
                            else {
                                if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
                                    trace.exit(this, cclass,
                                               "preDelete",
                                               "via CollentionNotEmptyException"
                                                               + "size()=" + size() + "(long)"
                                                               + " nextLink.state=" + nextLink.state + "(int) " + LinkedList.Link.stateNames[nextLink.state]
                                                               + "\n nextLink.getTransactionLock()=" + nextLink.getTransactionLock() + "(TransactionLock)"
                                                    );

                                throw new CollectionNotEmptyException(this, size(), transaction);
                                //System.out.println("LinkedList.preDelete nextLink.state ="+nextLink.state+" "+LinkedList.Link.stateNames[nextLink.state]
                                //                                                                                              +"\n nextLink.getTransactionLock()="+nextLink.getTransactionLock() 
                                //                                                                                              );
                                //break;
                            } // if (  nextLink.state == Link.stateToBeDeleted...
                        } // while (nextToken != null).

                    } // for subLists.
                } // if not recovering...

                super.preDelete(transaction); // Also takes a lock.
                // Visibility is now restricted to our transaction only.

                // Now delete the sublists. 
                // If we are recovering, the delete of the sublists will have already been done
                // so don't do it again.
                if (transaction.getObjectManagerStateState() != ObjectManagerState.stateReplayingLog) {
                    transaction.optimisticReplace(null, null, java.util.Arrays.asList(subLists), null);
                } // if not recovering...

            } finally {
                if (tailSequenceNumberLock.isHeldByCurrentThread())
                    tailSequenceNumberLock.unlock();
            } // try (tailSequenceNumberLock).
        } // synchronized (headSequenceNumberLock).

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this, cclass,
                       "preDelete");
    }
1240477
private List<String> checkDeletions(List<String> deletes) {
        List<String> failedObjects = new ArrayList<String>();
        for (String delete : deletes) {
            if (!checkIfActiveOidExisting(delete)) {
                failedObjects.add(delete);
            }
        }
        return failedObjects;
    }
1249942
def verify_consistency(self, expected_leaf_count) -> bool:
        
        if expected_leaf_count != self.leafCount:
            raise ConsistencyVerificationFailed()
        if self.get_expected_node_count(self.leafCount) != self.nodeCount:
            raise ConsistencyVerificationFailed()
        return True
396357
public function assertNotCount($expectedCount, $message = '')
    {
        Assert::assertNotCount($expectedCount, $this->getData(), $message);

        return $this;
    }
1041412
protected void deleteContent(final List<String> tables, final Statement statement) throws SQLException {

		final ArrayList<String> tempTables = new ArrayList<String>(tables);

		// Loop until all data is deleted: we don't know the correct DROP
		// order, so we have to retry upon failure
		while (!tempTables.isEmpty()) {
			final int sizeBefore = tempTables.size();
			for (final ListIterator<String> iterator = tempTables.listIterator(); iterator.hasNext();) {
				final String table = iterator.next();

				try {
					statement.executeUpdate("DELETE FROM " + table);
					iterator.remove();
				} catch (final SQLException exc) {
					LOG.warn("Ignored exception: " + exc.getMessage() + ". WILL RETRY.");
				}
			}
			if (tempTables.size() == sizeBefore) {
				throw new AssertionError("unable to clean tables " + tempTables);
			}

		}

	}
931645
public SqlStatement getPreparedDeleteStatement(Query query, ClassDescriptor cld)
    {
        return new SqlDeleteByQuery(m_platform, cld, query, logger);
    }
268769
private static void checkSchemaTypeId(VertexIDType type, long count) {
        Preconditions.checkArgument(VertexIDType.Schema.is(type.suffix()),"Expected schema vertex but got: %s",type);
        Preconditions.checkArgument(type.isProper(),"Expected proper type but got: %s",type);
        Preconditions.checkArgument(count > 0 && count < SCHEMA_COUNT_BOUND,
                "Invalid id [%s] for type [%s] bound: %s", count, type, SCHEMA_COUNT_BOUND);
    }
473609
public static void assertCauseMessage(final Throwable ex, final String expectedMessage) {
        assertThat(ex.getCause()).isNotNull();
        assertThat(ex.getCause().getMessage()).isEqualTo(expectedMessage);
    }
1089246
function deleteStats(collection) {
      var coverageType;
      for (coverageType in collection) {
        if (collection.hasOwnProperty(coverageType)) {
          if (collection[coverageType].hasOwnProperty("total")) {
            delete collection[coverageType].total;
          }
          if (collection[coverageType].hasOwnProperty("covered")) {
            delete collection[coverageType].covered;
          }
          if (collection[coverageType].hasOwnProperty("skipped")) {
            delete collection[coverageType].skipped;
          }
        }
      }
    }
625946
static public void assertEquals(String message, char expected, char actual) {
        		assertEquals(message, new Character(expected), new Character(actual));
      	}
824171
@Override
  protected void deleteEntity(DbEntityOperation operation) {

    final DbEntity dbEntity = operation.getEntity();

    // get statement
    String deleteStatement = dbSqlSessionFactory.getDeleteStatement(dbEntity.getClass());
    ensureNotNull("no delete statement for " + dbEntity.getClass() + " in the ibatis mapping files", "deleteStatement", deleteStatement);

    LOG.executeDatabaseOperation("DELETE", dbEntity);

    // execute the delete
    int nrOfRowsDeleted = executeDelete(deleteStatement, dbEntity);
    operation.setRowsAffected(nrOfRowsDeleted);

    // It only makes sense to check for optimistic locking exceptions for objects that actually have a revision
    if (dbEntity instanceof HasDbRevision && nrOfRowsDeleted == 0) {
      operation.setFailed(true);
      return;
    }

    // perform post delete action
    entityDeleted(dbEntity);
  }
264089
public static void assertInsertCount(long expectedInsertCount) {
        QueryCount queryCount = QueryCountHolder.getGrandTotal();
        long recordedInsertCount = queryCount.getInsert();
        if (expectedInsertCount != recordedInsertCount) {
            throw new SQLInsertCountMismatchException(expectedInsertCount, recordedInsertCount);
        }
    }
757267
protected function assertMailCount($actualMail, $expectedCount = null)
    {
        $actualCount = count($actualMail);
        if (is_null($expectedCount)) {
            // If number to expect is not specified, expect more than zero.
            if ($actualCount === 0) {
                throw new \Exception("Expected some mail, but none found.");
            }
        } else {
            if ($expectedCount != $actualCount) {
                // Prepare a simple list of actual mail.
                $prettyActualMail = [];
                foreach ($actualMail as $singleActualMail) {
                    $prettyActualMail[] = [
                    'to' => $singleActualMail['to'],
                    'subject' => $singleActualMail['subject'],
                    ];
                }
                throw new \Exception(sprintf("Expected %s mail, but %s found:\n\n%s", $expectedCount, $actualCount, print_r($prettyActualMail, true)));
            }
        }
    }
1348883
protected void assertArgCount(Object[] args, int count) {
        if (args.length != count) {
            throw illegalArgumentException(String.format(
                    "Wrong number of arguments, expected %d got %d", 
                    count, args.length));
        }
    }
200623
public static void assertCauseCauseMessage(final Throwable ex, final String expectedMessage) {
        assertThat(ex.getCause()).isNotNull();
        assertThat(ex.getCause().getCause()).isNotNull();
        assertThat(ex.getCause().getCause().getMessage()).isEqualTo(expectedMessage);
    }