-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathREADME
More file actions
executable file
·78 lines (53 loc) · 2.7 KB
/
README
File metadata and controls
executable file
·78 lines (53 loc) · 2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
IMPORTANT: I don't maintain this project anymore (actually, from a long time ago). For a (not tested by me) fork, see https://github.com/Hazem-Ben-Khalfallah/test-cherry.
Generates Test Cases is a port of Eclipse's generate test cases plugin described here:
http://wiki.openmrs.org/display/archive/Generate+Test+Case+Eclipse+Plugin
This project aims to make it easier to make TDD with a really cool and easy approach that consist in
annotating interface method with desired behaviours like this:
public interface Person {
/**
*
* @return
* @should say hello, and nothing more that that
*/
String sayHello();
}
So with this plugin you could generate a test class for this interface like this one automatically:
import org.junit.Assert;
import org.junit.Test;
public class PersonTest {
/**
* @see Person#sayHello()
* @verifies say hello, and nothing more that that
*/
@Test
public void sayHello_shouldSayHelloAndNothingMoreThatThat() throws Exception {
//TODO auto-generated
Assert.fail("Not yet implemented");
}
}
And then test your implementation code like this
public void sayHello_shouldSayHelloAndNothingMoreThatThat() throws Exception {
assertThat(intance.sayHello(), is("hello world"));
}
This way you can realize that for testing this behaviour you just wrote the should annotation in the sut (system under test) in a really
descriptive way.
/**
*
* @return
* @should say hello, and nothing more that that
*/
String sayHello();
Auto-generated the test class and test method (using the plugin) and then tested the actual expected behaviour with (hamcrest style junit test):
assertThat(intance.sayHello(), is("hello world"));
Nothing more.
Instructions to compile it and run it in development stage
------------------------------------------------------------
By the time it is strongly coupled to Intellij Community Edition 9.0.3, and the folders that contains the plugin files need
to reside in the plugins/ folder in the D:\jaime\intellij\ideaIC-95.429
Furthermore if you want to build and run ideaIC-95.429 you will need to place a jar generated for the plugin because of you have putted
plugin's directory in the same directory that the idea project, and to the time I don't know how to let idea project to build the plugin
for itself.
Another thing needed to run unit tests is to copy java\mockJDK residing in ideaIC-95.429\ to
C:\Documents and Settings\JHABLUTZEL\.IntelliJIdea90\system\plugins-sandbox\test
because when you run a unit test "C:\Documents and Settings\JHABLUTZEL\.IntelliJIdea90\system\plugins-sandbox\" is the home path
for the plugin.