Author: glen
Date: Sat Dec 22 18:18:53 2007
New Revision: 11686
Log:
Fix copyright, add JavaDoc and some comments.
Modified:
trunk/registry/modules/core/src/test/java/org/wso2/registry/app/APPTests.java
Modified:
trunk/registry/modules/core/src/test/java/org/wso2/registry/app/APPTests.java
==============================================================================
---
trunk/registry/modules/core/src/test/java/org/wso2/registry/app/APPTests.java
(original)
+++
trunk/registry/modules/core/src/test/java/org/wso2/registry/app/APPTests.java
Sat Dec 22 18:18:53 2007
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ * Copyright (c) 2007, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -38,10 +38,20 @@
import junit.framework.TestCase;
+/**
+ * These tests use a raw HTTP client in order to exercise the APP
implementation of our Registry
+ * server. We do this to make sure that the protocol exactly matches what we
expect; using the
+ * RemoteRegistry (as the JettyBasedServerTest does) is a "black box" test
which only proves the
+ * API works. This test confirms wire-level behavior.
+ *
+ * TODO: WORK IN PROGRESS (Glen)
+ */
public class APPTests extends TestCase {
DefaultServiceContext abderaServiceContext;
public void setUp() throws Exception {
+ // Set up Jetty server
+
abderaServiceContext = new RegistryAPPServiceContext();
RegistryAPPTargetResolver resolver = new RegistryAPPTargetResolver();
abderaServiceContext.setTargetResolver(resolver);
@@ -82,14 +92,20 @@
server.start();
}
- String PORT = "8090";
+ String PORT = "8081";
String BASEURL = "http://localhost:" + PORT + "/wso2registry/atom/";
public String buildURL(String path) {
return BASEURL + path;
}
- public void testCreation() throws Exception {
+ /**
+ * Run through a series of actions against a clean registry, and confirm
the results
+ * match our expectations.
+ *
+ * @throws Exception if there's a problem
+ */
+ public void testProtocol() throws Exception {
// Note - every URL below is rooted at our Registry's atom root
// GET the root - empty dir
@@ -103,9 +119,10 @@
// GET /d1 - 404
method = new GetMethod(buildURL("d1"));
responseCode = client.executeMethod(method);
- assertEquals(404, responseCode);
+ assertEquals(404, responseCode); // Nothing there yet!
// GET /foo;tags - 404
+ // Make sure metadata indicator doesn't change error code
method = new GetMethod(buildURL("foo;tags"));
responseCode = client.executeMethod(method);
assertEquals(404, responseCode);
_______________________________________________
Registry-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/registry-dev