ASF Bugzilla – Attachment 24251 Details for
Bug 47803
Support for JUnit 4.x tests defined by annotations
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
test case using JUnit 4.x annotations
DummyAnnotatedTest.java (text/plain), 908 bytes, created by
Brian
on 2009-09-11 11:54:39 UTC
(
hide
)
Description:
test case using JUnit 4.x annotations
Filename:
MIME Type:
Creator:
Brian
Created:
2009-09-11 11:54:39 UTC
Size:
908 bytes
patch
obsolete
>package test; > >import org.junit.After; >import org.junit.Before; >import org.junit.Test; > >public class DummyAnnotatedTest >{ > public String name; > public int two = 1; //very wrong. > > public DummyAnnotatedTest() { > name="NOT SET"; > } > public DummyAnnotatedTest(String name) { > this.name = name; > } > > @Test(expected=RuntimeException.class) > public void fail() { > throw new RuntimeException(); > } > > @Before > public void verifyTwo() { > two = 2; > } > > @After > public void printDone() { > System.out.println("done with an annotated test."); > } > > @Test > public void add() { > int four = two+2; > if(4!=four) { > throw new RuntimeException("4 did not equal four."); > } > //or if you have assertions enabled > assert 4 == four; > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 47803
:
24229
|
24250
|
24251
|
24257
|
24259
|
24260