Package org.junit.internal

Examples of org.junit.internal.AssumptionViolatedException


          for (RedisDriver driver : withRedisDriver.value()) {

            valid &= driver.matches(redisConnectionFactory);

            if (!valid) {
              throw new AssumptionViolatedException("not a vaild redis connection for driver: " + driver);
            }
          }
        }

        base.evaluate();
View Full Code Here


      }
    }

    if (failed > 0) {
      if (SentinelsAvailable.ALL_ACTIVE.equals(verificationMode)) {
        throw new AssumptionViolatedException(String.format(
            "Expected all Redis Sentinels to respone but %s of %s did not responde", failed, sentinelConfig
                .getSentinels().size()));
      }

      if (SentinelsAvailable.ONE_ACTIVE.equals(verificationMode) && sentinelConfig.getSentinels().size() - 1 < failed) {
        throw new AssumptionViolatedException(
            "Expected at least one sentinel to respond but it seems all are offline - Game Over!");
      }
    }

    if (SentinelsAvailable.NONE_ACTIVE.equals(verificationMode) && failed != sentinelConfig.getSentinels().size()) {
      throw new AssumptionViolatedException(String.format(
          "Expected to have no sentinels online but found that %s are still alive.", (sentinelConfig.getSentinels()
              .size() - failed)));
    }
  }
View Full Code Here

  @Test
  @IfProfileValue(name = "redisVersion", value = "2.8+")
  public void scanShouldReadEntireValueRange() {

    if (!ConnectionUtils.isJedis(connectionFactory) && !ConnectionUtils.isLettuce(connectionFactory)) {
      throw new AssumptionViolatedException("SCAN is only available for jedis and lettuce");
    }

    if (connection.isPipelined() || connection.isQueueing()) {
      throw new AssumptionViolatedException("SCAN is only available in non pipeline | queue mode.");
    }

    connection.set("spring", "data");

    int itemCount = 22;
View Full Code Here

  @Test
  @IfProfileValue(name = "redisVersion", value = "2.8+")
  public void zScanShouldReadEntireValueRange() {

    if (!ConnectionUtils.isJedis(connectionFactory) && !ConnectionUtils.isLettuce(connectionFactory)) {
      throw new AssumptionViolatedException("ZSCAN is only available for jedis and lettuce");
    }

    if (connection.isPipelined() || connection.isQueueing()) {
      throw new AssumptionViolatedException("ZSCAN is only available in non pipeline | queue mode.");
    }

    connection.zAdd("myset", 2, "Bob");
    connection.zAdd("myset", 1, "James");
    connection.zAdd("myset", 4, "Joe");
View Full Code Here

  @Test
  @IfProfileValue(name = "redisVersion", value = "2.8+")
  public void sScanShouldReadEntireValueRange() {

    if (!ConnectionUtils.isJedis(connectionFactory) && !ConnectionUtils.isLettuce(connectionFactory)) {
      throw new AssumptionViolatedException("SCAN is only available for jedis and lettuce");
    }

    if (connection.isPipelined() || connection.isQueueing()) {
      throw new AssumptionViolatedException("SCAN is only available in non pipeline | queue mode.");
    }

    connection.sAdd("sscankey", "bar");
    connection.sAdd("sscankey", "foo-1", "foo-2", "foo-3", "foo-4", "foo-5", "foo-6");
View Full Code Here

  @Test
  @IfProfileValue(name = "redisVersion", value = "2.8+")
  public void hScanShouldReadEntireValueRange() {

    if (!ConnectionUtils.isJedis(connectionFactory) && !ConnectionUtils.isLettuce(connectionFactory)) {
      throw new AssumptionViolatedException("HSCAN is only available for jedis and lettuce");
    }

    if (connection.isPipelined() || connection.isQueueing()) {
      throw new AssumptionViolatedException("HSCAN is only available in non pipeline | queue mode.");
    }

    connection.hSet("hscankey", "bar", "foobar");

    connection.hSet("hscankey", "foo-1", "v-1");
View Full Code Here

        }
    }

    private void checkForAssumptionViolations() {
        if (StepEventBus.getEventBus().assumptionViolated()) {
            throw new AssumptionViolatedException(StepEventBus.getEventBus().getAssumptionViolatedMessage());
        }
    }
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

    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

    @NotNull
    @SuppressWarnings("IOResourceOpenedButNotSafelyClosed")
    private static Properties loadConnectionProperties(@NotNull String propertiesName) {
        InputStream in = TransactionCallback.class.getClassLoader().getResourceAsStream(propertiesName);
        if (in == null)
            throw new AssumptionViolatedException("Could not find database configuration file '" + propertiesName + "'.");
        try {
            try {
                Properties properties = new Properties();
                properties.load(in);
                return properties;
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.