Assert that the database state matches the given data set (error message variant).

@param message Assertion error message.
@param dataSet Data set.
@throws DBAssertionError if the assertion fails.
@see #assertEmpty(String, DataSource)
323232
public static void assertState(String message, DataSet dataSet) throws DBAssertionError {
    DBAssert.stateAssertion(CallInfo.create(message), dataSet);
  }
750717
public static void assertTrue(@Nullable final String message, final boolean condition) {
    if (!condition) {
      final AssertionError error = new AssertionError(GetUtils.ensureNonNull(message, "Condition must be TRUE"));
      MetaErrorListeners.fireError(error.getMessage(), error);
      throw error;
    }
  }
17779
function isEmpty(value, message, id) {
    if (message === void 0) { message = ''; }
    if (id === void 0) { id = ''; }
    if (this.enabled &&
        ((typeof value === 'string' && value.length === 0) ||
            (typeof value === 'number' && value === 0))) {
        throw LogicException.throw(assertionTypes.IS_EMPTY, value, message, id);
    }
}
860961
boolean assertConnection() {
    try {
      if (getDatabaseConnection() == null
          || getDatabaseConnection().connection == null) {
        return error(loc("no-current-connection"));
      }

      if (getDatabaseConnection().connection.isClosed()) {
        return error(loc("connection-is-closed"));
      }
    } catch (SQLException sqle) {
      return error(loc("no-current-connection"));
    }

    return true;
  }
700036
static public void assertEquals(String message, String expected, String actual) {
        if (expected == null && actual == null) {
            return;
        }
        if (expected != null && expected.equals(actual)) {
            return;
        }
        String cleanMessage = message == null ? "" : message;
        throw new ComparisonFailure(cleanMessage, expected, actual);
    }
562939
public static void assertNull(Object object, String message) {
		if (imp != null && object != null) {
			imp.assertFailed(message);
		}
	}
493885
static void assertNotNull(String message, Object nonNullObject)
    {
        if(nonNullObject == null)
        {
            System.err.println(message);
        }
    }
666862
@Override
    public void assertStatement(org.openrdf.model.Statement stmnt) {
	try {
	    if (currentContext==null) {
		manager.getConnection().add(stmnt);
	    } else {
		manager.getConnection().add(stmnt, currentContext);
	    }
	} catch (org.openrdf.repository.RepositoryException e) {
	}
    }
649633
@SuppressWarnings("unchecked")
    public static void main(@SuppressWarnings("ParameterCanBeLocal") String args[]) throws Exception {

        if(args == null || args.length == 0) {
            //Default values to run via the IDE
            args = new String[2];
            args[0] = "1";
            args[1] = "RandomTransactionBenchmarkTest";
        }

        // Delete the existing database so we start with a clean slate
        deleteDirectory(new File(DatabaseProvider.DATABASE_LOCATION));

        // Default Provider properties
        DatabaseProvider databaseProvider;
        BenchmarkTest benchmarkBenchmarkTest;

        // If the arguments exist through command line use them
        int databaseProviderIndex = Integer.valueOf(args[0]);
        String test = args[1];
        Class testClass = ApplicationClassFinder.INSTANCE.forName("com.onyxdevtools.benchmark." + test, null);
        Constructor<?> constructor = testClass.getConstructor(ProviderPersistenceManager.class);
        databaseProvider = DatabaseProvider.values()[databaseProviderIndex];
        benchmarkBenchmarkTest = (BenchmarkTest) constructor.newInstance(PersistenceProviderFactory.getPersistenceManager(databaseProvider));

        runTest(benchmarkBenchmarkTest);

        System.exit(0);
    }
1305775
public void commit() throws SQLException {
        if (useConnection == null) {
            LOG.info("Commit operation not supported when using datasets unless using withTransaction or cacheConnection - attempt to commit ignored");
            return;
        }
        try {
            useConnection.commit();
        } catch (SQLException e) {
            LOG.warning("Caught exception committing connection: " + e.getMessage());
            throw e;
        }
    }
1368461
public static Datasubtype isValid(Datatype datatype, Set<Datasubtype> datasubtypes, String code) {
        Map<Datasubtype, ValiditySet> subtable = ValidityData.data.get(datatype);
        if (subtable != null) {
            for (Datasubtype datasubtype : datasubtypes) {
                ValiditySet validitySet = subtable.get(datasubtype);
                if (validitySet != null) {
                    if (validitySet.contains(AsciiUtil.toLowerString(code))) {
                        return datasubtype;
                    }
                }
            }
        }
        return null;
    }
928495
@Override
	protected void validateComponent(final List<Diagnostic> diags) {
		super.validateComponent(diags);

		if (!isEmpty()) {
			String value = getValueAsString();

			// Maximum Length
			int max = getMaxLength();

			if (max > 0 && value.length() > max) {
				diags.add(
						createErrorDiagnostic(InternalMessages.DEFAULT_VALIDATION_ERROR_MAX_LENGTH,
								this,
								String.valueOf(max)));
			}

			// Minimum Length
			int min = getMinLength();

			if (min > 0 && value.length() < min) {
				diags.add(
						createErrorDiagnostic(InternalMessages.DEFAULT_VALIDATION_ERROR_MIN_LENGTH,
								this,
								String.valueOf(min)));
			}

			// Pattern
			Pattern pattern = getComponentModel().pattern;
			if (pattern != null) {
				Matcher matcher = pattern.matcher(value);
				if (!matcher.matches()) {
					diags.add(createErrorDiagnostic(
							InternalMessages.DEFAULT_VALIDATION_ERROR_INVALID_PATTERN, this));
				}
			}
		}
	}
680671
protected final void validateAssertion(final Assertion assertion, final SAML2MessageContext context,
                                           final SignatureTrustEngine engine, final Decrypter decrypter) {

        validateIssueInstant(assertion.getIssueInstant());

        validateIssuer(assertion.getIssuer(), context);

        if (assertion.getSubject() != null) {
            validateSubject(assertion.getSubject(), context, decrypter);
        } else {
            throw new SAMAssertionSubjectException("Assertion subject cannot be null");
        }

        validateAssertionConditions(assertion.getConditions(), context);

        validateAuthenticationStatements(assertion.getAuthnStatements(), context);

        validateAssertionSignature(assertion.getSignature(), context, engine);

    }
246127
public void assertNotEmpty(Map<?, ?> map, String propertyName) {
        if (map == null || map.size() == 0) {
            problemReporter.report(new Problem(this, String.format("%s requires one or more entries", propertyName)));
        }
    }
187554
public static void assertTrueOrUnknownClassInJQLException(boolean expression, SQLiteModelMethod method,
			String className) {
		if (!expression) {
			throw (new UnknownClassInJQLException(method, className));
		}
	}
1126486
@Nonnull
  public static Error fail(@Nullable final String message) {
    final AssertionError error = new AssertionError(GetUtils.ensureNonNull(message, "failed"));
    MetaErrorListeners.fireError("Asserion error", error);
    if (true) {
      throw error;
    }
    return error;
  }
868600
public static <T> T validateEmpty(T value, String errorMsg) throws ValidateException {
		if (isNotEmpty(value)) {
			throw new ValidateException(errorMsg);
		}
		return value;
	}