[Notice] Announcing the End of Demo Server [Read me]

fix test supporting class error
@905dd19ba9e22c6922dee63c96bfc41c0b2f12dc
--- test/models/ModelTest.java
+++ test/models/ModelTest.java
... | ... | @@ -9,7 +9,7 @@ |
9 | 9 |
import play.mvc.Result; |
10 | 10 |
import play.test.FakeApplication; |
11 | 11 |
import play.test.Helpers; |
12 |
-import support.EbeanUtil; |
|
12 |
+//import support.EbeanUtil; |
|
13 | 13 |
|
14 | 14 |
import java.lang.reflect.ParameterizedType; |
15 | 15 |
|
... | ... | @@ -18,41 +18,43 @@ |
18 | 18 |
|
19 | 19 |
public class ModelTest<T> { |
20 | 20 |
protected static FakeApplication app; |
21 |
- protected static EbeanUtil ebeanUiUtil; |
|
21 |
+// protected static EbeanUtil ebeanUiUtil; |
|
22 | 22 |
protected Class<T> type; |
23 | 23 |
|
24 | 24 |
@SuppressWarnings("unchecked") |
25 | 25 |
public ModelTest() { |
26 | 26 |
this.type = (Class<T>) ((ParameterizedType) getClass().getGenericSuperclass()) |
27 | 27 |
.getActualTypeArguments()[0]; |
28 |
- ebeanUiUtil = new EbeanUtil<T>(type); |
|
28 |
+// ebeanUiUtil = new EbeanUtil<T>(type); |
|
29 | 29 |
} |
30 | 30 |
|
31 |
- @BeforeClass |
|
32 |
- public static void startApp() { |
|
31 |
+// @BeforeClass |
|
32 |
+ @Before |
|
33 |
+ public void startApp() { |
|
33 | 34 |
app = Helpers.fakeApplication(Helpers.inMemoryDatabase()); |
34 | 35 |
Helpers.start(app); |
35 |
- callAction( |
|
36 |
- routes.ref.Application.init() |
|
37 |
- ); |
|
36 |
+// callAction( |
|
37 |
+// routes.ref.Application.init() |
|
38 |
+// ); |
|
38 | 39 |
} |
39 | 40 |
|
40 |
- @AfterClass |
|
41 |
- public static void stopApp() { |
|
41 |
+// @AfterClass |
|
42 |
+ @After |
|
43 |
+ public void stopApp() { |
|
42 | 44 |
Helpers.stop(app); |
43 | 45 |
} |
44 | 46 |
|
45 |
- @Before |
|
46 |
- public void beginTransaction() { |
|
47 |
- Ebean.beginTransaction(); |
|
48 |
- } |
|
49 |
- |
|
50 |
- @After |
|
51 |
- public void rollbackTransaction() { |
|
52 |
- if (Ebean.currentTransaction() != null) { |
|
53 |
- Ebean.rollbackTransaction(); |
|
54 |
- } |
|
55 |
- } |
|
47 |
+// @Before |
|
48 |
+// public void beginTransaction() { |
|
49 |
+// Ebean.beginTransaction(); |
|
50 |
+// } |
|
51 |
+// |
|
52 |
+// @After |
|
53 |
+// public void rollbackTransaction() { |
|
54 |
+// if (Ebean.currentTransaction() != null) { |
|
55 |
+// Ebean.rollbackTransaction(); |
|
56 |
+// } |
|
57 |
+// } |
|
56 | 58 |
|
57 | 59 |
/** |
58 | 60 |
* Returns the first user. (id : 2 / name : hobi) |
... | ... | @@ -93,11 +95,11 @@ |
93 | 95 |
|
94 | 96 |
@SuppressWarnings("unchecked") |
95 | 97 |
protected void flush(T model) { |
96 |
- ebeanUiUtil.flush(model); |
|
98 |
+// ebeanUiUtil.flush(model); |
|
97 | 99 |
} |
98 | 100 |
|
99 | 101 |
protected void flush(Long id) { |
100 |
- ebeanUiUtil.flush(id); |
|
102 |
+// ebeanUiUtil.flush(id); |
|
101 | 103 |
} |
102 | 104 |
|
103 | 105 |
protected void flush() { |
--- test/models/PostTest.java
+++ test/models/PostTest.java
... | ... | @@ -62,7 +62,7 @@ |
62 | 62 |
// Given |
63 | 63 |
// When |
64 | 64 |
Post.delete(1l); |
65 |
- flush(); |
|
65 |
+// flush(); |
|
66 | 66 |
// Then |
67 | 67 |
assertThat(Post.findById(1l)).isNull(); |
68 | 68 |
assertThat(Comment.findById(1l)).isNull(); |
... | ... | @@ -76,7 +76,7 @@ |
76 | 76 |
post.id = 1l; |
77 | 77 |
// When |
78 | 78 |
Post.edit(post); |
79 |
- flush(); |
|
79 |
+// flush(); |
|
80 | 80 |
// Then |
81 | 81 |
Post actual = Post.findById(1l); |
82 | 82 |
assertThat(actual.contents).isEqualTo("수정되었습니다."); |
--- test/support/TestEbeanPlugin.java
+++ test/support/TestEbeanPlugin.java
... | ... | @@ -62,8 +62,9 @@ |
62 | 62 |
for (String load : toLoad) { |
63 | 63 |
load = load.trim(); |
64 | 64 |
if (load.endsWith(".*")) { |
65 |
- classes.addAll(application.getTypesAnnotatedWith(load.substring(0, load.length() - 2), javax.persistence.Entity.class)); |
|
66 |
- classes.addAll(application.getTypesAnnotatedWith(load.substring(0, load.length() - 2), javax.persistence.Embeddable.class)); |
|
65 |
+ |
|
66 |
+// classes.addAll(application.getTypesAnnotatedWith(load.substring(0, load.length() - 2), javax.persistence.Entity.class)); |
|
67 |
+// classes.addAll(application.getTypesAnnotatedWith(load.substring(0, load.length() - 2), javax.persistence.Embeddable.class)); |
|
67 | 68 |
} else { |
68 | 69 |
classes.add(load); |
69 | 70 |
} |
... | ... | @@ -80,7 +81,7 @@ |
80 | 81 |
} |
81 | 82 |
} |
82 | 83 |
|
83 |
- config.add(new TestBeanPersistController()); |
|
84 |
+// config.add(new TestBeanPersistController()); |
|
84 | 85 |
|
85 | 86 |
servers.put(key, EbeanServerFactory.create(config)); |
86 | 87 |
|
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?