You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streams.apache.org by ds...@apache.org on 2013/11/15 20:26:41 UTC
svn commit: r1542378 [2/2] - in /incubator/streams/branches/webservice: ./
streams-components/
streams-components/src/main/java/org/apache/streams/components/service/
streams-components/src/main/java/org/apache/streams/components/service/impl/
streams-...
Added: incubator/streams/branches/webservice/streams-persistence/src/test/java/org/apache/streams/persistence/repository/mongo/MongoSubscriptionRepositoryTest.java
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-persistence/src/test/java/org/apache/streams/persistence/repository/mongo/MongoSubscriptionRepositoryTest.java?rev=1542378&view=auto
==============================================================================
--- incubator/streams/branches/webservice/streams-persistence/src/test/java/org/apache/streams/persistence/repository/mongo/MongoSubscriptionRepositoryTest.java (added)
+++ incubator/streams/branches/webservice/streams-persistence/src/test/java/org/apache/streams/persistence/repository/mongo/MongoSubscriptionRepositoryTest.java Fri Nov 15 19:26:40 2013
@@ -0,0 +1,68 @@
+package org.apache.streams.persistence.repository.mongo;
+
+import org.apache.streams.persistence.configuration.MongoConfiguration;
+import org.apache.streams.persistence.model.ActivityStreamsSubscription;
+import org.apache.streams.persistence.model.mongo.MongoSubscription;
+import org.apache.streams.persistence.repository.SubscriptionRepository;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+public class MongoSubscriptionRepositoryTest {
+
+ private SubscriptionRepository repository;
+ private MongoConfiguration configuration;
+ private MongoDatabase database;
+
+ @Before
+ public void setup() {
+ configuration = new MongoConfiguration();
+ configuration.setDbName("testdb1");
+ configuration.setSubscriptionCollectionName("subscriptiontest2");
+ database = new MongoDatabase(configuration);
+ repository = new MongoSubscriptionRepository(database, configuration);
+ }
+
+ @Ignore
+ @Test
+ public void getAllSubscriptionsTest() {
+ List<ActivityStreamsSubscription> subscriptions = repository.getAllSubscriptions();
+ }
+
+ @Ignore
+ @Test
+ public void getSubscriptionByUsernameTest() {
+ ActivityStreamsSubscription subscription = repository.getSubscriptionByUsername("newID2");
+ }
+
+ @Ignore
+ @Test
+ public void getSubscriptionByInRouteTest() {
+ ActivityStreamsSubscription subscription = repository.getSubscriptionByInRoute("randomID2");
+ }
+
+ @Ignore
+ @Test
+ public void addSubscriptionsTest() {
+ ActivityStreamsSubscription subscription = new MongoSubscription();
+ subscription.setUsername("newID3");
+ subscription.setInRoute("randomID3");
+
+ repository.save(subscription);
+ }
+
+ @Ignore
+ @Test
+ public void updateFiltersTest() {
+ Set<String> add = new HashSet<String>(Arrays.asList("three","six"));
+ Set<String> remove = new HashSet<String>(Arrays.asList("eight","seven"));
+
+
+ repository.updateFilters("randomID3", add, remove);
+ }
+}
Modified: incubator/streams/branches/webservice/streams-web/pom.xml
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-web/pom.xml?rev=1542378&r1=1542377&r2=1542378&view=diff
==============================================================================
--- incubator/streams/branches/webservice/streams-web/pom.xml (original)
+++ incubator/streams/branches/webservice/streams-web/pom.xml Fri Nov 15 19:26:40 2013
@@ -84,6 +84,13 @@
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>${javax-servlet.version}</version>
+ <scope>test</scope>
+ </dependency>
+
</dependencies>
<build>
<finalName>streams-web</finalName>