james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adup...@apache.org
Subject [01/13] james-project git commit: JAMES-1733 Remove generics from mailbox API
Date Tue, 17 May 2016 08:14:47 GMT
Repository: james-project
Updated Branches:
  refs/heads/master 52153c42f -> 7015d9461


http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/server/protocols/jmap/src/test/java/org/apache/james/jmap/utils/SortToComparatorConvertorTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/utils/SortToComparatorConvertorTest.java
b/server/protocols/jmap/src/test/java/org/apache/james/jmap/utils/SortToComparatorConvertorTest.java
index b735410..a3e138b 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/utils/SortToComparatorConvertorTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/utils/SortToComparatorConvertorTest.java
@@ -28,7 +28,6 @@ import java.util.List;
 
 import javax.mail.Flags;
 
-import org.apache.james.mailbox.store.TestId;
 import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 import org.apache.james.mailbox.store.mail.model.impl.PropertyBuilder;
 import org.apache.james.mailbox.store.mail.model.impl.SimpleMailboxMessage;
@@ -40,61 +39,55 @@ import com.google.common.collect.Lists;
 
 public class SortToComparatorConvertorTest {
 
-    private List<SimpleMailboxMessage<TestId>> messages;
-    private SimpleMailboxMessage<TestId> firstMessage;
-    private SimpleMailboxMessage<TestId> secondMessage;
+    private List<SimpleMailboxMessage> messages;
+    private SimpleMailboxMessage firstMessage;
+    private SimpleMailboxMessage secondMessage;
 
     @Before
-    @SuppressWarnings("unchecked")
     public void setup() {
         LocalDate date = LocalDate.now();
-        firstMessage = new SimpleMailboxMessage<>(new Date(date.toEpochDay()), 0, 0,
null, new Flags(), new PropertyBuilder(), null);
+        firstMessage = new SimpleMailboxMessage(new Date(date.toEpochDay()), 0, 0, null,
new Flags(), new PropertyBuilder(), null);
         firstMessage.setUid(1);
-        secondMessage = new SimpleMailboxMessage<>(new Date(date.plusDays(1).toEpochDay()),
0, 0, null, new Flags(), new PropertyBuilder(), null);
+        secondMessage = new SimpleMailboxMessage(new Date(date.plusDays(1).toEpochDay()),
0, 0, null, new Flags(), new PropertyBuilder(), null);
         secondMessage.setUid(2);
         messages = Lists.newArrayList(firstMessage, secondMessage);
     }
 
     @Test
-    @SuppressWarnings("unchecked")
     public void comparatorForShouldBeInitialOrderWhenEmptyList() {
-        Comparator<SimpleMailboxMessage<TestId>> comparator = SortToComparatorConvertor.comparatorFor(ImmutableList.of());
+        Comparator<SimpleMailboxMessage> comparator = SortToComparatorConvertor.comparatorFor(ImmutableList.of());
         messages.sort(comparator);
         assertThat(messages).containsExactly(firstMessage, secondMessage);
     }
 
     @Test
-    @SuppressWarnings("unchecked")
     public void comparatorForShouldBeDescByDateWhenOnlyDateInList() {
-        Comparator<MailboxMessage<TestId>> comparator = SortToComparatorConvertor.comparatorFor(ImmutableList.of("date"));
+        Comparator<MailboxMessage> comparator = SortToComparatorConvertor.comparatorFor(ImmutableList.of("date"));
         messages.sort(comparator);
         assertThat(messages).containsExactly(secondMessage, firstMessage);
     }
 
     @Test
-    @SuppressWarnings("unchecked")
     public void comparatorForShouldBeDescByDateWhenOnlyDateDescInList() {
-        Comparator<MailboxMessage<TestId>> comparator = SortToComparatorConvertor.comparatorFor(ImmutableList.of("date
desc"));
+        Comparator<MailboxMessage> comparator = SortToComparatorConvertor.comparatorFor(ImmutableList.of("date
desc"));
         messages.sort(comparator);
         assertThat(messages).containsExactly(secondMessage, firstMessage);
     }
 
     @Test
-    @SuppressWarnings("unchecked")
     public void comparatorForShouldBeAscByDateWhenOnlyDateAscInList() {
-        Comparator<MailboxMessage<TestId>> comparator = SortToComparatorConvertor.comparatorFor(ImmutableList.of("date
asc"));
+        Comparator<MailboxMessage> comparator = SortToComparatorConvertor.comparatorFor(ImmutableList.of("date
asc"));
         messages.sort(comparator);
         assertThat(messages).containsExactly(firstMessage, secondMessage);
     }
 
     @Test
-    @SuppressWarnings("unchecked")
     public void comparatorForShouldChainComparatorsWhenOnlyMultipleElementInList() {
-        SimpleMailboxMessage<TestId> thirdMessage = new SimpleMailboxMessage<>(secondMessage.getInternalDate(),
0, 0, null, new Flags(), new PropertyBuilder(), null);
+        SimpleMailboxMessage thirdMessage = new SimpleMailboxMessage(secondMessage.getInternalDate(),
0, 0, null, new Flags(), new PropertyBuilder(), null);
         thirdMessage.setUid(3);
         messages.add(thirdMessage);
 
-        Comparator<MailboxMessage<TestId>> comparator = SortToComparatorConvertor.comparatorFor(ImmutableList.of("date
asc", "id desc"));
+        Comparator<MailboxMessage> comparator = SortToComparatorConvertor.comparatorFor(ImmutableList.of("date
asc", "id desc"));
         messages.sort(comparator);
         assertThat(messages).containsExactly(firstMessage, thirdMessage, secondMessage);
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/server/protocols/protocols-pop3/src/test/java/org/apache/james/pop3server/POP3ServerTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/protocols-pop3/src/test/java/org/apache/james/pop3server/POP3ServerTest.java
b/server/protocols/protocols-pop3/src/test/java/org/apache/james/pop3server/POP3ServerTest.java
index abe4e0d..537fc82 100644
--- a/server/protocols/protocols-pop3/src/test/java/org/apache/james/pop3server/POP3ServerTest.java
+++ b/server/protocols/protocols-pop3/src/test/java/org/apache/james/pop3server/POP3ServerTest.java
@@ -46,7 +46,6 @@ import org.apache.james.mailbox.acl.MailboxACLResolver;
 import org.apache.james.mailbox.acl.SimpleGroupMembershipResolver;
 import org.apache.james.mailbox.acl.UnionMailboxACLResolver;
 import org.apache.james.mailbox.exception.MailboxException;
-import org.apache.james.mailbox.inmemory.InMemoryId;
 import org.apache.james.mailbox.inmemory.InMemoryMailboxSessionMapperFactory;
 import org.apache.james.mailbox.model.MailboxConstants;
 import org.apache.james.mailbox.model.MailboxPath;
@@ -74,7 +73,7 @@ public class POP3ServerTest {
     private POP3Client pop3Client = null;
     protected MockFileSystem fileSystem;
     protected MockProtocolHandlerLoader protocolHandlerChain;
-    private StoreMailboxManager<InMemoryId> mailboxManager;
+    private StoreMailboxManager mailboxManager;
     private final byte[] content = ("Return-path: return@test.com\r\n"
             + "Content-Transfer-Encoding: plain\r\n"
             + "Subject: test\r\n\r\n"
@@ -713,7 +712,7 @@ public class POP3ServerTest {
         InMemoryMailboxSessionMapperFactory factory = new InMemoryMailboxSessionMapperFactory();
         MailboxACLResolver aclResolver = new UnionMailboxACLResolver();
         GroupMembershipResolver groupMembershipResolver = new SimpleGroupMembershipResolver();
-        mailboxManager = new StoreMailboxManager<InMemoryId>(factory, new Authenticator()
{
+        mailboxManager = new StoreMailboxManager(factory, new Authenticator() {
     
             @Override
             public boolean isAuthentic(String userid, CharSequence passwd) {


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message