Commit 47a097e5 authored by Ricco Førgaard's avatar Ricco Førgaard

Sanity checked level 1 and 2.

One test in level 2 still needs a proper search term.
parent aa2535bf
......@@ -26,7 +26,7 @@ public class Level01 {
public void connectToNesstarServer() {
Server server = null;
assertEquals("nina", server.getId());
assertEquals("Tutorial", server.getId());
}
/**
......
......@@ -38,19 +38,16 @@ public class Level02 {
}
/**
* Do a simple search for the term "vegetables". It should
* return 2 hits.
* Do a simple search for the term "vegetables". Retrieve one
* of the results.
*
*/
@Test
public void performSimpleSearch() {
SearchQuery query = new SearchQuery();
SearchResult result = null;
SearchResultItem<NesstarObject> object = null;
List<SearchResultItem> hits = result.getListOfHits();
assertEquals(2, hits.size());
SearchResultItem<NesstarObject> object = hits.get(0);
assertEquals("How often: eat fruit or vegetables", object.getLabel());
assertTrue(object.getLabel().indexOf("vegetables") > -1);
}
/**
......@@ -71,7 +68,7 @@ public class Level02 {
/**
* If your search returns many hits, you can tell the
* search query to limit the number of results. Try
* searching for the term "<very common term here>" and
* searching for the term "health" and
* limit the results to 5 hits.
*/
@Test
......@@ -84,8 +81,10 @@ public class Level02 {
/**
* This time you need to do a more complex search. The term
* to search for is "<some term>" but you must use the exclude
* to search for is "medicine" but you must use the exclude
* method to narrow your search down to 1 result.
*
* Tip: You can call exclude more than one time.
*/
@Test
public void searchWithBooleanOperators() {
......@@ -96,9 +95,10 @@ public class Level02 {
}
/**
* Now you must find all studies that were authored by
* Han Solo.
* Hint: use the DDI, Luke!
* Now you must find all studies that are about the
* topic "health".
*
* Tip: use the DDI.
*/
@Test
public void searchInSpecificDDIelements() {
......@@ -106,13 +106,15 @@ public class Level02 {
SearchResult result = null;
assertEquals(1, result.getListOfHits().size());
//assert that author is Han Solo
// If you're up to it try to extract the value of
// the topic classification from the result element.
}
/**
* Finally a challenge. Using the knowlede from the previous
* lessons, you must find 4 variables that have something to
* do with "<term>".
* do with "school".
*/
@Test
public void findOnlyVariables() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment