01: /*
02: * Copyright Aduna (http://www.aduna-software.com/) (c) 2007.
03: *
04: * Licensed under the Aduna BSD-style license.
05: */
06:
07: package org.openrdf.http.protocol;
08:
09: import static org.openrdf.http.protocol.Protocol.CONFIG;
10: import static org.openrdf.http.protocol.Protocol.CONTEXTS;
11: import static org.openrdf.http.protocol.Protocol.NAMESPACES;
12: import static org.openrdf.http.protocol.Protocol.PROTOCOL;
13: import static org.openrdf.http.protocol.Protocol.REPOSITORIES;
14: import static org.openrdf.http.protocol.Protocol.getConfigLocation;
15: import static org.openrdf.http.protocol.Protocol.getContextsLocation;
16: import static org.openrdf.http.protocol.Protocol.getNamespacesLocation;
17: import static org.openrdf.http.protocol.Protocol.getProtocolLocation;
18: import static org.openrdf.http.protocol.Protocol.getRepositoriesLocation;
19: import static org.openrdf.http.protocol.Protocol.getRepositoryLocation;
20: import junit.framework.TestCase;
21:
22: public class ProtocolTest extends TestCase {
23:
24: private static final String serverLocation = "http://localhost/openrdf";
25:
26: private static final String repositoryID = "mem-rdf";
27:
28: private static final String repositoryLocation = serverLocation
29: + "/" + REPOSITORIES + "/" + repositoryID;
30:
31: public void testGetProtocolLocation() {
32: String result = getProtocolLocation(serverLocation);
33: assertEquals(result, serverLocation + "/" + PROTOCOL);
34: }
35:
36: public void testGetConfigLocation() {
37: String result = getConfigLocation(serverLocation);
38: assertEquals(result, serverLocation + "/" + CONFIG);
39: }
40:
41: public void testGetRepositoriesLocation() {
42: String result = getRepositoriesLocation(serverLocation);
43: assertEquals(result, serverLocation + "/" + REPOSITORIES);
44: }
45:
46: public void testGetRepositoryLocation() {
47: String result = getRepositoryLocation(serverLocation,
48: repositoryID);
49: assertEquals(result, repositoryLocation);
50: }
51:
52: public void testGetContextsLocation() {
53: String result = getContextsLocation(repositoryLocation);
54: assertEquals(result, repositoryLocation + "/" + CONTEXTS);
55: }
56:
57: public void testGetNamespacesLocation() {
58: String result = getNamespacesLocation(repositoryLocation);
59: assertEquals(result, repositoryLocation + "/" + NAMESPACES);
60: }
61: }
|