Package org.junit.internal

Examples of org.junit.internal.AssumptionViolatedException


      } catch (Throwable t) {
        throw new RuntimeException("Error collecting parameters from: " + m, t);
      }

      if (result.isEmpty()) {
        throw new AssumptionViolatedException("Parameters set should not be empty. Ignoring tests.");
      }

      parameters.addAll(result);
    }
View Full Code Here


      // will fail if not H2
      if (db.getDialect().getId().equals("h2")) {
        ((H2Database) db).executeScript(schemaPath);
      } else {
        db.stop();
        throw new AssumptionViolatedException("Test disabled because it supports only H2");
      }
    }
    LOG.info("Test Database: " + db);

    commands = DatabaseCommands.forDialect(db.getDialect());
View Full Code Here

      @Override
      public void evaluate() throws Throwable {
        if (currentVersion != null) {
          if (currentVersion.isLessThan(minVersion) || currentVersion.isGreaterThan(maxVersion)) {
            throw new AssumptionViolatedException(String.format(
                "Expected mongodb server to be in range %s to %s but found %s", minVersion, maxVersion, currentVersion));
          }
        }
        base.evaluate();
      }
View Full Code Here

  /**
   * Check on zombie threads status.
   */
  static void checkZombies() throws AssumptionViolatedException {
    if (zombieMarker.get()) {
      throw new AssumptionViolatedException("Leaked background threads present (zombies).");
    }
  }
View Full Code Here

  /**
   * Check on zombie threads status.
   */
  private static void checkZombies() throws AssumptionViolatedException {
    if (RandomizedRunner.hasZombieThreads()) {
      throw new AssumptionViolatedException("Leaked background threads present (zombies).");
    }
  }
View Full Code Here

    if (!IOUtil.isSerializable(t)) {
      // If we have an assumption failure wrapped in an InvocationTargetException, rethrow a new
      // AssumptionViolatedException that just containing the message
      InvocationTargetException ite = JuObjectUtils.as(t, InvocationTargetException.class);
      if (ite != null && ite.getTargetException() instanceof AssumptionViolatedException) {
        throw new AssumptionViolatedException(ite.getTargetException().getMessage());
      }

     
      XString causes = new XString("%s (Original Exception %s not serializable. Resolving chain"
          , t.getMessage()
View Full Code Here

    return new Statement() {

      @Override
      public void evaluate() throws Throwable {
        if (StringUtils.hasText(errMsg)) {
          throw new AssumptionViolatedException(errMsg);
        }
      }
    };
  }
View Full Code Here

    int ch = input.read();
    if (ch < 0) {
      return ch;
    } else {
      if (ch == 0xffff) {
        throw new AssumptionViolatedException
            ("Test data cannot contain '\\uFFFF' (Lucene 3.x only)");
      }
      assert !Character.isLowSurrogate((char) ch);
      off++;
      if (Character.isHighSurrogate((char) ch)) {
View Full Code Here

                if ( !scenario.wasSuccessful() ) {
                    StringBuilder builder = new StringBuilder();
                    for ( String message : scenario.getFailureMessages() ) {
                        builder.append( message ).append( "\n" );
                    }
                    eachNotifier.addFailedAssumption( new AssumptionViolatedException( builder.toString() ) );
                }
            } catch ( Throwable t ) {
                eachNotifier.addFailure( t );
            } finally {
                // has to always be called as per junit docs
View Full Code Here

      String cleanedVersionString = version.replace("+", "");
      Version expected = RedisVersionUtils.parseVersion(cleanedVersionString);

      if (sloppyMatch) {
        if (redisVersion.compareTo(expected) < 0) {
          throw new AssumptionViolatedException("Expected Redis version " + version + " but found " + redisVersion);
        }
      } else {
        if (redisVersion.compareTo(expected) == 0) {
          throw new AssumptionViolatedException("Expected Redis version " + version + " but found " + redisVersion);
        }
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.junit.internal.AssumptionViolatedException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.