Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

tests refactor

  • Loading branch information...
commit c729d052b24ac1e69535c0c18f20f31b3f3f5885 1 parent 94435e7
@ldsimonassi authored
View
5 src/test/groovy/MergerTest.groovy → src/test/groovy/individual/MergerTest.groovy
@@ -1,10 +1,11 @@
+package individual
import org.junit.Test;
import search.MergeBolt.Merger
import search.model.Item
import java.util.ArrayList
+import org.junit.Assert
-
-public class MergerTest extends AbstractStormTest {
+public class MergerTest extends Assert {
@Test
public void mergerMaintainsMaxSize() {
View
5 src/test/groovy/SearchBucketTests.groovy → ...roovy/individual/SearchBucketTests.groovy
@@ -1,8 +1,11 @@
+package individual
+
import org.junit.Test
import search.model.Item
import search.model.ItemsShard
+import org.junit.Assert
-public class SearchBucketTest extends AbstractStormTest {
+public class SearchBucketTest extends Assert {
@Test
public void searchShard() {
ItemsShard myShard= new ItemsShard(20);
View
13 src/test/groovy/AbstractStormTest.groovy → ...tion/AbstractSearchIntegrationTest.groovy
@@ -1,3 +1,5 @@
+package integration
+
import search.utils.LocalTopologyStarter
import search.SearchEngineTopologyStarter
import backtype.storm.LocalCluster;
@@ -8,7 +10,7 @@ import org.junit.After
import org.junit.Assert
-public abstract class AbstractStormTest extends Assert {
+public abstract class AbstractSearchIntegrationTest extends Assert {
def itemsApiClient
def searchEngineApiClient
def newsFeedApiClient
@@ -37,15 +39,16 @@ public abstract class AbstractStormTest extends Assert {
newsFeedApiClient = new RESTClient('http://127.0.0.1:9090')
clearItemsApi()
}
-
+
+
+ /**
+ * Integration testing helpers.
+ */
public void clearItemsApi() {
def resp= itemsApiClient.delete(path : "/")
assertEquals(resp.status, 200)
}
- /**
- * Testing Utilities...
- **/
public void addItem(int id, String title, int price) {
def document = "/${id}.json"
def toSend = [:]
View
3  src/test/groovy/PreparationTest.groovy → ...y/integration/EnvironmentSetUpTest.groovy
@@ -1,6 +1,7 @@
+package integration
import org.junit.Test;
-class PreparationTest extends AbstractStormTest {
+class EnvironmentSetUpTest extends AbstractSearchIntegrationTest {
@Test
public void itemsApiExists(){
View
3  src/test/groovy/SearchTest.groovy → ...test/groovy/integration/SearchTest.groovy
@@ -1,6 +1,7 @@
+package integration
import org.junit.Test;
-public class SearchTest extends AbstractStormTest {
+public class SearchTest extends AbstractSearchIntegrationTest {
@Test
public void newsFeedTest() {
Please sign in to comment.
Something went wrong with that request. Please try again.