Java Code Examples for junit.framework.TestSuite

The following are top voted examples for showing how to use junit.framework.TestSuite. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: googles-monorepo-demo   File: TestsForMapsInJavaUtil.java   Source Code and License 6 votes vote down vote up
public Test allTests() {
  TestSuite suite = new TestSuite("java.util Maps");
  suite.addTest(testsForCheckedMap());
  suite.addTest(testsForCheckedNavigableMap());
  suite.addTest(testsForCheckedSortedMap());
  suite.addTest(testsForEmptyMap());
  suite.addTest(testsForEmptyNavigableMap());
  suite.addTest(testsForEmptySortedMap());
  suite.addTest(testsForSingletonMap());
  suite.addTest(testsForHashMap());
  suite.addTest(testsForHashtable());
  suite.addTest(testsForLinkedHashMap());
  suite.addTest(testsForSynchronizedNavigableMap());
  suite.addTest(testsForTreeMapNatural());
  suite.addTest(testsForTreeMapWithComparator());
  suite.addTest(testsForUnmodifiableMap());
  suite.addTest(testsForUnmodifiableNavigableMap());
  suite.addTest(testsForUnmodifiableSortedMap());
  suite.addTest(testsForEnumMap());
  suite.addTest(testsForConcurrentHashMap());
  suite.addTest(testsForConcurrentSkipListMapNatural());
  suite.addTest(testsForConcurrentSkipListMapWithComparator());
  return suite;
}
 
Example 2
Project: googles-monorepo-demo   File: FeatureSpecificTestSuiteBuilder.java   Source Code and License 6 votes vote down vote up
protected TestSuite makeSuiteForTesterClass(Class<? extends AbstractTester<?>> testerClass) {
  final TestSuite candidateTests = new TestSuite(testerClass);
  final TestSuite suite = filterSuite(candidateTests);

  Enumeration<?> allTests = suite.tests();
  while (allTests.hasMoreElements()) {
    Object test = allTests.nextElement();
    if (test instanceof AbstractTester) {
      @SuppressWarnings("unchecked")
      AbstractTester<? super G> tester = (AbstractTester<? super G>) test;
      tester.init(subjectGenerator, name, setUp, tearDown);
    }
  }

  return suite;
}
 
Example 3
Project: googles-monorepo-demo   File: SortedMultisetTestSuiteBuilder.java   Source Code and License 6 votes vote down vote up
private TestSuite createReserializedSuite(SortedMultisetTestSuiteBuilder<E> parentBuilder) {
  final TestMultisetGenerator<E> delegate =
      (TestMultisetGenerator<E>) parentBuilder.getSubjectGenerator();

  Set<Feature<?>> features = new HashSet<Feature<?>>();
  features.addAll(parentBuilder.getFeatures());
  features.remove(SERIALIZABLE);
  features.remove(SERIALIZABLE_INCLUDING_VIEWS);

  return SortedMultisetTestSuiteBuilder.using(
          new ForwardingTestMultisetGenerator<E>(delegate) {
            @Override
            public SortedMultiset<E> create(Object... entries) {
              return SerializableTester.reserialize(((SortedMultiset<E>) super.create(entries)));
            }
          })
      .named(parentBuilder.getName() + " reserialized")
      .withFeatures(features)
      .suppressing(parentBuilder.getSuppressedTests())
      .createTestSuite();
}
 
Example 4
Project: incubator-netbeans   File: ExpandFolderTest.java   Source Code and License 6 votes vote down vote up
private void iterateTests(TestResult result, StringBuffer times, TestSuite suite, AtomicLong min, AtomicLong max) {
    Enumeration en = suite.tests();
    while (en.hasMoreElements()) {
        Test t = (Test)en.nextElement();
        if (t instanceof Callable) {
            try {
                Long v = (Long)((Callable) t).call();
                long time = v.longValue();
                if (time < min.longValue()) {
                    min.set(time);
                }
                if (time > max.longValue()) {
                    max.set(time);
                }
                // append(t.toString()).append(" value: ")
                times.append("Run: ").append(v).append('\n');
            } catch (Exception ex) {
                result.addError(this, ex);
            }
        }
        if (t instanceof TestSuite) {
            iterateTests(result, times, (TestSuite)t, min, max);
        }
    }
}
 
Example 5
Project: googles-monorepo-demo   File: MultimapTestSuiteBuilder.java   Source Code and License 6 votes vote down vote up
TestSuite computeMultimapAsMapGetTestSuite(
    FeatureSpecificTestSuiteBuilder<
            ?, ? extends OneSizeTestContainerGenerator<M, Map.Entry<K, V>>>
        parentBuilder) {
  Set<Feature<?>> features = computeMultimapAsMapGetFeatures(parentBuilder.getFeatures());
  if (Collections.disjoint(features, EnumSet.allOf(CollectionSize.class))) {
    return new TestSuite();
  } else {
    return CollectionTestSuiteBuilder.using(
            new MultimapAsMapGetGenerator<K, V, M>(parentBuilder.getSubjectGenerator()))
        .withFeatures(features)
        .named(parentBuilder.getName() + ".asMap[].get[key]")
        .suppressing(parentBuilder.getSuppressedTests())
        .createTestSuite();
  }
}
 
Example 6
Project: parabuild-ci   File: SSTestGenericSourceControl.java   Source Code and License 5 votes vote down vote up
/**
 * Required by JUnit
 */
public static TestSuite suite() {
  return new OrderedTestSuite(SSTestGenericSourceControl.class,
          new String[]{
                  "test_getChangesSinceHandlesFirstRun",
                  "test_getChangesSince",
                  "test_label",
                  "test_checkoutLatest",
                  "test_syncToChangeList"
          });
}
 
Example 7
Project: parabuild-ci   File: HttpUnitSuite.java   Source Code and License 5 votes vote down vote up
public static TestSuite suite() {
    TestSuite result = new TestSuite();
    result.addTest( WebPageTest.suite() );
    result.addTest( WebLinkTest.suite() );
    result.addTest( WebImageTest.suite() );
    result.addTest( HtmlTablesTest.suite() );
    result.addTest( WebFormTest.suite() );
    result.addTest( WebFrameTest.suite() );
    result.addTest( WebWindowTest.suite() );
    result.addTest( RequestTargetTest.suite() );
    result.addTest( FormParametersTest.suite() );
    result.addTest( FormSubmitTest.suite() );
    result.addTest( Base64Test.suite() );
    result.addTest( PseudoServerTest.suite() );
    result.addTest( WebClientTest.suite() );
    result.addTest( MessageBodyRequestTest.suite() );
    result.addTest( WebAppletTest.suite() );
    result.addTest( CookieTest.suite() );
    result.addTest( ParsingTestSuite.suite() );
    result.addTest( NormalizeURLTest.suite() );

    if (HTMLParserFactory.getHTMLParser().getClass().getName().indexOf("NekoHTML") >= 0) result.addTest( NekoEnhancedScriptingTest.suite() );
    addOptionalTestCase( result, "com.meterware.httpunit.XMLPageTest" );
    addOptionalTestCase( result, "com.meterware.httpunit.FileUploadTest" );
    addOptionalTestCase( result, "com.meterware.httpunit.javascript.JavaScriptTestSuite" );
    addOptionalTestCase( result, "com.meterware.servletunit.ServletUnitSuite" );
    return result;
}
 
Example 8
Project: guava-mock   File: SortedMapTestSuiteBuilder.java   Source Code and License 5 votes vote down vote up
@Override
public TestSuite createTestSuite() {
  if (!getFeatures().contains(KNOWN_ORDER)) {
    List<Feature<?>> features = Helpers.copyToList(getFeatures());
    features.add(KNOWN_ORDER);
    withFeatures(features);
  }
  return super.createTestSuite();
}
 
Example 9
Project: googles-monorepo-demo   File: ByteSinkTester.java   Source Code and License 5 votes vote down vote up
private static TestSuite suiteForString(String name, ByteSinkFactory factory,
    String string, String desc) {
  byte[] bytes = string.getBytes(Charsets.UTF_8);
  TestSuite suite = suiteForBytes(name, factory, desc, bytes);
  CharSinkFactory charSinkFactory = SourceSinkFactories.asCharSinkFactory(factory);
  suite.addTest(CharSinkTester.suiteForString(name + ".asCharSink[Charset]", charSinkFactory,
      string, desc));
  return suite;
}
 
Example 10
Project: guava-mock   File: MultimapTestSuiteBuilder.java   Source Code and License 5 votes vote down vote up
TestSuite computeValuesTestSuite(
    FeatureSpecificTestSuiteBuilder<
            ?, ? extends OneSizeTestContainerGenerator<M, Map.Entry<K, V>>>
        parentBuilder) {
  return CollectionTestSuiteBuilder.using(
          new ValuesGenerator<K, V, M>(parentBuilder.getSubjectGenerator()))
      .withFeatures(computeValuesFeatures(parentBuilder.getFeatures()))
      .named(parentBuilder.getName() + ".values")
      .suppressing(parentBuilder.getSuppressedTests())
      .createTestSuite();
}
 
Example 11
Project: parabuild-ci   File: SSTestUnittestPPTestLogHandler.java   Source Code and License 5 votes vote down vote up
/**
 * Required by JUnit
 */
public static TestSuite suite() {
  return new OrderedTestSuite(SSTestUnittestPPTestLogHandler.class,
          new String[]{
                  "test_process"
          });
}
 
Example 12
Project: guava-mock   File: SortedSetTestSuiteBuilder.java   Source Code and License 5 votes vote down vote up
@Override
public TestSuite createTestSuite() {
  if (!getFeatures().contains(CollectionFeature.KNOWN_ORDER)) {
    List<Feature<?>> features = Helpers.copyToList(getFeatures());
    features.add(CollectionFeature.KNOWN_ORDER);
    withFeatures(features);
  }
  return super.createTestSuite();
}
 
Example 13
Project: parabuild-ci   File: SSTestSecurityManager.java   Source Code and License 5 votes vote down vote up
/**
 * Required by JUnit
 */
public static TestSuite suite() {
  return new OrderedTestSuite(SSTestSecurityManager.class, new String[]{
          "testFindUsersByEmail",
          "testAssingBuildCreratorBug1440",
          "test_isAllowedToSeeErrors",
          "test_findUsersWithEditRights",
          "test_getUserBuildRights",
          "test_bug1008_securityManagerDoesNotCreateAUserIfItIsInUpperCase",
          "test_getUserResultGroupsReturnEmptyListForAnonymousUser",
          "test_isAnonymousAccessEnabled"
  });
}
 
Example 14
Project: vogar   File: Junit3.java   Source Code and License 5 votes vote down vote up
private static void getTestSuiteTests(List<VogarTest> out, TestSuite suite) {
    for (Object testsOrSuite : suite.getTestsAndSuites()) {
        if (testsOrSuite instanceof Class) {
            getSuiteMethods(out, (Class<?>) testsOrSuite);
        } else if (testsOrSuite instanceof TestCase) {
            out.add(createForTestCase((TestCase) testsOrSuite));
        } else if (testsOrSuite instanceof TestSuite) {
            getTestSuiteTests(out, (TestSuite) testsOrSuite);
        } else if (testsOrSuite != null) {
            out.add(new ConfigurationError(testsOrSuite.getClass().getName() + "#getClass",
                    new IllegalStateException("Unknown test: " + testsOrSuite)));
        }
    }
}
 
Example 15
Project: incubator-netbeans   File: InteceptorTest.java   Source Code and License 5 votes vote down vote up
public static Test createSuite() {
    TestSuite suite = new TestSuite();
    suite.addTest(new InteceptorTest("createNewFile"));
    suite.addTest(new InteceptorTest("createNewFolder"));
    suite.addTest(new InteceptorTest("deleteA_CreateA"));
    suite.addTest(new InteceptorTest("deleteA_CreateAOnDemandLocking"));
    suite.addTest(new InteceptorTest("deleteA_CreateA_RunAtomic"));
    suite.addTest(new InteceptorTest("afterDelete_AfterCreate_194998"));
    return(suite);
}
 
Example 16
Project: domino-todolist   File: AppTest.java   Source Code and License 4 votes vote down vote up
/**
 * @return the suite of tests being tested
 */
public static Test suite()
{
    return new TestSuite( AppTest.class );
}
 
Example 17
Project: SVNAutoMerger   File: AppTest.java   Source Code and License 4 votes vote down vote up
/**
 * @return the suite of tests being tested
 */
public static Test suite()
{
    return new TestSuite( AppTest.class );
}
 
Example 18
Project: Building-Recommendation-Engines   File: AppTest.java   Source Code and License 4 votes vote down vote up
/**
 * @return the suite of tests being tested
 */
public static Test suite()
{
    return new TestSuite( AppTest.class );
}
 
Example 19
Project: KITE   File: EngineTest.java   Source Code and License 4 votes vote down vote up
/**
 * @return the suite of tests being tested
 */
public static Test suite() {
  return new TestSuite(EngineTest.class);
}
 
Example 20
Project: incubator-netbeans   File: DialogDisplayer128399Test.java   Source Code and License 4 votes vote down vote up
public static Test suite() {
    return GraphicsEnvironment.isHeadless() ? new TestSuite() : new TestSuite(DialogDisplayer128399Test.class);
}
 
Example 21
Project: lib-commons-httpclient   File: TestParameterFormatter.java   Source Code and License 4 votes vote down vote up
public static Test suite() {
    return new TestSuite(TestParameterFormatter.class);
}
 
Example 22
Project: hlxy-docker   File: AppTest.java   Source Code and License 4 votes vote down vote up
/**
 * @return the suite of tests being tested
 */
public static Test suite()
{
    return new TestSuite( AppTest.class );
}
 
Example 23
Project: incubator-netbeans   File: CloneableEditorAssociateTest.java   Source Code and License 4 votes vote down vote up
public static Test suite() {
    return GraphicsEnvironment.isHeadless() ? new TestSuite() : new TestSuite(CloneableEditorAssociateTest.class);
}
 
Example 24
Project: jaffa-framework   File: FormPrintEngineiTextImageTest.java   Source Code and License 4 votes vote down vote up
/** Assembles and returns a test suite containing all known tests.
 * @return A test suite.
 */
public static Test suite() {
    return new ContextWrapper(new TestSuite(FormPrintEngineiTextImageTest.class));
}
 
Example 25
Project: parabuild-ci   File: Base64Test.java   Source Code and License 4 votes vote down vote up
public static Test suite() {
    return new TestSuite( Base64Test.class );
}
 
Example 26
Project: incubator-netbeans   File: ExternalChangeOfModifiedFileTest.java   Source Code and License 4 votes vote down vote up
public static Test suite() {
    return GraphicsEnvironment.isHeadless() ? new TestSuite() : new TestSuite(ExternalChangeOfModifiedFileTest.class);
}
 
Example 27
Project: myfaces-trinidad   File: CoreBreadCrumbsTest.java   Source Code and License 4 votes vote down vote up
public static Test suite()
{
  return new TestSuite(CoreBreadCrumbsTest.class);
}
 
Example 28
Project: sbiger-apm   File: AppTest.java   Source Code and License 4 votes vote down vote up
/**
 * @return the suite of tests being tested
 */
public static Test suite()
{
    return new TestSuite( AppTest.class );
}
 
Example 29
Project: spring_mvc_demo   File: AppTest.java   Source Code and License 4 votes vote down vote up
/**
 * @return the suite of tests being tested
 */
public static Test suite()
{
    return new TestSuite( AppTest.class );
}
 
Example 30
Project: incubator-netbeans   File: OffscreenRenderingTest.java   Source Code and License 4 votes vote down vote up
public static Test suite() {
    return GraphicsEnvironment.isHeadless() ? new TestSuite() : new TestSuite(OffscreenRenderingTest.class);
}
 
Example 31
Project: jaffa-framework   File: LobTest.java   Source Code and License 4 votes vote down vote up
/** Assembles and returns a test suite containing all known tests.
 * @return A test suite.
 */
public static Test suite() {
    return new Wrapper(new TestSuite(LobTest.class));
}
 
Example 32
Project: myfaces-trinidad   File: RowKeySetTreeImplTest.java   Source Code and License 4 votes vote down vote up
public static Test suite()
{
  return new TestSuite(RowKeySetTreeImplTest.class);
}
 
Example 33
Project: LogicalDecode   File: AppTest.java   Source Code and License 4 votes vote down vote up
/**
 * @return the suite of tests being tested
 */
public static Test suite()
{
    return new TestSuite( AppTest.class );
}
 
Example 34
Project: incubator-netbeans   File: MultiViewProcessorTest.java   Source Code and License 4 votes vote down vote up
public static Test suite() {
    return GraphicsEnvironment.isHeadless() ? new TestSuite() : new TestSuite(MultiViewProcessorTest.class);
}
 
Example 35
Project: openjdk-jdk10   File: StampedLockTest.java   Source Code and License 4 votes vote down vote up
public static Test suite() {
    return new TestSuite(StampedLockTest.class);
}
 
Example 36
Project: openjdk-jdk10   File: ThreadLocalRandom8Test.java   Source Code and License 4 votes vote down vote up
public static Test suite() {
    return new TestSuite(ThreadLocalRandom8Test.class);
}
 
Example 37
Project: incubator-netbeans   File: TopComponentRegistryTest.java   Source Code and License 4 votes vote down vote up
public static Test suite() {
    return GraphicsEnvironment.isHeadless() ? new TestSuite() : new TestSuite(TopComponentRegistryTest.class);
}
 
Example 38
Project: upgradeToy   File: AppTest.java   Source Code and License 4 votes vote down vote up
/**
 * @return the suite of tests being tested
 */
public static Test suite()
{
    return new TestSuite( AppTest.class );
}
 
Example 39
Project: parabuild-ci   File: HTMLElementTest.java   Source Code and License 4 votes vote down vote up
public static TestSuite suite() {
    return new TestSuite( HTMLElementTest.class );
}
 
Example 40
Project: sc-generator   File: AppTest.java   Source Code and License 4 votes vote down vote up
/**
 * @return the suite of tests being tested
 */
public static Test suite()
{
    return new TestSuite( AppTest.class );
}