Package org.apache.james.mailbox.store.user.model.impl

Examples of org.apache.james.mailbox.store.user.model.impl.SimpleSubscription


     */
    @Test
    public void testFindMailboxSubscriptionForUser() throws Exception {
        LOG.info("findMailboxSubscriptionForUser");

        final SimpleSubscription fake1 = new SimpleSubscription("user1", "FAKEBOX");
        final SimpleSubscription fake2 = new SimpleSubscription("fakeUser", "INBOX");

        for (String user : subscriptionList.keySet()) {
            LOG.info("Searching for all subscriptions for user:{}", user);
            for (SimpleSubscription subscription : subscriptionList.get(user)) {
                final Subscription result = mapper.findMailboxSubscriptionForUser(user, subscription.getMailbox());
                assertEquals(subscription.getMailbox(), result.getMailbox());
                assertEquals(subscription.getUser(), result.getUser());
            }
        }
        assertNull(mapper.findMailboxSubscriptionForUser(fake1.getUser(), fake1.getMailbox()));
        assertNull(mapper.findMailboxSubscriptionForUser(fake2.getUser(), fake2.getMailbox()));
    }
View Full Code Here


     * HBaseSubscriptionMapper.
     */
    @Test
    public void testFindSubscriptionsForUser() throws Exception {
        LOG.info("findSubscriptionsForUser");
        final SimpleSubscription fake1 = new SimpleSubscription("user1", "FAKEBOX");
        final SimpleSubscription fake2 = new SimpleSubscription("fakeUser", "INBOX");
        for (String user : subscriptionList.keySet()) {
            LOG.info("Searching for all subscriptions for user: " + user);
            final List<Subscription> found = mapper.findSubscriptionsForUser(user);
            assertEquals(subscriptionList.get(user).size(), found.size());
            // TODO: patch Subscription to implement equals
            //assertTrue(subscriptionList.get(user).containsAll(foundSubscriptions));
            //assertTrue(foundSubscriptions.containsAll(subscriptionList.get(user)));
            //assertFalse(foundSubscriptions.contains(fake1));
            //assertFalse(foundSubscriptions.contains(fake2));
        }
        //TODO: check what value we should return in case of no subscriptions: null or empty list
        assertEquals(mapper.findSubscriptionsForUser(fake2.getMailbox()).size(), 0);

    }
View Full Code Here

TOP

Related Classes of org.apache.james.mailbox.store.user.model.impl.SimpleSubscription

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.