You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by do...@apache.org on 2008/07/18 18:04:11 UTC
svn commit: r677955 - in /incubator/shindig/trunk: ./
java/common/src/main/java/org/apache/shindig/common/ java/server/
java/server/src/test/ java/server/src/test/java/
java/server/src/test/java/org/ java/server/src/test/java/org/apache/
java/server/sr...
Author: doll
Date: Fri Jul 18 09:04:11 2008
New Revision: 677955
URL: http://svn.apache.org/viewvc?rev=677955&view=rev
Log:
SHINDIG-443
Patch from Adam Winer. Includes an initial test setup for running end to end javascript based tests.
Added:
incubator/shindig/trunk/java/server/src/test/
incubator/shindig/trunk/java/server/src/test/java/
incubator/shindig/trunk/java/server/src/test/java/org/
incubator/shindig/trunk/java/server/src/test/java/org/apache/
incubator/shindig/trunk/java/server/src/test/java/org/apache/shindig/
incubator/shindig/trunk/java/server/src/test/java/org/apache/shindig/server/
incubator/shindig/trunk/java/server/src/test/java/org/apache/shindig/server/endtoend/
incubator/shindig/trunk/java/server/src/test/java/org/apache/shindig/server/endtoend/EndToEndModule.java
incubator/shindig/trunk/java/server/src/test/java/org/apache/shindig/server/endtoend/EndToEndTests.java
incubator/shindig/trunk/java/server/src/test/java/org/apache/shindig/server/endtoend/FetchPersonTest.java
incubator/shindig/trunk/java/server/src/test/resources/
incubator/shindig/trunk/java/server/src/test/resources/endtoend/
incubator/shindig/trunk/java/server/src/test/resources/endtoend/fetchPersonTest.xml
incubator/shindig/trunk/java/server/src/test/resources/endtoend/testframework.js
Modified:
incubator/shindig/trunk/java/common/src/main/java/org/apache/shindig/common/BasicSecurityTokenDecoder.java
incubator/shindig/trunk/java/server/pom.xml
incubator/shindig/trunk/java/social-api/pom.xml
incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/canonical/JsonDbOpensocialService.java
incubator/shindig/trunk/pom.xml
Modified: incubator/shindig/trunk/java/common/src/main/java/org/apache/shindig/common/BasicSecurityTokenDecoder.java
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/java/common/src/main/java/org/apache/shindig/common/BasicSecurityTokenDecoder.java?rev=677955&r1=677954&r2=677955&view=diff
==============================================================================
--- incubator/shindig/trunk/java/common/src/main/java/org/apache/shindig/common/BasicSecurityTokenDecoder.java (original)
+++ incubator/shindig/trunk/java/common/src/main/java/org/apache/shindig/common/BasicSecurityTokenDecoder.java Fri Jul 18 09:04:11 2008
@@ -24,6 +24,7 @@
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
+import java.net.URLEncoder;
import java.util.Map;
/**
@@ -42,6 +43,25 @@
private static final int TOKEN_COUNT = MODULE_ID_INDEX + 1;
/**
+ * Encodes a token using the a plaintext dummy format.
+ */
+ public String encodeToken(SecurityToken token) {
+ try {
+ StringBuilder out = new StringBuilder();
+ out.append(URLEncoder.encode(token.getOwnerId(), "UTF-8")).append(':')
+ .append(URLEncoder.encode(token.getViewerId(), "UTF-8")).append(':')
+ .append(URLEncoder.encode(token.getAppId(), "UTF-8")).append(':')
+ .append(URLEncoder.encode(token.getDomain(), "UTF-8")).append(':')
+ .append(URLEncoder.encode(token.getAppUrl(), "UTF-8")).append(':')
+ .append(Long.toString(token.getModuleId()));
+ return out.toString();
+ } catch (UnsupportedEncodingException uee) {
+ throw new IllegalStateException(uee);
+ }
+ }
+
+
+ /**
* {@inheritDoc}
*
* Returns a token with some faked out values.
Modified: incubator/shindig/trunk/java/server/pom.xml
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/java/server/pom.xml?rev=677955&r1=677954&r2=677955&view=diff
==============================================================================
--- incubator/shindig/trunk/java/server/pom.xml (original)
+++ incubator/shindig/trunk/java/server/pom.xml Fri Jul 18 09:04:11 2008
@@ -115,5 +115,15 @@
</dependency>
<!-- external dependencies -->
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>net.sourceforge.htmlunit</groupId>
+ <artifactId>htmlunit</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
Added: incubator/shindig/trunk/java/server/src/test/java/org/apache/shindig/server/endtoend/EndToEndModule.java
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/java/server/src/test/java/org/apache/shindig/server/endtoend/EndToEndModule.java?rev=677955&view=auto
==============================================================================
--- incubator/shindig/trunk/java/server/src/test/java/org/apache/shindig/server/endtoend/EndToEndModule.java (added)
+++ incubator/shindig/trunk/java/server/src/test/java/org/apache/shindig/server/endtoend/EndToEndModule.java Fri Jul 18 09:04:11 2008
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+package org.apache.shindig.server.endtoend;
+
+import com.google.inject.AbstractModule;
+import com.google.inject.name.Names;
+
+import org.apache.shindig.common.servlet.ParameterFetcher;
+import org.apache.shindig.social.canonical.JsonDbOpensocialService;
+import org.apache.shindig.social.dataservice.ActivityService;
+import org.apache.shindig.social.dataservice.AppDataService;
+import org.apache.shindig.social.dataservice.DataServiceServletFetcher;
+import org.apache.shindig.social.dataservice.PersonService;
+
+/**
+ * Guice module for the end-to-end tests.
+ */
+public class EndToEndModule extends AbstractModule {
+
+ protected void configure() {
+ bind(ActivityService.class).to(JsonDbOpensocialService.class);
+ bind(PersonService.class).to(JsonDbOpensocialService.class);
+ bind(AppDataService.class).to(JsonDbOpensocialService.class);
+ bind(String.class).annotatedWith(Names.named("canonical.json.db"))
+ .toInstance("sampledata/canonicaldb.json");
+ bind(ParameterFetcher.class).annotatedWith(Names.named("DataServiceServlet"))
+ .to(DataServiceServletFetcher.class);
+ }
+}
Added: incubator/shindig/trunk/java/server/src/test/java/org/apache/shindig/server/endtoend/EndToEndTests.java
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/java/server/src/test/java/org/apache/shindig/server/endtoend/EndToEndTests.java?rev=677955&view=auto
==============================================================================
--- incubator/shindig/trunk/java/server/src/test/java/org/apache/shindig/server/endtoend/EndToEndTests.java (added)
+++ incubator/shindig/trunk/java/server/src/test/java/org/apache/shindig/server/endtoend/EndToEndTests.java Fri Jul 18 09:04:11 2008
@@ -0,0 +1,159 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+package org.apache.shindig.server.endtoend;
+
+import com.google.common.base.Join;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Maps;
+
+import com.gargoylesoftware.htmlunit.CollectingAlertHandler;
+import com.gargoylesoftware.htmlunit.NicelyResynchronizingAjaxController;
+import com.gargoylesoftware.htmlunit.WebClient;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+
+import org.apache.shindig.common.BasicSecurityToken;
+import org.apache.shindig.common.BasicSecurityTokenDecoder;
+import org.apache.shindig.common.crypto.BlobCrypterException;
+import org.apache.shindig.common.servlet.GuiceServletContextListener;
+import org.apache.shindig.gadgets.servlet.ConcatProxyServlet;
+import org.apache.shindig.gadgets.servlet.GadgetRenderingServlet;
+import org.apache.shindig.gadgets.servlet.HttpGuiceModule;
+import org.apache.shindig.social.dataservice.DataServiceServlet;
+import org.junit.After;
+import org.junit.AfterClass;
+import static org.junit.Assert.assertEquals;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.mortbay.jetty.Server;
+import org.mortbay.jetty.handler.ResourceHandler;
+import org.mortbay.jetty.servlet.Context;
+import org.mortbay.jetty.servlet.ServletHolder;
+import org.mortbay.resource.Resource;
+
+import java.io.IOException;
+import java.net.URL;
+import java.net.URLEncoder;
+import java.util.Map;
+
+/**
+ * Base class for end-to-end tests.
+ */
+public class EndToEndTests {
+
+ private static final int JETTY_PORT = 9003;
+ private static final String GADGET_BASE = "/gadgets/ifr";
+ private static final String JSON_BASE = "/social/rest/*";
+ private static final String CONCAT_BASE = "/gadgets/concat";
+ private static final String SERVER_URL = "http://localhost:" + JETTY_PORT;
+ private static final String GADGET_BASEURL = SERVER_URL + GADGET_BASE;
+
+ static private Server server = null;
+
+ protected WebClient webClient;
+ protected CollectingAlertHandler alertHandler;
+
+ @Before
+ public void setUp() {
+ webClient = new WebClient();
+ // NicelyResynchronizingAjaxController changes XHR calls from asynchronous
+ // to synchronous, saving the test from needing to wait or sleep for XHR
+ // completion.
+ webClient.setAjaxController(new NicelyResynchronizingAjaxController());
+ alertHandler = new CollectingAlertHandler();
+ webClient.setAlertHandler(alertHandler);
+ }
+
+ @After
+ public void verifyTestFinished() {
+ // Verify that the Javascript completed running. This ensures that
+ // logic errors or exceptions don't get treated as success
+ assertEquals(ImmutableList.of("FINISHED"), alertHandler.getCollectedAlerts());
+ }
+
+ @BeforeClass
+ public static void setUpOnce() throws Exception {
+ server = createServer(JETTY_PORT);
+ server.start();
+ }
+
+ @AfterClass
+ public static void tearDownOnce() throws Exception {
+ server.stop();
+ }
+
+ /**
+ * Executes a page test by loading the HTML page.
+ * @param testName name of the test, which must match a gadget XML file
+ * name in test/resources/endtoend (minus .xml).
+ * @param testMethod name of the javascript method to execute
+ * @param token the security token
+ * @return the parsed HTML page
+ */
+ protected HtmlPage executePageTest(String testName, String testMethod, BasicSecurityToken token)
+ throws IOException {
+ String gadgetUrl = SERVER_URL + "/" + testName + ".xml";
+ String url = GADGET_BASEURL + "?url=" + URLEncoder.encode(gadgetUrl, "UTF-8");
+ BasicSecurityTokenDecoder decoder = new BasicSecurityTokenDecoder();
+ url += "&st=" + URLEncoder.encode(decoder.encodeToken(token), "UTF-8");
+ url += "&testMethod=" + URLEncoder.encode(testMethod, "UTF-8");
+ return (HtmlPage) webClient.getPage(url);
+ }
+
+ /**
+ * Starts the server for end-to-end tests.
+ */
+ private static Server createServer(int port) throws Exception {
+ Server newServer = new Server(port);
+
+ // Attach the test resources in /endtoend as static content for the test
+ ResourceHandler resources = new ResourceHandler();
+ URL resource = EndToEndTests.class.getResource("/endtoend");
+ resources.setBaseResource(Resource.newResource(resource));
+ newServer.addHandler(resources);
+
+ Context context = new Context(newServer, "/", Context.SESSIONS);
+ context.addEventListener(new GuiceServletContextListener());
+
+ Map<String, String> initParams = Maps.newHashMap();
+ String modules = Join.join(":",
+ EndToEndModule.class.getName(), HttpGuiceModule.class.getName());
+
+ initParams.put(GuiceServletContextListener.MODULES_ATTRIBUTE, modules);
+ context.setInitParams(initParams);
+
+ // Attach the gadget rendering servlet
+ ServletHolder gadgetServletHolder = new ServletHolder(new GadgetRenderingServlet());
+ context.addServlet(gadgetServletHolder, GADGET_BASE);
+
+ // Attach DataServiceServlet
+ // TODO: also support the Abdera codebase
+ ServletHolder jsonServletHolder = new ServletHolder(new DataServiceServlet());
+ context.addServlet(jsonServletHolder, JSON_BASE);
+
+ // Attach the ConcatProxyServlet - needed for
+ ServletHolder concatHolder = new ServletHolder(new ConcatProxyServlet());
+ context.addServlet(concatHolder, CONCAT_BASE);
+
+ return newServer;
+ }
+
+ protected BasicSecurityToken createToken(String owner, String viewer)
+ throws BlobCrypterException {
+ return new BasicSecurityToken(owner, viewer, "test", "domain", "appUrl", "1");
+ }
+}
Added: incubator/shindig/trunk/java/server/src/test/java/org/apache/shindig/server/endtoend/FetchPersonTest.java
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/java/server/src/test/java/org/apache/shindig/server/endtoend/FetchPersonTest.java?rev=677955&view=auto
==============================================================================
--- incubator/shindig/trunk/java/server/src/test/java/org/apache/shindig/server/endtoend/FetchPersonTest.java (added)
+++ incubator/shindig/trunk/java/server/src/test/java/org/apache/shindig/server/endtoend/FetchPersonTest.java Fri Jul 18 09:04:11 2008
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+package org.apache.shindig.server.endtoend;
+
+import org.apache.shindig.common.BasicSecurityToken;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * End-to-end tests of the newFetchPersonRequest() API.
+ */
+public class FetchPersonTest extends EndToEndTests {
+ private BasicSecurityToken token;
+
+ @Before
+ public void createSecurityToken() throws Exception {
+ token = createToken("canonical", "john.doe");
+ }
+
+ @Test
+ public void fetchPerson() throws Exception {
+ executePageTest("fetchPersonTest", "fetchId", token);
+ }
+
+ @Test
+ public void fetchOwner() throws Exception {
+ executePageTest("fetchPersonTest", "fetchOwner", token);
+ }
+
+ @Test
+ public void fetchViewer() throws Exception {
+ executePageTest("fetchPersonTest", "fetchViewer", token);
+ }
+}
Added: incubator/shindig/trunk/java/server/src/test/resources/endtoend/fetchPersonTest.xml
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/java/server/src/test/resources/endtoend/fetchPersonTest.xml?rev=677955&view=auto
==============================================================================
--- incubator/shindig/trunk/java/server/src/test/resources/endtoend/fetchPersonTest.xml (added)
+++ incubator/shindig/trunk/java/server/src/test/resources/endtoend/fetchPersonTest.xml Fri Jul 18 09:04:11 2008
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<Module>
+ <ModulePrefs title="EndToEndTest">
+ <Require feature="opensocial-0.8" />
+ <Require feature="views" />
+ </ModulePrefs>
+ <Content type="html">
+ <![CDATA[
+ <script type="text/javascript" src="testframework.js"></script>
+ <script type="text/javascript">
+
+ /** Test fetching a specific ID */
+ function fetchId() {
+ var req = opensocial.newDataRequest();
+
+ // Request the "canonical" viewer
+ req.add(req.newFetchPersonRequest("canonical"), "canonical");
+
+ function receivedData(response) {
+ var user = getAndCheckError(response, "canonical");
+ assertEquals("Names don't match",
+ "Sir Shin H. Digg Social Butterfly", user.getDisplayName());
+ testFinished();
+ }
+
+ // Send the request
+ req.send(receivedData);
+ }
+
+ /** Test fetching the owner, which should be "canonical" */
+ function fetchOwner() {
+ var req = opensocial.newDataRequest();
+
+ // Request the "canonical" viewer
+ req.add(req.newFetchPersonRequest(opensocial.IdSpec.PersonId.OWNER), "owner");
+
+ function receivedData(response) {
+ var user = getAndCheckError(response, "owner");
+ assertEquals("Names don't match",
+ "Sir Shin H. Digg Social Butterfly", user.getDisplayName());
+ testFinished();
+ }
+
+ // Send the request
+ req.send(receivedData);
+ }
+
+ /** Test fetching the viewer, which should be "john.doe" */
+ function fetchViewer() {
+ var req = opensocial.newDataRequest();
+
+ // Request the "canonical" viewer
+ req.add(req.newFetchPersonRequest(opensocial.IdSpec.PersonId.VIEWER), "viewer");
+
+ function receivedData(response) {
+ var user = getAndCheckError(response, "viewer");
+ assertEquals("Names don't match",
+ "John Doe", user.getDisplayName());
+
+ testFinished();
+ }
+
+ // Send the request
+ req.send(receivedData);
+ }
+
+ function getAndCheckError(response, key) {
+ assertFalse("Data error", response.hadError());
+ var dataItem = response.get(key);
+ assertFalse("Data item error for " + key, dataItem.hadError());
+ return dataItem.getData();
+ }
+ </script>
+ ]]>
+ </Content>
+</Module>
Added: incubator/shindig/trunk/java/server/src/test/resources/endtoend/testframework.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/java/server/src/test/resources/endtoend/testframework.js?rev=677955&view=auto
==============================================================================
--- incubator/shindig/trunk/java/server/src/test/resources/endtoend/testframework.js (added)
+++ incubator/shindig/trunk/java/server/src/test/resources/endtoend/testframework.js Fri Jul 18 09:04:11 2008
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+function assertTrue(msg, value) {
+ if (!value) {
+ throw "assertTrue() failed: " + msg;
+ }
+}
+
+function assertFalse(msg, value) {
+ if (value) {
+ throw "assertFalse() failed: " + msg;
+ }
+}
+
+function assertEquals(msg, a, b) {
+ if (a != b) {
+ throw "assertEquals() failed: " + msg +
+ "\nExpected \"" + a + "\", was \"" + b + "\"";
+ }
+}
+
+/**
+ * Signals the server code that the test successfully finished. This
+ * method must be called to verify that the test completed successfully,
+ * instead of simply failing to load.
+ */
+function testFinished() {
+ alert("FINISHED");
+}
+
+/** Executes the test identifed by the testMethod URL parameter */
+function executeTest() {
+ // Force the installation of the Restful container
+ // TODO: delete this hack if restful is flipped on by default
+ opensocial.Container.setContainer(new RestfulShindigContainer());
+
+ var params = gadgets.util.getUrlParameters();
+ var testMethod = params["testMethod"];
+ if (!testMethod) {
+ throw "No testMethod parameter found.";
+ }
+
+ var testMethodFunction = window[testMethod];
+ if (!testMethodFunction) {
+ throw "Test method " + testMethod + " not found.";
+ }
+
+ // Execute the test method
+ testMethodFunction();
+}
+
+gadgets.util.registerOnLoadHandler(executeTest);
Modified: incubator/shindig/trunk/java/social-api/pom.xml
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/java/social-api/pom.xml?rev=677955&r1=677954&r2=677955&view=diff
==============================================================================
--- incubator/shindig/trunk/java/social-api/pom.xml (original)
+++ incubator/shindig/trunk/java/social-api/pom.xml Fri Jul 18 09:04:11 2008
@@ -55,8 +55,8 @@
</build>
<dependencies>
+ <!-- project dependencies -->
<dependency>
- <!-- project dependencies -->
<groupId>org.apache.shindig</groupId>
<artifactId>shindig-common</artifactId>
</dependency>
Modified: incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/canonical/JsonDbOpensocialService.java
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/canonical/JsonDbOpensocialService.java?rev=677955&r1=677954&r2=677955&view=diff
==============================================================================
--- incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/canonical/JsonDbOpensocialService.java (original)
+++ incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/canonical/JsonDbOpensocialService.java Fri Jul 18 09:04:11 2008
@@ -33,6 +33,7 @@
import org.apache.shindig.social.opensocial.model.Activity;
import org.apache.shindig.social.opensocial.model.Person;
import org.apache.shindig.social.opensocial.util.BeanConverter;
+import org.apache.shindig.social.opensocial.util.BeanJsonConverter;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
@@ -63,7 +64,7 @@
/**
* The JSON<->Bean converter
*/
- private BeanConverter converter;
+ private BeanJsonConverter converter;
/**
* db["activities"] -> Array<Person>
@@ -87,7 +88,7 @@
@Inject
public JsonDbOpensocialService(@Named("canonical.json.db")String jsonLocation,
- BeanConverter converter) throws Exception {
+ BeanJsonConverter converter) throws Exception {
String content = IOUtils.toString(ResourceLoader.openResource(jsonLocation), "UTF-8");
this.db = new JSONObject(content);
this.converter = converter;
Modified: incubator/shindig/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/pom.xml?rev=677955&r1=677954&r2=677955&view=diff
==============================================================================
--- incubator/shindig/trunk/pom.xml (original)
+++ incubator/shindig/trunk/pom.xml Fri Jul 18 09:04:11 2008
@@ -848,6 +848,11 @@
<artifactId>icu4j</artifactId>
<version>3.8</version>
</dependency>
+ <dependency>
+ <groupId>net.sourceforge.htmlunit</groupId>
+ <artifactId>htmlunit</artifactId>
+ <version>2.1</version>
+ </dependency>
</dependencies>
</dependencyManagement>
</project>