webServer.stop();
}
public void testWrongPasswordPut() throws Exception {
Store store = new MemoryStoreImpl();
ServerBinding serverBinding = new ServerBinding() {
public InetAddress getInetAddress() {
try {
return InetAddress.getByName("localhost");
} catch (UnknownHostException e) {
throw new RuntimeException(e);
}
}
public int getPort() {
return 8686;
}
};
URL sourceURL = new URL("http://"
+ serverBinding.getInetAddress().getHostName() + ":"
+ serverBinding.getPort() + "/danbri");
Source identity = new SourceImpl("http://example.org/tests/identity");
Set<Source> trustedSources = new HashSet<Source>();
trustedSources.add(identity);
NamedNode configuration = new NamedNodeImpl("http://example.org/tests/configuration#");
Model authorizationModel = ModelFactory.createDefaultModel();
Resource user = authorizationModel.createResource(FOAF.Agent);
user.addProperty(ACCOUNTMANAGER.userName, "beta");
user.addProperty(ACCOUNTMANAGER.passwordSha1, Util.sha1("tester"));
user.addProperty(AUTHORIZATION.mayImpersonate, authorizationModel.createResource(sourceURL.toString()));
store.assertGraph(identity, new FCAGraphImpl(authorizationModel));
WebServer webServer = GVSServerLauncher.launchGVSServer(store, serverBinding, identity ,
trustedSources, configuration);
Model model = ModelFactory.createDefaultModel();
model.read(new File("testdata/danbri-20060920123618661.rdf").toURL()