Categories:
.NET (961)
C (387)
C++ (185)
CSS (84)
DBA (8)
General (31)
HTML (48)
Java (641)
JavaScript (220)
JSP (109)
JUnit (31)
MySQL (297)
Networking (10)
Oracle (562)
Perl (48)
Perl (9)
PHP (259)
PL/SQL (140)
RSS (51)
Software QA (28)
SQL Server (5)
Struts (20)
Unix (2)
Windows (3)
XHTML (199)
XML (59)
Other Resources:
What Is JUnit TestCase?
What Is JUnit TestCase?
✍: FYICenter.com QA Team
JUnit TestCase is the base class, junit.framework.TestCase, used in JUnit 3.8 that allows you to create a test case. TestCase class is no longer supported in JUnit 4.4.
A test case defines the fixture to run multiple tests. To define a test case
Each test runs in its own fixture so there can be no side effects among test runs. Here is an example:
import junit.framework.*; // by FYICenter.com public class MathTest extends TestCase { protected double fValue1; protected double fValue2; protected void setUp() { fValue1= 2.0; fValue2= 3.0; } public void testAdd() { double result= fValue1 + fValue2; assertTrue(result == 5.0); } }
2008-02-26, 5519👍, 0💬
Popular Posts:
.NET INTERVIEW QUESTIONS - Is versioning applicable to private assemblies? Versioning concept is onl...
How To Delete All Rows a Table? - MySQL FAQs - Understanding SQL INSERT, UPDATE and DELETE Statement...
How To Analyze Tables with "mysqlcheck"? - MySQL FAQs - Administrator Tools for Managing MySQL Serve...
When does the compiler not implicitly generate the address of the first element of an array? Wheneve...
If we have the following in a Java code: String s="abc"; String s2="abc"; Then what will be output o...