Skip to content

Commit 1ee9ab1

Browse files
committed
Seperated the tests into different pacakges
1 parent 76ee292 commit 1ee9ab1

13 files changed

Lines changed: 76 additions & 83 deletions

pom.xml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>com.dkhenry</groupId>
77
<artifactId>rethinkjava</artifactId>
8-
<version>0.8-SNAPSHOT</version>
8+
<version>0.8</version>
99
<packaging>jar</packaging>
1010

1111
<name>rethinkjava</name>
@@ -130,7 +130,16 @@
130130
</goals>
131131
</execution>
132132
</executions>
133-
</plugin>
133+
</plugin>
134+
<plugin>
135+
<groupId>org.apache.maven.plugins</groupId>
136+
<artifactId>maven-surefire-plugin</artifactId>
137+
<configuration>
138+
<parallel>methods</parallel>
139+
<threadCount>1</threadCount>
140+
<groups>acceptance, regression</groups>
141+
</configuration>
142+
</plugin>
134143
</plugins>
135144
</build>
136145
<pluginRepositories>
1 MB
Binary file not shown.
1 MB
Binary file not shown.
1 MB
Binary file not shown.

rethinkdb_data/auth_metadata

1 MB
Binary file not shown.
1 MB
Binary file not shown.

rethinkdb_data/log_file

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2014-02-20T07:16:47.971207000 0.004396s info: Creating directory /Users/dan/svn-src/rethinkjava/rethinkdb_data
2+
2014-02-20T07:16:47.971376000 0.004564s info: Creating a default database for your convenience. (This is because you ran 'rethinkdb' without 'create', 'serve', or '--join', and the directory '/Users/dan/svn-src/rethinkjava/rethinkdb_data' did not already exist.)
3+
2014-02-20T07:16:47.971428000 0.004617s info: Running rethinkdb 1.11.2 (CLANG 5.0 (clang-500.2.79))...
4+
2014-02-20T07:16:47.977816000 0.011004s info: Running on Darwin 13.0.2 x86_64
5+
2014-02-20T07:16:47.977847000 0.011035s info: Loading data from directory /Users/dan/svn-src/rethinkjava/rethinkdb_data
6+
2014-02-20T07:16:48.103768000 0.136956s info: Listening for intracluster connections on port 29015
7+
2014-02-20T07:16:48.104959000 0.138147s info: Listening for client driver connections on port 28015
8+
2014-02-20T07:16:48.104986000 0.138174s info: Listening for administrative HTTP connections on port 8080
9+
2014-02-20T07:16:48.104989000 0.138177s info: Listening on addresses: 127.0.0.1, ::1
10+
2014-02-20T07:16:48.104990000 0.138178s info: To fully expose RethinkDB on the network, bind to all addresses
11+
2014-02-20T07:16:48.104990000 0.138178s info: by running rethinkdb with the `--bind all` command line option.
12+
2014-02-20T07:16:48.104991000 0.138179s info: Server ready

rethinkdb_data/metadata

3 MB
Binary file not shown.

src/test/java/com/dkhenry/CompletnessTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public Iterator<Object[]> termTypes() {
3434
return types.iterator();
3535
}
3636

37-
@Test(dataProvider="termTypeNames")
37+
@Test(dataProvider="termTypeNames",groups={"acceptance"})
3838
public void testTermImplementation(String type) throws ClassNotFoundException{
3939
try {
4040
Class.forName("com.dkhenry.RethinkDB.RqlQuery$"+type);

src/test/java/com/dkhenry/ConnectionTest.java

Lines changed: 31 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class ConnectionTest {
1616
static int SECONDARY_PORT=28016;
1717
static int SECURED_PORT=28016;
1818

19-
@Test
19+
@Test(groups={"acceptance"})
2020
public void testConnection(){
2121
boolean rvalue = false;
2222
try {
@@ -28,7 +28,7 @@ public void testConnection(){
2828
AssertJUnit.assertFalse("Error Connecting", rvalue);
2929
}
3030

31-
@Test
31+
@Test(groups={"acceptance"})
3232
public void testSecuredConnection() {
3333
boolean rvalue = false;
3434
try {
@@ -40,7 +40,7 @@ public void testSecuredConnection() {
4040
AssertJUnit.assertFalse("Error connecting with secured connection",rvalue);
4141
}
4242

43-
@Test
43+
@Test(groups={"acceptance"})
4444
public void testHostname() {
4545
boolean rvalue = false;
4646
RqlConnection r;
@@ -56,7 +56,7 @@ public void testHostname() {
5656
AssertJUnit.assertFalse("Error Connecting", rvalue);
5757
}
5858

59-
@Test
59+
@Test(groups={"acceptance"})
6060
public void testPort() {
6161
boolean rvalue = false;
6262
RqlConnection r;
@@ -72,78 +72,45 @@ public void testPort() {
7272
AssertJUnit.assertFalse("Error Connecting", rvalue);
7373
}
7474

75-
@Test
75+
@Test(groups={"acceptance"})
7676
public void testReconnect() {
7777
boolean rvalue = false;
7878
RqlConnection r;
7979
try {
8080
r = RqlConnection.connect("localhost",PRIMARY_PORT);
8181
r.set_port(SECONDARY_PORT);
82-
r.set_hostname(InetAddress.getLocalHost().getCanonicalHostName());
82+
r.set_hostname("127.0.0.1");
8383
r.close();
8484
}
8585
catch (RqlDriverException e) {
86+
System.out.println("Driver Exception: " + e.getMessage());
8687
rvalue = true;
8788
}
88-
catch (UnknownHostException e) {
89-
rvalue = true;
90-
}
91-
AssertJUnit.assertTrue("Error Connecting", rvalue);
89+
AssertJUnit.assertFalse("Error Connecting", rvalue);
9290
}
9391

9492
/* Test the functionality of the ten minute Introduction */
95-
@Test
96-
public void testDatabaseCreate() {
93+
@Test(groups={"demo"})
94+
public void testDatabaseActions() {
9795
boolean rvalue = false;
9896
RqlConnection r;
9997
try {
10098
r = RqlConnection.connect("localhost",PRIMARY_PORT);
10199
//r.db_create('superheroes').run(conn)
102100
RqlCursor cursor = r.run(r.db_create("superheroes"));
101+
r.run(r.db_list());
102+
r.run(r.db_drop("superheroes")).toString();
103103
r.close();
104104
}
105105
catch (RqlDriverException e) {
106106
e.printStackTrace();
107107
rvalue = true;
108108
}
109-
AssertJUnit.assertFalse("Error Creating Database", rvalue);
110-
}
111-
112-
@Test
113-
public void testDatabaseList() {
114-
boolean rvalue = false;
115-
RqlConnection r;
116-
try {
117-
r = RqlConnection.connect("localhost",PRIMARY_PORT);
118-
//r.db_list().run(conn)
119-
r.run(r.db_list());
120-
r.close();
121-
}
122-
catch (RqlDriverException e) {
123-
e.printStackTrace();
124-
rvalue = true;
125-
}
126-
AssertJUnit.assertFalse("Error Listing Databases", rvalue);
127-
}
128-
129-
@Test
130-
public void testDatabaseDrop() {
131-
boolean rvalue = false;
132-
RqlConnection r;
133-
try {
134-
r = RqlConnection.connect("localhost",PRIMARY_PORT);
135-
//r.db_drop('superheroes').run(conn)
136-
r.run(r.db_drop("superheroes")).toString();
137-
r.close();
138-
}
139-
catch (RqlDriverException e) {
140-
e.printStackTrace();
141-
rvalue = true;
142-
}
143-
AssertJUnit.assertFalse("Error Droping Databases", rvalue);
109+
AssertJUnit.assertFalse("Error Manipulating Database", rvalue);
144110
}
111+
145112

146-
@Test
113+
@Test(groups={"demo"})
147114
public void testTableCreate() {
148115
boolean rvalue = false;
149116
RqlConnection r;
@@ -161,17 +128,17 @@ public void testTableCreate() {
161128
}
162129
AssertJUnit.assertFalse("Error Creating Table", rvalue);
163130
}
164-
165-
@Test
131+
132+
@Test(groups={"demo"})
166133
public void testTableList() {
167134
boolean rvalue= false ;
168135
RqlConnection r;
169136
try {
170137
r = RqlConnection.connect("localhost",PRIMARY_PORT);
171138
// r.db('test').table_list().run(conn)
172-
r.run(r.db_create("test12345"));
173-
r.run(r.db("test12345").table_list());
174-
r.run(r.db_drop("test12345"));
139+
r.run(r.db_create("test123456"));
140+
r.run(r.db("test123456").table_list());
141+
r.run(r.db_drop("test123456"));
175142
r.close();
176143
}
177144
catch (RqlDriverException e) {
@@ -181,37 +148,37 @@ public void testTableList() {
181148
AssertJUnit.assertFalse("Error Listing Tables", rvalue);
182149
}
183150

184-
@Test
151+
@Test(groups={"demo"})
185152
public void testTableDrop() {
186153
boolean rvalue = false;
187154
RqlConnection r;
188155
try {
189156
r = RqlConnection.connect("localhost",PRIMARY_PORT);
190157
// r.db('test').table_drop('dc_universe').run(conn)
191-
r.run(r.db_create("test12345"));
192-
r.run(r.db("test12345").table_create("dc_universe"));
193-
r.run(r.db("test12345").table_drop("dc_universe"));
194-
r.run(r.db_drop("test12345"));
158+
r.run(r.db_create("test1234567"));
159+
r.run(r.db("test1234567").table_create("dc_universe"));
160+
r.run(r.db("test1234567").table_drop("dc_universe"));
161+
r.run(r.db_drop("test1234567"));
195162
r.close();
196163
}
197164
catch (RqlDriverException e) {
198165
e.printStackTrace();
199166
rvalue = true;
200167
}
201-
AssertJUnit.assertFalse("Error Droping Table", rvalue);
168+
AssertJUnit.assertFalse("Error Dropping Table", rvalue);
202169
}
203170

204-
@Test
171+
@Test(groups={"demo"})
205172
public void testTable() {
206173
boolean rvalue = false;
207174
RqlConnection r;
208175
try {
209176
r = RqlConnection.connect("localhost",PRIMARY_PORT);
210-
r.run(r.db_create("test123456"));
211-
r.run(r.db("test123456").table_create("dc_universe"));
177+
r.run(r.db_create("test12345678"));
178+
r.run(r.db("test12345678").table_create("dc_universe"));
212179
r.table("dc_universe");
213-
r.run(r.db("test123456").table_drop("dc_universe"));
214-
r.run(r.db_drop("test123456"));
180+
r.run(r.db("test12345678").table_drop("dc_universe"));
181+
r.run(r.db_drop("test12345678"));
215182
r.close();
216183
}
217184
catch (RqlDriverException e) {

0 commit comments

Comments
 (0)