Return-Path: Delivered-To: apmail-incubator-abdera-dev-archive@locus.apache.org Received: (qmail 47047 invoked from network); 7 Feb 2008 17:39:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Feb 2008 17:39:33 -0000 Received: (qmail 30736 invoked by uid 500); 7 Feb 2008 17:39:26 -0000 Delivered-To: apmail-incubator-abdera-dev-archive@incubator.apache.org Received: (qmail 30627 invoked by uid 500); 7 Feb 2008 17:39:26 -0000 Mailing-List: contact abdera-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: abdera-dev@incubator.apache.org Delivered-To: mailing list abdera-dev@incubator.apache.org Received: (qmail 30608 invoked by uid 99); 7 Feb 2008 17:39:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Feb 2008 09:39:25 -0800 X-ASF-Spam-Status: No, hits=-1998.5 required=10.0 tests=ALL_TRUSTED,WEIRD_PORT X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Feb 2008 17:39:16 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id BC67271407C for ; Thu, 7 Feb 2008 09:39:08 -0800 (PST) Message-ID: <5331004.1202405948768.JavaMail.jira@brutus> Date: Thu, 7 Feb 2008 09:39:08 -0800 (PST) From: "Remy Gendron (JIRA)" To: abdera-dev@incubator.apache.org Subject: [jira] Commented: (ABDERA-101) Issue with collection resolved href? In-Reply-To: <4548797.1202242389764.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/ABDERA-101?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1256= 6707#action_12566707 ]=20 Remy Gendron commented on ABDERA-101: ------------------------------------- Sorry, still not working when the servlet context is not root. But it works= for a base other than root. I am providing a patch for the CustomerAdapterTest which tests for the issu= e. > Issue with collection resolved href? > ------------------------------------ > > Key: ABDERA-101 > URL: https://issues.apache.org/jira/browse/ABDERA-101 > Project: Abdera > Issue Type: Bug > Affects Versions: 0.3.0 > Reporter: Remy Gendron > Fix For: 0.4.0 > > Attachments: CustomerAdapterTest-ABDERA-101.patch > > > Hi all, > Am I missing something here? I'm setting up an example project for the de= velopment team.... > I initialize my provider with a base of "/", which is the default value a= nyway. > My adapters are given a relative href (setHref()) when initialized in the= provider. (eg "actors") > I start Jetty in my unit tests with an application context of "/imdb". > The following unit test fails because when I retrieve the HREF property f= or the actors collection it is now an absolute path ("/actors"). > When IRI.resolve(IRI b, IRI c) is called, c is absolute. My collection th= us returns an href of http://localhost:9002/actors instead of http://localh= ost:9002/imdb/actors.=20 > Here's the thread stack: > Thread [main] (Suspended)=09 > =09IRI.resolve(IRI, IRI) line: 442=09 > =09IRI.resolve(IRI) line: 555=09 > =09FOMCollection(FOMElement)._resolve(IRI, IRI) line: 337=09 > =09FOMCollection.getResolvedHref() line: 138=09 > =09ImdbRestTest.testGetService() line: 43=09 > And the unit test: > public class ImdbRestTest extends AbstractRestTest { > @Test > public void testGetService() throws IOException { > ClientResponse resp =3D client.get(getTestBaseURI()); > assertNotNull(resp); > try { > assertEquals(200, resp.getStatus()); > assertEquals(ResponseType.SUCCESS, resp.getType()); > assertTrue(MimeTypeHelper.isMatch(resp.getContentType().toStr= ing(), Constants.APP_MEDIA_TYPE)); > Document doc =3D resp.getDocument(); > try { > // prettyPrint(doc); > } catch (Exception e) { > } > Service service =3D doc.getRoot(); > // prettyPrint(service); > assertEquals(1, service.getWorkspaces().size()); > Workspace workspace =3D service.getWorkspaces().get(0); > assertEquals(3, workspace.getCollections().size()); > for (Collection collection : workspace.getCollections()) { > if (collection.getTitle().startsWith(ImdbConstants.ACTORS= _FEED)) { > assertEquals(getTestBaseURI() + "/" + ImdbConstants.A= CTORS_FEED, collection.getResolvedHref().toString()); > } > } > } finally { > resp.release(); > } > } > } > R=C3=A9my --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.