added test case for UUID-based property parsing

This commit is contained in:
Axel Uhl committed 2012-12-28 11:56:12 +01:00
1 parent ef4de09889
commit 232f93f98f
2 files changed
+22 -3

No files matched your search

@@ -6,17 +6,32 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.util.UUID;
import org.junit.Before;
import org.junit.Test;
import com.sap.sailing.domain.tractracadapter.impl.ClientParamsPHP;
import com.sap.sailing.domain.tractracadapter.impl.ClientParamsPHP.Route;
public class ClientParamsPHPTest {
@Test
public void testRead() throws IOException {
private ClientParamsPHP clientParams;
@Before
public void setUp() throws IOException {
InputStream is = getClass().getResourceAsStream("/clientparamsLahainaTest3.php");
Reader r = new InputStreamReader(is);
ClientParamsPHP clientParams = new ClientParamsPHP(r);
clientParams = new ClientParamsPHP(r);
}
@Test
public void testRead() throws IOException {
assertEquals("event_20110505_SailingTea", clientParams.getEventDB());
}
@Test
public void testRouteFromUUID() {
Route route = clientParams.new Route(UUID.fromString("82be60fa-58cd-11e1-b933-406186cbf87c"));
assertEquals("Lahaina-test3", route.getDescription());
}
}
@@ -105,6 +105,10 @@ public class ClientParamsPHP {
public Route(UUID uuid) {
super(uuid);
}
public Object getDescription() {
return getProperty("Description");
}
}
public class Image extends ObjectWithUUID {