Package org.junit.internal

Examples of org.junit.internal.AssumptionViolatedException


   */
  protected void assumingBasePackagesLoad() {
    try {
      topLevelContext.init();
    } catch(Exception e) {
      throw new AssumptionViolatedException("Exception thrown while loading R-language packages");
    }
  }
View Full Code Here


        Assert.assertNull(result.getThrowable());
    }

    @Test
    public void shouldSkipResultIfExceptionCaughtAfterJunit() throws Exception {
        State.caughtExceptionAfterJunit(new AssumptionViolatedException("A"));
        TestResult result = TestResult.failed(new AssumptionViolatedException("A"));

        new UpdateTestResultBeforeAfter().update(event, result);
        State.caughtExceptionAfterJunit(null);

        Assert.assertEquals(Status.SKIPPED, result.getStatus());
View Full Code Here

*/
public class AssumeTests {

  @Test
  public void testCodecNotExist() {
    AssumptionViolatedException ave = null;
    try {
      Assume.codecExists("foo.Jee");
    } catch (AssumptionViolatedException e) {
      ave = e;
    }
View Full Code Here

     *
     * @param group the group that must be specified.
     */
    public static void group(TestGroup group) {
        if (!GROUPS.contains(group)) {
            throw new AssumptionViolatedException("Requires unspecified group " + group
                    + " from " + GROUPS);
        }
    }
View Full Code Here

  public static void hadoopVersion(Version version) {
    Version current = Version.resolveVersion();
    if (ObjectUtils.nullSafeEquals(version, current)) {
      return;
    } else {
      throw new AssumptionViolatedException("specified version [" + version
          + "] not matched with current version [" + current + "]");
    }
  }
View Full Code Here

    if(ClassUtils.isPresent(codecClazz, Assume.class.getClassLoader())) {
      Class<?> codecClass = ClassUtils.resolveClassName(codecClazz, Assume.class.getClassLoader());
      if (ClassUtils.isAssignable(CompressionCodec.class, codecClass)) {
        return;
      } else {
        throw new AssumptionViolatedException("Resolved class [" + codecClass
            +"] is not instance of CompressionCodec");
      }
    } else {
      throw new AssumptionViolatedException("Class [" + codecClazz
          +"] cannot be loaded");
    }
  }
View Full Code Here

   */
  public static void nativeCode(Configuration configuration) {
    if (NativeCodeLoader.isNativeCodeLoaded() && ZlibFactory.isNativeZlibLoaded(configuration)) {
      return;
    } else {
      throw new AssumptionViolatedException("Native hadoop code not loaded");
    }
  }
View Full Code Here

                    msg = new MailMessage("localhost", TEST_PORT);
                } catch (java.net.ConnectException ce) {
                    try {
                        Thread.sleep(10 * 1000);
                    } catch (InterruptedException ie) {
                        throw new AssumptionViolatedException("Thread interrupted", ie);
                    }
                } catch (IOException ioe) {
                    fail = true;
                    failMessage = "IOException: " + ioe;
                    return;
View Full Code Here

                public void run(){
                    try {
                        process.waitFor();
                    } catch(InterruptedException e){
                        // not very nice but will do the job
                        throw new AssumptionViolatedException("process interrupted in thread", e);
                    }
                }
        };
        thread.start();
View Full Code Here

            if (e
                .getMessage()
                .endsWith(" doesn't recognize feature http://apache.org/xml/features/validation/schema")
                || e.getMessage().endsWith(
                    " doesn't support feature http://apache.org/xml/features/validation/schema")) {
                throw new AssumptionViolatedException("parser doesn't support schema");
            } else {
                throw e;
            }
        }
    }
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.