|
35 | 35 | */
|
36 | 36 | public class NegativeTest extends BaseTest {
|
37 | 37 |
|
38 |
| - public NegativeTest(ArangoConfigure configure, ArangoDriver driver) { |
39 |
| - super(configure, driver); |
40 |
| - } |
| 38 | + public NegativeTest(ArangoConfigure configure, ArangoDriver driver) { |
| 39 | + super(configure, driver); |
| 40 | + } |
41 | 41 |
|
42 |
| - /** |
43 |
| - * 開発途中にあった命令だけど、今は存在しない。 きとんとエラーになること。 |
44 |
| - * |
45 |
| - * @throws ArangoException |
46 |
| - */ |
47 |
| - @Ignore |
48 |
| - @Test |
49 |
| - public void test_collections() throws ArangoException { |
| 42 | + /** |
| 43 | + * 開発途中にあった命令だけど、今は存在しない。 きとんとエラーになること。 |
| 44 | + * |
| 45 | + * @throws ArangoException |
| 46 | + */ |
| 47 | + @Ignore |
| 48 | + @Test |
| 49 | + public void test_collections() throws ArangoException { |
50 | 50 |
|
51 |
| - ArangoConfigure configure = new ArangoConfigure(); |
| 51 | + ArangoConfigure configure = new ArangoConfigure(); |
52 | 52 |
|
53 |
| - HttpManager httpManager = new HttpManager(configure); |
54 |
| - httpManager.init(); |
| 53 | + HttpManager httpManager = new HttpManager(configure); |
| 54 | + httpManager.init(); |
55 | 55 |
|
56 |
| - // TODO Create configure of common test. |
57 |
| - HttpResponseEntity res = httpManager.doGet("http://" + configure.getHost() + ":" + configure.getPort() |
58 |
| - + "/_api/collections", null); |
| 56 | + // TODO Create configure of common test. |
| 57 | + HttpResponseEntity res = httpManager.doGet("http://" + configure.getArangoHost().getHost() + ":" |
| 58 | + + configure.getArangoHost().getPort() + "/_api/collections", null); |
59 | 59 |
|
60 |
| - DefaultEntity entity = EntityFactory.createEntity(res.getText(), DefaultEntity.class); |
61 |
| - assertThat(entity.isError(), is(true)); |
62 |
| - assertThat(entity.getCode(), is(501)); |
63 |
| - assertThat(entity.getErrorNumber(), is(9)); |
| 60 | + DefaultEntity entity = EntityFactory.createEntity(res.getText(), DefaultEntity.class); |
| 61 | + assertThat(entity.isError(), is(true)); |
| 62 | + assertThat(entity.getCode(), is(501)); |
| 63 | + assertThat(entity.getErrorNumber(), is(9)); |
64 | 64 |
|
65 |
| - httpManager.destroy(); |
| 65 | + httpManager.destroy(); |
66 | 66 |
|
67 |
| - } |
| 67 | + } |
68 | 68 |
|
69 |
| - public static class TestComplex { |
70 |
| - private String name; |
| 69 | + public static class TestComplex { |
| 70 | + private String name; |
71 | 71 |
|
72 |
| - public String getName() { |
73 |
| - return name; |
74 |
| - } |
| 72 | + public String getName() { |
| 73 | + return name; |
| 74 | + } |
75 | 75 |
|
76 |
| - public void setName(String name) { |
77 |
| - this.name = name; |
| 76 | + public void setName(String name) { |
| 77 | + this.name = name; |
| 78 | + } |
78 | 79 | }
|
79 |
| - } |
80 | 80 |
|
81 |
| - @Test |
82 |
| - public void test_issue_35_and_41() throws Exception { |
| 81 | + @Test |
| 82 | + public void test_issue_35_and_41() throws Exception { |
83 | 83 |
|
84 |
| - ArangoConfigure configure = new ArangoConfigure(); |
85 |
| - configure.init(); |
86 |
| - ArangoDriver driver = new ArangoDriver(configure); |
| 84 | + ArangoConfigure configure = new ArangoConfigure(); |
| 85 | + configure.init(); |
| 86 | + ArangoDriver driver = new ArangoDriver(configure); |
87 | 87 |
|
88 |
| - TestComplex value = new TestComplex(); |
89 |
| - value.setName("A\"A'@:///A"); |
| 88 | + TestComplex value = new TestComplex(); |
| 89 | + value.setName("A\"A'@:///A"); |
90 | 90 |
|
91 |
| - // String value = "AAA"; |
92 |
| - DocumentEntity<?> doc = driver.createDocument("unit_test_issue35", value, true, true); |
93 |
| - String documentHandle = doc.getDocumentHandle(); |
94 |
| - driver.getDocument(documentHandle, TestComplex.class); |
| 91 | + // String value = "AAA"; |
| 92 | + DocumentEntity<?> doc = driver.createDocument("unit_test_issue35", value, true, true); |
| 93 | + String documentHandle = doc.getDocumentHandle(); |
| 94 | + driver.getDocument(documentHandle, TestComplex.class); |
95 | 95 |
|
96 |
| - configure.shutdown(); |
| 96 | + configure.shutdown(); |
97 | 97 |
|
98 |
| - } |
| 98 | + } |
99 | 99 |
|
100 |
| - @Test |
101 |
| - public void test_primitive() throws Exception { |
| 100 | + @Test |
| 101 | + public void test_primitive() throws Exception { |
102 | 102 |
|
103 |
| - ArangoConfigure configure = new ArangoConfigure(); |
104 |
| - configure.init(); |
105 |
| - ArangoDriver driver = new ArangoDriver(configure); |
| 103 | + ArangoConfigure configure = new ArangoConfigure(); |
| 104 | + configure.init(); |
| 105 | + ArangoDriver driver = new ArangoDriver(configure); |
106 | 106 |
|
107 |
| - try { |
108 |
| - String value = "AAA"; |
109 |
| - DocumentEntity<?> doc = driver.createDocument("unit_test_issue35", value, true, true); |
110 |
| - String documentHandle = doc.getDocumentHandle(); |
111 |
| - driver.getDocument(documentHandle, String.class); |
112 |
| - fail(); |
113 |
| - } catch (ArangoException e) { |
114 |
| - assertThat(e.getErrorNumber(), is(ErrorNums.ERROR_ARANGO_DOCUMENT_TYPE_INVALID)); |
115 |
| - } |
| 107 | + try { |
| 108 | + String value = "AAA"; |
| 109 | + DocumentEntity<?> doc = driver.createDocument("unit_test_issue35", value, true, true); |
| 110 | + String documentHandle = doc.getDocumentHandle(); |
| 111 | + driver.getDocument(documentHandle, String.class); |
| 112 | + fail(); |
| 113 | + } catch (ArangoException e) { |
| 114 | + assertThat(e.getErrorNumber(), is(ErrorNums.ERROR_ARANGO_DOCUMENT_TYPE_INVALID)); |
| 115 | + } |
116 | 116 |
|
117 |
| - configure.shutdown(); |
| 117 | + configure.shutdown(); |
118 | 118 |
|
119 |
| - } |
| 119 | + } |
120 | 120 |
|
121 | 121 | }
|
0 commit comments