Commit 16da69a6 authored by Ricco Førgaard's avatar Ricco Førgaard

Sanitized level 4.

parent c419f4ee
package com.nesstar.tutorial;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.util.List;
......@@ -25,7 +26,7 @@ import com.nesstar.api.Study;
* All references to DDI elements are also denoted by
* their index value (e.g. 4.0 for dataDscr).
*
* Remember that Nesstar currently uses DDI 1.2.2.
* Remember that Nesstar currently uses DDI version 1.2.2.
*
*/
public class Level04 {
......@@ -34,7 +35,7 @@ public class Level04 {
/**
* Connect to the server and get the study with
* ID "some id".
* ID "NSD1907".
*/
@Before
public void connectToServerAndGetStudy() {
......@@ -48,7 +49,7 @@ public class Level04 {
public void findTitle() {
String title = null;
assertEquals("Some title", title);
assertTrue(title.indexOf("International survey on health and health care") > -1);
}
/**
......@@ -58,7 +59,7 @@ public class Level04 {
public void getTheFileID() {
String id = null;
assertEquals("some id", id);
assertEquals("NSD1907.NSDstat", id);
}
/**
......@@ -69,41 +70,9 @@ public class Level04 {
public void getKeywords() {
List<String> keywords = null;
assertEquals(4, keywords.size());
assertEquals("France", keywords.get(0));
}
/**
* Find all of the variables (4.2) and count them.
*/
@Test
public void countTheNumberOfVariables() {
int numberOfVariables = -1;
assertEquals(117, numberOfVariables);
}
/**
* Find the variable with ID "some id" using XPath lookup
* and get the contents of the labl (4.2.2) element of that
* variable.
*/
@Test
public void findSpecificVariable() {
String label = null;
assertEquals("some label", label);
}
/**
* Make a list of the categories of the variable with
* ID "Region"
*/
@Test
public void makeAListOfCategories() {
List<String> categories = null;
assertEquals(10, categories.size());
assertEquals("Galway East", categories.get(20));
assertEquals(9, keywords.size());
assertEquals("Economics", keywords.get(4));
}
// Feel free to experiment with other parts of the DDI.
}
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