<commit_before>/*
 * Copyright 2001-2008 Artima, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.scalatest.junit

import org.junit.runner.RunWith
import _root_.junit.framework.Assert
import _root_.junit.framework.AssertionFailedError

/**
 * A suite of tests that mimics the syntax of a JUnit 3 <code>TestCase</code>, which can be run with either
 * JUnit 4 or ScalaTest.
 *
 * This trait allows you to write tests with ScalaTest's more concise assertion syntax as well as JUnit-style assertions (<code>assertEquals</code>, etc.).
 * You create tests by defining methods that start with <code>test</code>, and can create fixtures with methods
 * named <code>setUp</code> and <code>tearDown</code>. <code>JUnit3ComfortSuite</code> is intended for people who are
 * familiar with JUnit 3 and want to get started quickly writing tests with ScalaTest. Here's an example:
 *
 * <pre>
 * import org.scalatest.junit.JUnit3ComfortSuite
 * import scala.collection.mutable.ListBuffer
 *
 * class BlastFromThePastSuite extends JUnit3ComfortSuite {
 *
 *   var sb: StringBuilder = _
 *   var lb: ListBuffer[String] = _
 *
 *   override def setUp() {
 *     sb = new StringBuilder("ScalaTest is ")
 *     lb = new ListBuffer[String]
 *   }
 *
 *   def testEasy() {
 *     sb.append("easy!")
 *     assertEquals("ScalaTest is easy!", sb.toString) // JUnit-style assertions
 *     assertTrue(lb.isEmpty)
 *     lb += "sweet"
 *   }
 *
 *   def testFun() {
 *     sb.append("fun!")
 *     assert(sb.toString === "ScalaTest is fun!") // ScalaTest assertions
 *     assert(lb.isEmpty)
 *   }
 * }
 * </pre>
 * 
 * <p>
 * To execute a <code>JUnit3ComfortSuite</code>s with ScalaTest's <code>Runner</code>, you must include a JUnit 4 jar file on the class path or runpath.
 * </p>
 *
 * @author <NAME>
 */
@RunWith(classOf[JUnitRunner])
class JUnit3ComfortSuite extends Suite with OneInstancePerTest {

  /**
   * Defines a method to be run before each of this suite's tests. This trait's implementation
   * of <code>runTest</code> invokes this method before running
   * each test, thus this method can be used to set up a test fixture
   * needed by each test. This trait's implementation of this method does nothing.
   */
  protected def setUp() = ()
  
  /**
   * Defines a method to be run after each of this suite's tests. This trait's implementation
   * of <code>runTest</code> invokes this method after running
   * each test, thus this method can be used to tear down a test fixture
   * needed by each test. This trait's implementation of this method does nothing.
   */<commit_msg>a few more scaladoc tweaks of JUnit3ComfortSuite<commit_after>/*
 * Copyright 2001-2008 Artima, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.scalatest.junit

import org.junit.runner.RunWith
import _root_.junit.framework.Assert
import _root_.junit.framework.AssertionFailedError

/**
 * A suite of tests that mimics the syntax of a JUnit 3 <code>TestCase</code>, which can be run with either
 * JUnit 4 or ScalaTest.
 *
 * This class allows you to write tests with ScalaTest's more concise assertion syntax as well as JUnit-style assertions (<code>assertEquals</code>, etc.).
 * You create tests by defining methods that start with <code>test</code>, and can create fixtures with methods
 * named <code>setUp</code> and <code>tearDown</code>. <code>JUnit3ComfortSuite</code> is intended for people who are
 * familiar with JUnit 3 and want to get started quickly writing tests with ScalaTest. Here's an example:
 *
 * <pre>
 * import org.scalatest.junit.JUnit3ComfortSuite
 * import scala.collection.mutable.ListBuffer
 *
 * class BlastFromThePastSuite extends JUnit3ComfortSuite {
 *
 *   var sb: StringBuilder = _
 *   var lb: ListBuffer[String] = _
 *
 *   override def setUp() {
 *     sb = new StringBuilder("ScalaTest is ")
 *     lb = new ListBuffer[String]
 *   }
 *
 *   def testEasy() { // Uses JUnit-style assertions
 *     sb.append("easy!")
 *     assertEquals("ScalaTest is easy!", sb.toString)
 *     assertTrue(lb.isEmpty)
 *     lb += "sweet"
 *   }
 *
 *   def testFun() { // Uses ScalaTest assertions
 *     sb.append("fun!")
 *     assert(sb.toString === "ScalaTest is fun!")
 *     assert(lb.isEmpty)
 *   }
 * }
 * </pre>
 * 
 * <p>
 * To execute a <code>JUnit3ComfortSuite</code>s with ScalaTest's <code>Runner</code>, you must include a JUnit 4 jar file on the class path or runpath.
 * </p>
 *
 * <p>
 * Note: the reason <code>JUnit3ComfortSuite</code> is not named <code>JUnit3Suite</code> is because that name might imply
 * that an instance of this class is a JUnit 3 <code>TestCase</code>, just as <code>JUnitSuite</code> is an actual JUnit 4 test
 * class and <code>TestNGSuite</code> is an actual TestNG test class. By contrast, a <code>JUnit3ComfortSuite</code> is not actually
 * a JUnit 3 <code>TestCase</code>, it just looks and behaves like one. Thus it gives you that comfortable familiar feeling of
 * programming with JUnit 3, without actually being JUnit 3.
 * </p>
 *
 * @author <NAME>
 */
@RunWith(classOf[JUnitRunner])
class JUnit3ComfortSuite extends Suite with OneInstancePerTest {

  /**
   * Defines a method to be run before each of this suite's tests. This trait's implementation
   * of <code>runTest</code> invokes this method before running
   * each test, thus this method can be used to set up a test fixture
   * needed by each test. This trait's implementation of this method does nothing.
   */
  protected def setUp() = ()
  
  /**
   * Defines a method to be run after each of this suite's tests. This trait's implementation
   * of <code>runTest</code> invokes this method after running
   * each test, thus this method can be used to tear down a test fixture
   * needed by each test. This trait's implementation of this method does nothing.
   */
{'fraction_non_alphanumeric': 0.09726887688038557, 'fraction_numerical': 0.007448517598948445, 'mean_word_length': 3.6427118644067797, 'pattern_counts': {'":': 0, '<': 69, '<?xml version=': 0, '>': 69, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4664557', 'n_tokens_mistral': 2025, 'n_tokens_neox': 1951, 'n_words': 803}