Skip to content

Commit 0c129af

Browse files
author
Achim Brandt
committed
fixed tests
1 parent 8b6878d commit 0c129af

File tree

3 files changed

+63
-62
lines changed

3 files changed

+63
-62
lines changed

src/test/java/com/arangodb/ArangoDriverTraversalTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ public void _before() throws ArangoException {
9494
bob.getDocumentHandle());
9595
}
9696

97+
@SuppressWarnings("rawtypes")
9798
@Test
9899
public void test_create_vertex() throws ArangoException {
99100
String edgeCollection = null;

src/test/java/com/arangodb/BaseDocumentTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public void save_document() throws ArangoException {
146146
BaseDocument myDoc1 = new BaseDocument("myKeyFROM", myMap);
147147
Blub myDoc2 = new Blub("myKeyTO", new Blub("blub2", new Blub("blub3", 42)));
148148
DocumentEntity<BaseDocument> v1 = driver.graphCreateVertex(this.graphName, "from", myDoc1, null);
149-
DocumentEntity<Blub> v2 = driver.graphCreateVertex(this.graphName, "to", myDoc2, null);
149+
driver.graphCreateVertex(this.graphName, "to", myDoc2, null);
150150

151151
DocumentEntity<BaseDocument> v1DB = driver.getDocument(v1.getDocumentHandle(), BaseDocument.class);
152152
// DocumentEntity<Blub> v2DB =
@@ -158,7 +158,7 @@ public void save_document() throws ArangoException {
158158
assertThat(v1DB.getDocumentRevision(), is(not(0L)));
159159
assertThat(v1DB.getDocumentKey(), is(notNullValue()));
160160
Map<String, Object> dbProperties = v1DB.getEntity().getProperties();
161-
Object blub = dbProperties.get(key1);
161+
dbProperties.get(key1);
162162

163163
assertThat((String) v1DB.getEntity().getProperties().get(key1), is(val1));
164164
assertThat((Double) v1DB.getEntity().getProperties().get(key2), is(val2));

src/test/java/com/arangodb/NegativeTest.java

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -35,87 +35,87 @@
3535
*/
3636
public class NegativeTest extends BaseTest {
3737

38-
public NegativeTest(ArangoConfigure configure, ArangoDriver driver) {
39-
super(configure, driver);
40-
}
38+
public NegativeTest(ArangoConfigure configure, ArangoDriver driver) {
39+
super(configure, driver);
40+
}
4141

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 {
5050

51-
ArangoConfigure configure = new ArangoConfigure();
51+
ArangoConfigure configure = new ArangoConfigure();
5252

53-
HttpManager httpManager = new HttpManager(configure);
54-
httpManager.init();
53+
HttpManager httpManager = new HttpManager(configure);
54+
httpManager.init();
5555

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);
5959

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));
6464

65-
httpManager.destroy();
65+
httpManager.destroy();
6666

67-
}
67+
}
6868

69-
public static class TestComplex {
70-
private String name;
69+
public static class TestComplex {
70+
private String name;
7171

72-
public String getName() {
73-
return name;
74-
}
72+
public String getName() {
73+
return name;
74+
}
7575

76-
public void setName(String name) {
77-
this.name = name;
76+
public void setName(String name) {
77+
this.name = name;
78+
}
7879
}
79-
}
8080

81-
@Test
82-
public void test_issue_35_and_41() throws Exception {
81+
@Test
82+
public void test_issue_35_and_41() throws Exception {
8383

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);
8787

88-
TestComplex value = new TestComplex();
89-
value.setName("A\"A'@:///A");
88+
TestComplex value = new TestComplex();
89+
value.setName("A\"A'@:///A");
9090

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);
9595

96-
configure.shutdown();
96+
configure.shutdown();
9797

98-
}
98+
}
9999

100-
@Test
101-
public void test_primitive() throws Exception {
100+
@Test
101+
public void test_primitive() throws Exception {
102102

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);
106106

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+
}
116116

117-
configure.shutdown();
117+
configure.shutdown();
118118

119-
}
119+
}
120120

121121
}

0 commit comments

Comments
 (0)