You are viewing a plain text version of this content. The canonical link for it is here.
Posted to photark-commits@incubator.apache.org by lr...@apache.org on 2011/01/30 07:11:55 UTC
svn commit: r1065202 -
/incubator/photark/branches/photark-rest/photark-jcr/src/test/java/org/apache/photark/services/jcr/JCRSubscriptionCollectionTestCase.java
Author: lresende
Date: Sun Jan 30 07:11:55 2011
New Revision: 1065202
URL: http://svn.apache.org/viewvc?rev=1065202&view=rev
Log:
Fixing test failures
Modified:
incubator/photark/branches/photark-rest/photark-jcr/src/test/java/org/apache/photark/services/jcr/JCRSubscriptionCollectionTestCase.java
Modified: incubator/photark/branches/photark-rest/photark-jcr/src/test/java/org/apache/photark/services/jcr/JCRSubscriptionCollectionTestCase.java
URL: http://svn.apache.org/viewvc/incubator/photark/branches/photark-rest/photark-jcr/src/test/java/org/apache/photark/services/jcr/JCRSubscriptionCollectionTestCase.java?rev=1065202&r1=1065201&r2=1065202&view=diff
==============================================================================
--- incubator/photark/branches/photark-rest/photark-jcr/src/test/java/org/apache/photark/services/jcr/JCRSubscriptionCollectionTestCase.java (original)
+++ incubator/photark/branches/photark-rest/photark-jcr/src/test/java/org/apache/photark/services/jcr/JCRSubscriptionCollectionTestCase.java Sun Jan 30 07:11:55 2011
@@ -6,15 +6,15 @@
* 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.
+ * under the License.
*/
package org.apache.photark.services.jcr;
@@ -35,14 +35,14 @@ import org.junit.Test;
public class JCRSubscriptionCollectionTestCase {
private static Node node;
private static SubscriptionCollection subscriptions;
-
+
@BeforeClass
public static void BeforeClass() {
try {
String contribution = ContributionLocationHelper.getContributionLocation("gallery.composite");
node = NodeFactory.newInstance().createNode("gallery.composite", new Contribution("gallery", contribution));
node.start();
-
+
subscriptions = node.getService(SubscriptionCollection.class, "SubscriptionComponent");
} catch (Exception e) {
e.printStackTrace();
@@ -53,26 +53,28 @@ public class JCRSubscriptionCollectionTe
public static void AfterClass() {
node.stop();
}
-
+
@Test
public void testAddSubscription() throws Exception {
SubscriptionConfig subscription = new SubscriptionConfig();
subscription.setTitle("Test 01");
subscription.setType("flickr");
subscription.setUrl("http://api.flickr.com/services/feeds/photos_public.gne?id=24662369@N07&lang=en-us&format=atom");
-
+
subscriptions.post(subscription.getTitle(), subscription);
-
+
subscriptions.getAll();
}
-
+
@Test
public void testUpdateSubscription() throws Exception {
SubscriptionConfig subscription = new SubscriptionConfig();
subscription.setTitle("Test 02");
subscription.setType("flickr");
subscription.setUrl("http://localhost/xxx");
-
+
+ subscriptions.post(subscription.getTitle(), subscription);
+
try {
subscriptions.get(subscription.getTitle());
} catch(NotFoundException nf) {
@@ -80,13 +82,13 @@ public class JCRSubscriptionCollectionTe
}
subscriptions.post(subscription.getTitle(), subscription);
-
+
subscription.setUrl("http://api.flickr.com/services/feeds/photos_public.gne?id=24662369@N07&lang=en-us&format=atom");
-
+
subscriptions.post(subscription.getTitle(), subscription);
-
+
SubscriptionConfig subscritionRead = subscriptions.get(subscription.getTitle());
-
+
Assert.assertEquals(subscription.getTitle(), subscritionRead.getTitle());
}
}