當前位置: 首頁>>代碼示例>>Java>>正文


Java NoTestsRemainException類代碼示例

本文整理匯總了Java中org.junit.runner.manipulation.NoTestsRemainException的典型用法代碼示例。如果您正苦於以下問題:Java NoTestsRemainException類的具體用法?Java NoTestsRemainException怎麽用?Java NoTestsRemainException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


NoTestsRemainException類屬於org.junit.runner.manipulation包,在下文中一共展示了NoTestsRemainException類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: registerOptOuts

import org.junit.runner.manipulation.NoTestsRemainException; //導入依賴的package包/類
private void registerOptOuts(final Class<? extends Graph> graphClass,
                             final Optional<GraphProvider.Descriptor> graphProviderDescriptor,
                             final TraversalEngine.Type traversalEngineType) throws InitializationError {
    final Graph.OptOut[] optOuts = graphClass.getAnnotationsByType(Graph.OptOut.class);

    if (optOuts != null && optOuts.length > 0) {
        // validate annotation - test class and reason must be set
        if (!Arrays.stream(optOuts).allMatch(ignore -> ignore.test() != null && ignore.reason() != null && !ignore.reason().isEmpty()))
            throw new InitializationError("Check @IgnoreTest annotations - all must have a 'test' and 'reason' set");

        try {
            filter(new OptOutTestFilter(optOuts, graphProviderDescriptor, traversalEngineType));
        } catch (NoTestsRemainException ex) {
            throw new InitializationError(ex);
        }
    }
}
 
開發者ID:PKUSilvester,項目名稱:LiteGraph,代碼行數:18,代碼來源:AbstractGremlinSuite.java

示例2: filter

import org.junit.runner.manipulation.NoTestsRemainException; //導入依賴的package包/類
@Override
public void filter(final Filter raw) throws NoTestsRemainException {
	super.filter(new Filter() {
		@Override
		public boolean shouldRun(Description description) {
			String testDisplay = StringUtils.substringBefore(description.getDisplayName(), " ");
			if (testDisplay != description.getDisplayName()) {
				description = Description.createTestDescription(description.getTestClass(), testDisplay);
			}
			return raw.shouldRun(description);
		}

		@Override
		public String describe() {
			return raw.describe();
		}
	});
}
 
開發者ID:GeeQuery,項目名稱:ef-orm,代碼行數:19,代碼來源:JefJUnit4DatabaseTestRunner.java

示例3: filterIfRequired

import org.junit.runner.manipulation.NoTestsRemainException; //導入依賴的package包/類
private void filterIfRequired(final ResultCollector rc, final Runner runner) {
  if (this.filter.hasSome()) {
    if (!(runner instanceof Filterable)) {
      LOG.warning("Not able to filter " + runner.getDescription()
          + ". Mutation may have prevented JUnit from constructing test");
      return;
    }
    final Filterable f = (Filterable) runner;
    try {
      f.filter(this.filter.value());
    } catch (final NoTestsRemainException e1) {
      rc.notifySkipped(this.getDescription());
      return;
    }
  }
}
 
開發者ID:hcoles,項目名稱:pitest,代碼行數:17,代碼來源:AdaptedJUnitTestUnit.java

示例4: runEnabledTests

import org.junit.runner.manipulation.NoTestsRemainException; //導入依賴的package包/類
private void runEnabledTests(RunNotifier nested) {
    if (enabledTests.isEmpty()) {
        return;
    }

    Runner runner;
    try {
        runner = createExecutionRunner();
    } catch (Throwable t) {
        runner = new CannotExecuteRunner(getDisplayName(), target, t);
    }

    try {
        if (!disabledTests.isEmpty()) {
            ((Filterable) runner).filter(new Filter() {
                @Override
                public boolean shouldRun(Description description) {
                    return !disabledTests.contains(description);
                }

                @Override
                public String describe() {
                    return "disabled tests";
                }
            });
        }
    } catch (NoTestsRemainException e) {
        return;
    }

    runner.run(nested);
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:33,代碼來源:AbstractMultiTestRunner.java

示例5: getFilter

import org.junit.runner.manipulation.NoTestsRemainException; //導入依賴的package包/類
public Filter getFilter() {
    return new Filter() {
        @Override
        public boolean shouldRun(Description description) {
            return Boolean.TRUE.equals(context.get(description));
        }

        @Override
        public String describe() {
            return "RTest Filter";
        }

        @Override
        public void apply(Object child) throws NoTestsRemainException {
            if(child instanceof Filterable) {
                Filterable filterableChild = (Filterable) child;
                filterableChild.filter(this);
            }
        }
    };
    //return Filter.matchMethodDescription(desiredDescription);
       /*return new Filter() {
           @Override
           public boolean shouldRun(Description description) {
               return (toRun.contains(description));

           }

           @Override
           public String describe() {
               return "RTest methods filter";
           }
       };*/

}
 
開發者ID:MarkBramnik,項目名稱:rtest,代碼行數:36,代碼來源:FilterData.java

示例6: addFilter

import org.junit.runner.manipulation.NoTestsRemainException; //導入依賴的package包/類
private void addFilter(Filter filter) {
  try {
    filter(filter);
  } catch (NoTestsRemainException ex) {
    System.out.println("No tests remain exception: " + ex);
  }
}
 
開發者ID:google,項目名稱:wycheproof,代碼行數:8,代碼來源:WycheproofRunner.java

示例7: initializeFilter

import org.junit.runner.manipulation.NoTestsRemainException; //導入依賴的package包/類
/**
 * Initializes the test filter.
 *
 * @param parentRunner
 *          the {@link ParentRunner} to initialize, must not be {@code null}
 */
public static void initializeFilter(final ParentRunner<?> parentRunner) {
  try {
    parentRunner.filter(INSTANCE);
  } catch (NoTestsRemainException e) {
    // we ignore the case where no children are left
  }
}
 
開發者ID:dsldevkit,項目名稱:dsl-devkit,代碼行數:14,代碼來源:FilterRegistry.java

示例8: filterByCategory

import org.junit.runner.manipulation.NoTestsRemainException; //導入依賴的package包/類
private void filterByCategory(Class category) throws InitializationError {
  if (category != null) {
    try {
      final Categories.CategoryFilter categoryFilter = Categories.CategoryFilter.include(category);
      filter(categoryFilter);
    } catch (NoTestsRemainException e) {
      throw new RuntimeException(e);
    }
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:11,代碼來源:IdeaSuite48.java

示例9: applyMethodFilter

import org.junit.runner.manipulation.NoTestsRemainException; //導入依賴的package包/類
private void applyMethodFilter() throws InitializationError {
    for (Runner r : getChildren()) {
        try {
            if (r instanceof ParentRunner<?>) {
                ((ParentRunner<?>) r).filter(methodFilter);
            }
        } catch (NoTestsRemainException e) {
            throw new InitializationError(e);
        }
    }
}
 
開發者ID:aafuks,項目名稱:aaf-junit,代碼行數:12,代碼來源:ConcurrentDependsOnClasspathSuite.java

示例10: PowerMockJUnit4LegacyRunnerDelegateImpl

import org.junit.runner.manipulation.NoTestsRemainException; //導入依賴的package包/類
public PowerMockJUnit4LegacyRunnerDelegateImpl(Class<?> klass, String[] methodsToRun,
		PowerMockTestListener[] listeners) throws InitializationError, NoTestsRemainException {
	super(klass, new PowerMockJUnit4LegacyTestClassMethodsRunner(klass,
			listeners == null ? new PowerMockTestListener[0] : listeners));
	filter(new PowerMockJUnit4LegacyFilter(methodsToRun));

	testCount = methodsToRun.length;
}
 
開發者ID:awenblue,項目名稱:powermock,代碼行數:9,代碼來源:PowerMockJUnit4LegacyRunnerDelegateImpl.java

示例11: getRunner

import org.junit.runner.manipulation.NoTestsRemainException; //導入依賴的package包/類
@Override
public Runner getRunner() {
    try {
        Runner runner = mRequest.getRunner();
        mFilter.apply(runner);
        return runner;
    } catch (NoTestsRemainException e) {
        // don't treat filtering out all tests as an error
        return new BlankRunner();
    }
}
 
開發者ID:mg6maciej,項目名稱:android-groovy-dagger-espresso-demo,代碼行數:12,代碼來源:SpockTestRequestBuilder.java

示例12: execute

import org.junit.runner.manipulation.NoTestsRemainException; //導入依賴的package包/類
public static Result execute(final Class<?> classOfspecToRun, final String methodName) throws InitializationError, NoTestsRemainException {

        final Result testResult = new Result();

        Sputnik spockRunner = new Sputnik(classOfspecToRun);
        if(methodName != null && !methodName.equals("")) {
            SpockSpecificationFilter filter = new SpockSpecificationFilter(spockRunner, methodName);
            spockRunner.filter(filter);
        }

        runTest(spockRunner, testResult);

        return testResult;
    }
 
開發者ID:gabehamilton,項目名稱:jmeter-spock-sampler,代碼行數:15,代碼來源:SpockSpecRunner.java

示例13: Categories

import org.junit.runner.manipulation.NoTestsRemainException; //導入依賴的package包/類
public Categories(Class<?> klass, RunnerBuilder builder) throws InitializationError {
    super(klass, builder);
    try {
        Set<Class<?>> included= getIncludedCategory(klass);
        Set<Class<?>> excluded= getExcludedCategory(klass);
        boolean isAnyIncluded= isAnyIncluded(klass);
        boolean isAnyExcluded= isAnyExcluded(klass);

        filter(CategoryFilter.categoryFilter(isAnyIncluded, included, isAnyExcluded, excluded));
    } catch (NoTestsRemainException e) {
        throw new InitializationError(e);
    }
    assertNoCategorizedDescendentsOfUncategorizeableParents(getDescription());
}
 
開發者ID:DIVERSIFY-project,項目名稱:sosiefier,代碼行數:15,代碼來源:Categories.java

示例14: getRunner

import org.junit.runner.manipulation.NoTestsRemainException; //導入依賴的package包/類
@Override
public Runner getRunner() {
    try {
        Runner runner = fRequest.getRunner();
        fFilter.apply(runner);
        return runner;
    } catch (NoTestsRemainException e) {
        return new ErrorReportingRunner(Filter.class, new Exception(String
                .format("No tests found matching %s from %s", fFilter
                        .describe(), fRequest.toString())));
    }
}
 
開發者ID:DIVERSIFY-project,項目名稱:sosiefier,代碼行數:13,代碼來源:FilterRequest.java

示例15: categoryFilterLeavesOnlyMatchingMethods

import org.junit.runner.manipulation.NoTestsRemainException; //導入依賴的package包/類
@Test
public void categoryFilterLeavesOnlyMatchingMethods()
        throws InitializationError, NoTestsRemainException {
    CategoryFilter filter = CategoryFilter.include(SlowTests.class);
    BlockJUnit4ClassRunner runner = new BlockJUnit4ClassRunner(A.class);
    filter.apply(runner);
    assertEquals(1, runner.testCount());
}
 
開發者ID:DIVERSIFY-project,項目名稱:sosiefier,代碼行數:9,代碼來源:CategoryTest.java


注:本文中的org.junit.runner.manipulation.NoTestsRemainException類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。