Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
Run Sample with junit-3.8.1.jar in Text Mode
How to run sample program with junit-3.8.1.jar in text mode? I have Calculator.java and the JUnit test program, CalculatorTest.java ready.
✍: FYIcenter.com
junit-3.8.1.jar is the version 3.8.1 of JUnit JAR library file.
It provides two execution modes: text mode and GUI mode.
To run the JUnit test program, CalculatorTest.java in text mode, you need launch the junit.textui.TestRunner class and specify the test program class as the parameter:
\fyicenter>java -version
java version "1.8.0_45"
\fyicenter>java -cp .;\local\lib\junit-3.8.1.jar
junit.textui.TestRunner CalculatorTest
.E.F.
Time: 0.003
There was 1 error:
1) testSubtraction(CalculatorTest)java.lang.NumberFormatException:
For input string: "10-1"
at sun.misc.FloatingDecimal.readJavaFormatString
(FloatingDecimal.java:2043)
at sun.misc.FloatingDecimal.parseFloat(FloatingDecimal.java:122)
at java.lang.Float.parseFloat(Float.java:451)
at java.lang.Float.valueOf(Float.java:416)
at Calculator.evaluate(Calculator.java:6)
at CalculatorTest.testSubtraction(CalculatorTest.java:16)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:43)
There was 1 failure:
1) testFraction(CalculatorTest)junit.framework.AssertionFailedError:
expected:<5> but was:<4>
at CalculatorTest.testFraction(CalculatorTest.java:12)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:43)
FAILURES!!!
Tests run: 3, Failures: 1, Errors: 1
The output shows that:
⇒ Run Sample with junit-3.8.1.jar in GUI Mode
2016-03-09, ∼3113🔥, 0💬
Popular Posts:
What Is activation.jar? I heard it's related to JAF (JavaBeans Activation Framework) 1.0.2? The if y...
JDK 17 jdk.internal.vm.ci.jmod is the JMOD file for JDK 17 Internal VM CI module. JDK 17 Internal VM...
SLF4J API is a simple API that allows to plug in any desired logging library at deployment time. Her...
JDK 17 java.sql.jmod is the JMOD file for JDK 17 SQL (Structured Query Language) module. JDK 17 SQL ...
What Is mail.jar of JavaMail 1.3? I got the JAR file from javamail-1_3.zip. mail.jar in javamail-1_3...