Package org.junit.internal

Examples of org.junit.internal.AssumptionViolatedException


       * @see org.hamcrest.CoreMatchers
       * @see org.junit.matchers.JUnitMatchers
       */
  public static <T> void assumeThat(T actual, Matcher<T> matcher) {
    if (!matcher.matches(actual))
      throw new AssumptionViolatedException(actual, matcher);
  }
View Full Code Here


            try{
                statement.evaluate();
            }catch (IOException e){
                if(ignoreIOExceptions){
                    e.printStackTrace();
                    throw new AssumptionViolatedException("IOException: " + e.getMessage());
                }else{
                    throw e;
                }
            }
        }
View Full Code Here

    }

    @Test
    public void notifiesWhenTestIsNonCompliant(){
        doAnswer(invocationOnMock -> {
            throw new AssumptionViolatedException("non compliant");
        }).when(mockedCode).run();

        junitTest.executeNotifying(mockedNotifier);

        verify(mockedNotifier).fireTestAssumptionFailed(anyObject());
View Full Code Here

    @Before
    public void createDAOFactory() throws FileNotFoundException {
        String skip = System.getProperty("lenskit.integration.skip");
        if (skip != null && !skip.equalsIgnoreCase("true")) {
            throw new AssumptionViolatedException("Integration test skip requested");
        }
        final String dataProp = System.getProperty(ML100K_PROPERTY);
        final File dataDir = dataProp != null ? new File(dataProp) : new File("data/ml-100k");
        final File inputFile = new File(dataDir, INPUT_FILE_NAME);
        if (dataProp == null) {
View Full Code Here

        private class CheckDBRule implements MethodRule {

            private final AssumptionViolatedException assume;

            public CheckDBRule(KiWiConfiguration dbConfig) {
                AssumptionViolatedException ex = null;
                try {
                    DBConnectionChecker.checkDatabaseAvailability(dbConfig);
                } catch (AssumptionViolatedException ave) {
                    ex = ave;
                }
View Full Code Here

            };
            backend.initialize();

            return backend;
        } catch (RepositoryException e) {
            throw new AssumptionViolatedException("could not initialise backend",e);
        }
    }
View Full Code Here

   * @param failure what failed
   * @throws AssumptionViolatedException always
   */
  public static void downgrade(String message, Throwable failure) {
    LOG.warn("Downgrading test " + message, failure);
    AssumptionViolatedException ave =
      new AssumptionViolatedException(failure, null);
    throw ave;
  }
View Full Code Here

   * report an overridden test as unsupported
   * @param message message to use in the text
   * @throws AssumptionViolatedException always
   */
  public static void unsupported(String message) {
    throw new AssumptionViolatedException(message);
  }
View Full Code Here

   * report a test has been skipped for some reason
   * @param message message to use in the text
   * @throws AssumptionViolatedException always
   */
  public static void skip(String message) {
    throw new AssumptionViolatedException(message);
  }
View Full Code Here

   * Assume a minimum {@link JavaVersion} is running.
   * @param version the minimum version for the test to run
   */
  public static void atLeast(JavaVersion version) {
    if (!JavaVersion.runningVersion().isAtLeast(version)) {
      throw new AssumptionViolatedException("Requires JDK " + version + " but running "
          + JavaVersion.runningVersion());
    }
  }
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.