[jira] [Commented] (JAMES-1611) site points to a deprecated Nightly Build repository
[ https://issues.apache.org/jira/browse/JAMES-1611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14964631#comment-14964631 ] ASF GitHub Bot commented on JAMES-1611: --- Github user aduprat closed the pull request at: https://github.com/apache/james/pull/9 > site points to a deprecated Nightly Build repository > > > Key: JAMES-1611 > URL: https://issues.apache.org/jira/browse/JAMES-1611 > Project: James Server > Issue Type: Bug > Components: Documentation >Affects Versions: Trunk >Reporter: Matthieu Baechler > > There is a "Nightly Build" link that go to > https://repository.apache.org/content/repositories/snapshots/org/apache/james/apache-james/ > put this repository has not been updated since 2012. > I suggest to remove this link. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Commented] (MAILBOX-253) Provide the option to use Hystrix on top of all IO operations
[ https://issues.apache.org/jira/browse/MAILBOX-253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14963641#comment-14963641 ] ASF GitHub Bot commented on MAILBOX-253: Github user chibenwa closed the pull request at: https://github.com/apache/james-mpt/pull/3 > Provide the option to use Hystrix on top of all IO operations > - > > Key: MAILBOX-253 > URL: https://issues.apache.org/jira/browse/MAILBOX-253 > Project: James Mailbox > Issue Type: New Feature >Reporter: Tellier Benoit > > Mailbox implementations needed for JAMES-1623 > I introduced a new module for hystrix mailbox. > Implementation is made at the mapper level, and wraps a > MailboxSessionMapperFactory. > Quota stuff is also handled. Idem for Subscriptions and search indexes. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Commented] (MAILBOX-253) Provide the option to use Hystrix on top of all IO operations
[ https://issues.apache.org/jira/browse/MAILBOX-253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14963639#comment-14963639 ] ASF GitHub Bot commented on MAILBOX-253: Github user chibenwa closed the pull request at: https://github.com/apache/james/pull/11 > Provide the option to use Hystrix on top of all IO operations > - > > Key: MAILBOX-253 > URL: https://issues.apache.org/jira/browse/MAILBOX-253 > Project: James Mailbox > Issue Type: New Feature >Reporter: Tellier Benoit > > Mailbox implementations needed for JAMES-1623 > I introduced a new module for hystrix mailbox. > Implementation is made at the mapper level, and wraps a > MailboxSessionMapperFactory. > Quota stuff is also handled. Idem for Subscriptions and search indexes. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Resolved] (JAMES-1609) JMX unregister of queues : some queues are ignored.
[ https://issues.apache.org/jira/browse/JAMES-1609?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Tellier Benoit resolved JAMES-1609. --- Resolution: Fixed Thanks to Matthieu Baechler. > JMX unregister of queues : some queues are ignored. > --- > > Key: JAMES-1609 > URL: https://issues.apache.org/jira/browse/JAMES-1609 > Project: James Server > Issue Type: Bug > Components: Queue >Affects Versions: Trunk >Reporter: Tellier Benoit > Fix For: Trunk > > > The @PreDestoy method called look like this : > ``` > for ( String mbean : mbeans) { > unregister(mbean); > mbeans.remove(mbean); > } > ``` > Causing mbeans being ignored and not unregistered. > Solution is to simply not modify collection content while working on it and > simply clear it outside the for loop. > Acceptance criteria : > - Being able to launch a James server, stop it and restart it. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Commented] (JAMES-1609) JMX unregister of queues : some queues are ignored.
[ https://issues.apache.org/jira/browse/JAMES-1609?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14963433#comment-14963433 ] Matthieu Baechler commented on JAMES-1609: -- [~BTellier] please close this JIRA, it's merged. > JMX unregister of queues : some queues are ignored. > --- > > Key: JAMES-1609 > URL: https://issues.apache.org/jira/browse/JAMES-1609 > Project: James Server > Issue Type: Bug > Components: Queue >Affects Versions: Trunk >Reporter: Tellier Benoit > Fix For: Trunk > > > The @PreDestoy method called look like this : > ``` > for ( String mbean : mbeans) { > unregister(mbean); > mbeans.remove(mbean); > } > ``` > Causing mbeans being ignored and not unregistered. > Solution is to simply not modify collection content while working on it and > simply clear it outside the for loop. > Acceptance criteria : > - Being able to launch a James server, stop it and restart it. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Commented] (JAMES-1603) cli should not depend on james-server-spring
[ https://issues.apache.org/jira/browse/JAMES-1603?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14963430#comment-14963430 ] ASF GitHub Bot commented on JAMES-1603: --- Github user mbaechler closed the pull request at: https://github.com/apache/james/pull/2 > cli should not depend on james-server-spring > > > Key: JAMES-1603 > URL: https://issues.apache.org/jira/browse/JAMES-1603 > Project: James Server > Issue Type: Bug > Components: CLI >Reporter: Matthieu Baechler > > cli depends on james-server-spring to access MailboxCopierManagementMBean > interface. > It's probably a simple mistake to fix, MBeans are usually into data-api > module, we should have to move MailboxCopierManagementMBean to data-api too. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Closed] (JAMES-1603) cli should not depend on james-server-spring
[ https://issues.apache.org/jira/browse/JAMES-1603?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Matthieu Baechler closed JAMES-1603. > cli should not depend on james-server-spring > > > Key: JAMES-1603 > URL: https://issues.apache.org/jira/browse/JAMES-1603 > Project: James Server > Issue Type: Bug > Components: CLI >Reporter: Matthieu Baechler > > cli depends on james-server-spring to access MailboxCopierManagementMBean > interface. > It's probably a simple mistake to fix, MBeans are usually into data-api > module, we should have to move MailboxCopierManagementMBean to data-api too. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Commented] (JAMES-1609) JMX unregister of queues : some queues are ignored.
[ https://issues.apache.org/jira/browse/JAMES-1609?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14963426#comment-14963426 ] ASF GitHub Bot commented on JAMES-1609: --- Github user mbaechler closed the pull request at: https://github.com/apache/james-project/pull/5 > JMX unregister of queues : some queues are ignored. > --- > > Key: JAMES-1609 > URL: https://issues.apache.org/jira/browse/JAMES-1609 > Project: James Server > Issue Type: Bug > Components: Queue >Affects Versions: Trunk >Reporter: Tellier Benoit > Fix For: Trunk > > > The @PreDestoy method called look like this : > ``` > for ( String mbean : mbeans) { > unregister(mbean); > mbeans.remove(mbean); > } > ``` > Causing mbeans being ignored and not unregistered. > Solution is to simply not modify collection content while working on it and > simply clear it outside the for loop. > Acceptance criteria : > - Being able to launch a James server, stop it and restart it. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1709428 - in /james/project/trunk: queue/ queue/queue-jms/ queue/queue-jms/src/ queue/queue-jms/src/test/ queue/queue-jms/src/test/java/ queue/queue-jms/src/test/java/org/ queue/queue-jms
Author: matthieu Date: Mon Oct 19 15:00:26 2015 New Revision: 1709428 URL: http://svn.apache.org/viewvc?rev=1709428&view=rev Log: JAMES-1609 Correct MBean un registry for mail queue factories Added: james/project/trunk/queue/ james/project/trunk/queue/queue-jms/ james/project/trunk/queue/queue-jms/src/ james/project/trunk/queue/queue-jms/src/test/ james/project/trunk/queue/queue-jms/src/test/java/ james/project/trunk/queue/queue-jms/src/test/java/org/ james/project/trunk/queue/queue-jms/src/test/java/org/apache/ james/project/trunk/queue/queue-jms/src/test/java/org/apache/james/ james/project/trunk/queue/queue-jms/src/test/java/org/apache/james/queue/ james/project/trunk/queue/queue-jms/src/test/java/org/apache/james/queue/library/ james/project/trunk/queue/queue-jms/src/test/java/org/apache/james/queue/library/AbstractMailQueueFactoryTest.java Modified: james/project/trunk/server/queue/queue-jms/pom.xml james/project/trunk/server/queue/queue-jms/src/main/java/org/apache/james/queue/library/AbstractMailQueueFactory.java Added: james/project/trunk/queue/queue-jms/src/test/java/org/apache/james/queue/library/AbstractMailQueueFactoryTest.java URL: http://svn.apache.org/viewvc/james/project/trunk/queue/queue-jms/src/test/java/org/apache/james/queue/library/AbstractMailQueueFactoryTest.java?rev=1709428&view=auto == --- james/project/trunk/queue/queue-jms/src/test/java/org/apache/james/queue/library/AbstractMailQueueFactoryTest.java (added) +++ james/project/trunk/queue/queue-jms/src/test/java/org/apache/james/queue/library/AbstractMailQueueFactoryTest.java Mon Oct 19 15:00:26 2015 @@ -0,0 +1,140 @@ +/ + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information* + * regarding copyright ownership. The ASF licenses this file * + * 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. * + / + +package org.apache.james.queue.library; + +import static org.mockito.Mockito.*; + +import org.apache.james.queue.api.MailQueue; +import org.apache.james.queue.api.ManageableMailQueue; +import org.apache.mailet.Mail; +import org.junit.Before; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.management.InstanceNotFoundException; +import javax.management.MBeanServer; +import javax.management.ObjectName; +import java.util.concurrent.TimeUnit; + +public class AbstractMailQueueFactoryTest { + +private static final Logger LOGGER = LoggerFactory.getLogger(AbstractMailQueueFactoryTest.class); +private static final String QUEUE_1 = "queue1"; +private static final String QUEUE_2 = "queue2"; +private static final String QUEUE_3 = "queue3"; + +private AbstractMailQueueFactory abstractMailQueueFactory; +private MBeanServer mBeanServer; + +@Before +public void setUp() { +mBeanServer = mock(MBeanServer.class); +abstractMailQueueFactory = new AbstractMailQueueFactory() { +@Override +protected MailQueue createMailQueue(String name) { +return new ManageableMailQueue() { + +@Override +public void enQueue(Mail mail, long delay, TimeUnit unit) throws MailQueueException { + +} + +@Override +public void enQueue(Mail mail) throws MailQueueException { + +} + +@Override +public MailQueueItem deQueue() throws MailQueueException { +return null; +} + +@Override +public long getSize() throws MailQueueException { +return 0; +} + +@Override +public long flush() throws MailQueueException { +return 0; +} + +
[jira] [Commented] (JAMES-1609) JMX unregister of queues : some queues are ignored.
[ https://issues.apache.org/jira/browse/JAMES-1609?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14963406#comment-14963406 ] ASF GitHub Bot commented on JAMES-1609: --- GitHub user mbaechler opened a pull request: https://github.com/apache/james-project/pull/5 JAMES-1609 Correct MBean un registry for mail queue factories You can merge this pull request into a Git repository by running: $ git pull https://github.com/mbaechler/james-project JAMES-1609 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/james-project/pull/5.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #5 commit a561614c9296a24b379bf841a2af6f98992c48e0 Author: benwa Date: 2015-09-08T09:44:46Z JAMES-1609 Correct MBean un registry for mail queue factories > JMX unregister of queues : some queues are ignored. > --- > > Key: JAMES-1609 > URL: https://issues.apache.org/jira/browse/JAMES-1609 > Project: James Server > Issue Type: Bug > Components: Queue >Affects Versions: Trunk >Reporter: Tellier Benoit > Fix For: Trunk > > > The @PreDestoy method called look like this : > ``` > for ( String mbean : mbeans) { > unregister(mbean); > mbeans.remove(mbean); > } > ``` > Causing mbeans being ignored and not unregistered. > Solution is to simply not modify collection content while working on it and > simply clear it outside the for loop. > Acceptance criteria : > - Being able to launch a James server, stop it and restart it. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Commented] (JAMES-1609) JMX unregister of queues : some queues are ignored.
[ https://issues.apache.org/jira/browse/JAMES-1609?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14963407#comment-14963407 ] ASF GitHub Bot commented on JAMES-1609: --- Github user mbaechler closed the pull request at: https://github.com/apache/james/pull/8 > JMX unregister of queues : some queues are ignored. > --- > > Key: JAMES-1609 > URL: https://issues.apache.org/jira/browse/JAMES-1609 > Project: James Server > Issue Type: Bug > Components: Queue >Affects Versions: Trunk >Reporter: Tellier Benoit > Fix For: Trunk > > > The @PreDestoy method called look like this : > ``` > for ( String mbean : mbeans) { > unregister(mbean); > mbeans.remove(mbean); > } > ``` > Causing mbeans being ignored and not unregistered. > Solution is to simply not modify collection content while working on it and > simply clear it outside the for loop. > Acceptance criteria : > - Being able to launch a James server, stop it and restart it. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Closed] (MPT-33) Support optional features when running mpt tests
[ https://issues.apache.org/jira/browse/MPT-33?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Matthieu Baechler closed MPT-33. Resolution: Fixed merged > Support optional features when running mpt tests > > > Key: MPT-33 > URL: https://issues.apache.org/jira/browse/MPT-33 > Project: James MPT > Issue Type: Improvement > Components: Main >Reporter: Matthieu Baechler > > MAILBOX-241 basically says : "I wrote some tests but it breaks on maildir > because maildir doesn't have namespace support". > I think this kind of feature set mismatch between backends is going to happen > as we move on with generic tests. > I propose to introduce feature conditioned tests in mpt to workaround this > kind of problems. > Come is coming soon. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Closed] (MPT-32) external-james should only run when JAMES_ADDRESS is defined
[ https://issues.apache.org/jira/browse/MPT-32?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Matthieu Baechler closed MPT-32. Resolution: Fixed merged > external-james should only run when JAMES_ADDRESS is defined > > > Key: MPT-32 > URL: https://issues.apache.org/jira/browse/MPT-32 > Project: James MPT > Issue Type: Bug > Components: Main >Reporter: Matthieu Baechler > > External-james should run against a freshly compile James to check basic > behaviour. It should not run unless JAMES_ADDRESS environnement entry is set. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Closed] (MPT-31) cyrus mpt tests are unreliable
[ https://issues.apache.org/jira/browse/MPT-31?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Matthieu Baechler closed MPT-31. Resolution: Fixed merged > cyrus mpt tests are unreliable > -- > > Key: MPT-31 > URL: https://issues.apache.org/jira/browse/MPT-31 > Project: James MPT > Issue Type: Bug > Components: Main >Reporter: Matthieu Baechler > > Cyrus tests are very time-sensitive : they run well with some timing between > container creation and container usage. > There's a loop to wait for service start but it seems broken. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1709412 - in /james/project/trunk/mpt/core/src: main/java/org/apache/james/mpt/api/ImapFeatures.java test/java/org/apache/james/mpt/api/ImapFeaturesTest.java
Author: matthieu Date: Mon Oct 19 13:19:50 2015 New Revision: 1709412 URL: http://svn.apache.org/viewvc?rev=1709412&view=rev Log: MPT-33 fix missing licenses Modified: james/project/trunk/mpt/core/src/main/java/org/apache/james/mpt/api/ImapFeatures.java james/project/trunk/mpt/core/src/test/java/org/apache/james/mpt/api/ImapFeaturesTest.java Modified: james/project/trunk/mpt/core/src/main/java/org/apache/james/mpt/api/ImapFeatures.java URL: http://svn.apache.org/viewvc/james/project/trunk/mpt/core/src/main/java/org/apache/james/mpt/api/ImapFeatures.java?rev=1709412&r1=1709411&r2=1709412&view=diff == --- james/project/trunk/mpt/core/src/main/java/org/apache/james/mpt/api/ImapFeatures.java (original) +++ james/project/trunk/mpt/core/src/main/java/org/apache/james/mpt/api/ImapFeatures.java Mon Oct 19 13:19:50 2015 @@ -1,3 +1,21 @@ +/ + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information* + * regarding copyright ownership. The ASF licenses this file * + * 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. * + / package org.apache.james.mpt.api; import java.util.Set; Modified: james/project/trunk/mpt/core/src/test/java/org/apache/james/mpt/api/ImapFeaturesTest.java URL: http://svn.apache.org/viewvc/james/project/trunk/mpt/core/src/test/java/org/apache/james/mpt/api/ImapFeaturesTest.java?rev=1709412&r1=1709411&r2=1709412&view=diff == --- james/project/trunk/mpt/core/src/test/java/org/apache/james/mpt/api/ImapFeaturesTest.java (original) +++ james/project/trunk/mpt/core/src/test/java/org/apache/james/mpt/api/ImapFeaturesTest.java Mon Oct 19 13:19:50 2015 @@ -1,3 +1,21 @@ +/ + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information* + * regarding copyright ownership. The ASF licenses this file * + * 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. * + / package org.apache.james.mpt.api; import org.apache.james.mpt.api.ImapFeatures.Feature; - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1709409 - in /james/project/trunk/mpt: antlib/src/main/java/org/apache/james/mpt/ant/ app/src/main/java/org/apache/james/mpt/app/ core/ core/src/main/java/org/apache/james/mpt/api/ core/s
Author: matthieu Date: Mon Oct 19 13:04:34 2015 New Revision: 1709409 URL: http://svn.apache.org/viewvc?rev=1709409&view=rev Log: MPT-33 introduce namespace support feature and run related tests only when supported This uses junit Assume that allowes to disable a test when a condition if false. ImapHostSystem is supposed to implements supports(Feature... feature) for this purpose Added: james/project/trunk/mpt/core/src/main/java/org/apache/james/mpt/api/ImapFeatures.java james/project/trunk/mpt/core/src/test/java/org/apache/james/mpt/api/ james/project/trunk/mpt/core/src/test/java/org/apache/james/mpt/api/ImapFeaturesTest.java Modified: james/project/trunk/mpt/antlib/src/main/java/org/apache/james/mpt/ant/MailProtocolTestTask.java james/project/trunk/mpt/app/src/main/java/org/apache/james/mpt/app/RunScript.java james/project/trunk/mpt/core/pom.xml james/project/trunk/mpt/core/src/main/java/org/apache/james/mpt/api/ImapHostSystem.java james/project/trunk/mpt/core/src/main/java/org/apache/james/mpt/host/ExternalHostSystem.java james/project/trunk/mpt/core/src/test/java/org/apache/james/mpt/TestExternalHostSystem.java james/project/trunk/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/host/CassandraHostSystem.java james/project/trunk/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/AuthenticatedState.java james/project/trunk/mpt/impl/imap-mailbox/cyrus/src/test/java/org/apache/james/mpt/imapmailbox/cyrus/host/CyrusHostSystem.java james/project/trunk/mpt/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/host/ElasticSearchHostSystem.java james/project/trunk/mpt/impl/imap-mailbox/external-james/src/test/java/org/apache/james/mpt/imapmailbox/external/james/host/ExternalJamesHostSystem.java james/project/trunk/mpt/impl/imap-mailbox/hbase/src/test/java/org/apache/james/mpt/imapmailbox/hbase/host/HBaseHostSystem.java james/project/trunk/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/host/InMemoryHostSystem.java james/project/trunk/mpt/impl/imap-mailbox/jcr/src/test/java/org/apache/james/mpt/imapmailbox/jcr/host/JCRHostSystem.java james/project/trunk/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/host/JPAHostSystem.java james/project/trunk/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/host/MaildirHostSystem.java james/project/trunk/mpt/mavenplugin/src/main/java/org/apache/james/mpt/maven/MailProtocolTest.java Modified: james/project/trunk/mpt/antlib/src/main/java/org/apache/james/mpt/ant/MailProtocolTestTask.java URL: http://svn.apache.org/viewvc/james/project/trunk/mpt/antlib/src/main/java/org/apache/james/mpt/ant/MailProtocolTestTask.java?rev=1709409&r1=1709408&r2=1709409&view=diff == --- james/project/trunk/mpt/antlib/src/main/java/org/apache/james/mpt/ant/MailProtocolTestTask.java (original) +++ james/project/trunk/mpt/antlib/src/main/java/org/apache/james/mpt/ant/MailProtocolTestTask.java Mon Oct 19 13:04:34 2015 @@ -30,6 +30,8 @@ import java.util.Collection; import java.util.Iterator; import org.apache.james.mpt.Runner; +import org.apache.james.mpt.api.ImapFeatures; +import org.apache.james.mpt.api.ImapFeatures.Feature; import org.apache.james.mpt.api.Monitor; import org.apache.james.mpt.host.ExternalHostSystem; import org.apache.james.mpt.protocol.ProtocolSessionBuilder; @@ -48,6 +50,8 @@ import org.apache.tools.ant.types.resour */ public class MailProtocolTestTask extends Task implements Monitor { +private static final ImapFeatures SUPPORTED_FEATURES = ImapFeatures.of(Feature.NAMESPACE_SUPPORT); + private boolean quiet = false; private File script; private Union scripts; @@ -230,7 +234,7 @@ public class MailProtocolTestTask extend userAdder.execute(); } -final ExternalHostSystem host = new ExternalHostSystem(getHost(), getPort(), this, getShabang(), null); +final ExternalHostSystem host = new ExternalHostSystem(SUPPORTED_FEATURES, getHost(), getPort(), this, getShabang(), null); final ProtocolSessionBuilder builder = new ProtocolSessionBuilder(); if (scripts == null) { Modified: james/project/trunk/mpt/app/src/main/java/org/apache/james/mpt/app/RunScript.java URL: http://svn.apache.org/viewvc/james/project/trunk/mpt/app/src/main/java/org/apache/james/mpt/app/RunScript.java?rev=1709409&r1=1709408&r2=1709409&view=diff == --- james/project/trunk/mpt/app/src/main/java/org/apache/james/mpt/app/RunScript.java (original) +++ james/project/trunk/mpt/app/src/main/java/org/apache/james/mpt/ap
[jira] [Commented] (MPT-33) Support optional features when running mpt tests
[ https://issues.apache.org/jira/browse/MPT-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14963274#comment-14963274 ] ASF GitHub Bot commented on MPT-33: --- Github user mbaechler closed the pull request at: https://github.com/apache/james-project/pull/3 > Support optional features when running mpt tests > > > Key: MPT-33 > URL: https://issues.apache.org/jira/browse/MPT-33 > Project: James MPT > Issue Type: Improvement > Components: Main >Reporter: Matthieu Baechler > > MAILBOX-241 basically says : "I wrote some tests but it breaks on maildir > because maildir doesn't have namespace support". > I think this kind of feature set mismatch between backends is going to happen > as we move on with generic tests. > I propose to introduce feature conditioned tests in mpt to workaround this > kind of problems. > Come is coming soon. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Commented] (MPT-33) Support optional features when running mpt tests
[ https://issues.apache.org/jira/browse/MPT-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14963268#comment-14963268 ] ASF GitHub Bot commented on MPT-33: --- Github user rouazana commented on the pull request: https://github.com/apache/james-project/pull/3#issuecomment-149207021 :+1: > Support optional features when running mpt tests > > > Key: MPT-33 > URL: https://issues.apache.org/jira/browse/MPT-33 > Project: James MPT > Issue Type: Improvement > Components: Main >Reporter: Matthieu Baechler > > MAILBOX-241 basically says : "I wrote some tests but it breaks on maildir > because maildir doesn't have namespace support". > I think this kind of feature set mismatch between backends is going to happen > as we move on with generic tests. > I propose to introduce feature conditioned tests in mpt to workaround this > kind of problems. > Come is coming soon. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Commented] (MPT-33) Support optional features when running mpt tests
[ https://issues.apache.org/jira/browse/MPT-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14963269#comment-14963269 ] ASF GitHub Bot commented on MPT-33: --- Github user aduprat commented on a diff in the pull request: https://github.com/apache/james-project/pull/3#discussion_r42367538 --- Diff: mpt/core/src/main/java/org/apache/james/mpt/api/ImapFeatures.java --- @@ -0,0 +1,36 @@ +package org.apache.james.mpt.api; --- End diff -- license missing > Support optional features when running mpt tests > > > Key: MPT-33 > URL: https://issues.apache.org/jira/browse/MPT-33 > Project: James MPT > Issue Type: Improvement > Components: Main >Reporter: Matthieu Baechler > > MAILBOX-241 basically says : "I wrote some tests but it breaks on maildir > because maildir doesn't have namespace support". > I think this kind of feature set mismatch between backends is going to happen > as we move on with generic tests. > I propose to introduce feature conditioned tests in mpt to workaround this > kind of problems. > Come is coming soon. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1709401 - in /james/project/trunk/mpt: impl/imap-mailbox/external-james/pom.xml pom.xml
Author: matthieu Date: Mon Oct 19 12:13:34 2015 New Revision: 1709401 URL: http://svn.apache.org/viewvc?rev=1709401&view=rev Log: MPT-32 run external-james test when JAMES_ADDRESS env is set Switch to Guice 4 because exception in java 8 lambda breaks Guice 3 error reporting. Modified: james/project/trunk/mpt/impl/imap-mailbox/external-james/pom.xml james/project/trunk/mpt/pom.xml Modified: james/project/trunk/mpt/impl/imap-mailbox/external-james/pom.xml URL: http://svn.apache.org/viewvc/james/project/trunk/mpt/impl/imap-mailbox/external-james/pom.xml?rev=1709401&r1=1709400&r2=1709401&view=diff == --- james/project/trunk/mpt/impl/imap-mailbox/external-james/pom.xml (original) +++ james/project/trunk/mpt/impl/imap-mailbox/external-james/pom.xml Mon Oct 19 12:13:34 2015 @@ -157,6 +157,17 @@ + + test-external-james + + + !env.JAMES_ADDRESS + + + + true + + disable-animal-sniffer Modified: james/project/trunk/mpt/pom.xml URL: http://svn.apache.org/viewvc/james/project/trunk/mpt/pom.xml?rev=1709401&r1=1709400&r2=1709401&view=diff == --- james/project/trunk/mpt/pom.xml (original) +++ james/project/trunk/mpt/pom.xml Mon Oct 19 12:13:34 2015 @@ -95,7 +95,7 @@ 2.4 2.6 10.9.1.0 -3.0 +4.0 1.3.170 1.0.1 0.94.27 - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1709399 - in /james/project/trunk/mpt/impl/imap-mailbox/cyrus: pom.xml src/test/java/org/apache/james/mpt/imapmailbox/cyrus/host/CyrusHostSystem.java src/test/java/org/apache/james/mpt/im
Author: matthieu Date: Mon Oct 19 12:07:14 2015 New Revision: 1709399 URL: http://svn.apache.org/viewvc?rev=1709399&view=rev Log: MPT-31 make sure service is ok at container creation time Modified: james/project/trunk/mpt/impl/imap-mailbox/cyrus/pom.xml james/project/trunk/mpt/impl/imap-mailbox/cyrus/src/test/java/org/apache/james/mpt/imapmailbox/cyrus/host/CyrusHostSystem.java james/project/trunk/mpt/impl/imap-mailbox/cyrus/src/test/java/org/apache/james/mpt/imapmailbox/cyrus/host/Docker.java Modified: james/project/trunk/mpt/impl/imap-mailbox/cyrus/pom.xml URL: http://svn.apache.org/viewvc/james/project/trunk/mpt/impl/imap-mailbox/cyrus/pom.xml?rev=1709399&r1=1709398&r2=1709399&view=diff == --- james/project/trunk/mpt/impl/imap-mailbox/cyrus/pom.xml (original) +++ james/project/trunk/mpt/impl/imap-mailbox/cyrus/pom.xml Mon Oct 19 12:07:14 2015 @@ -130,6 +130,11 @@ +com.jayway.awaitility +awaitility +1.6.5 + + com.spotify docker-client 2.7.25 Modified: james/project/trunk/mpt/impl/imap-mailbox/cyrus/src/test/java/org/apache/james/mpt/imapmailbox/cyrus/host/CyrusHostSystem.java URL: http://svn.apache.org/viewvc/james/project/trunk/mpt/impl/imap-mailbox/cyrus/src/test/java/org/apache/james/mpt/imapmailbox/cyrus/host/CyrusHostSystem.java?rev=1709399&r1=1709398&r2=1709399&view=diff == --- james/project/trunk/mpt/impl/imap-mailbox/cyrus/src/test/java/org/apache/james/mpt/imapmailbox/cyrus/host/CyrusHostSystem.java (original) +++ james/project/trunk/mpt/impl/imap-mailbox/cyrus/src/test/java/org/apache/james/mpt/imapmailbox/cyrus/host/CyrusHostSystem.java Mon Oct 19 12:07:14 2015 @@ -122,6 +122,7 @@ public class CyrusHostSystem extends Ext try { Session session = newSession(null); try { +session.start(); protocolSession.runSessions(new Session[]{session}); } finally { session.stop(); Modified: james/project/trunk/mpt/impl/imap-mailbox/cyrus/src/test/java/org/apache/james/mpt/imapmailbox/cyrus/host/Docker.java URL: http://svn.apache.org/viewvc/james/project/trunk/mpt/impl/imap-mailbox/cyrus/src/test/java/org/apache/james/mpt/imapmailbox/cyrus/host/Docker.java?rev=1709399&r1=1709398&r2=1709399&view=diff == --- james/project/trunk/mpt/impl/imap-mailbox/cyrus/src/test/java/org/apache/james/mpt/imapmailbox/cyrus/host/Docker.java (original) +++ james/project/trunk/mpt/impl/imap-mailbox/cyrus/src/test/java/org/apache/james/mpt/imapmailbox/cyrus/host/Docker.java Mon Oct 19 12:07:14 2015 @@ -18,9 +18,15 @@ / package org.apache.james.mpt.imapmailbox.cyrus.host; +import java.io.IOException; +import java.net.Socket; +import java.net.UnknownHostException; +import java.util.concurrent.TimeUnit; + import com.google.common.base.Throwables; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; +import com.jayway.awaitility.Awaitility; import com.spotify.docker.client.DefaultDockerClient; import com.spotify.docker.client.DockerException; import com.spotify.docker.client.messages.ContainerConfig; @@ -57,9 +63,27 @@ public class Docker { public ContainerCreation start() throws Exception { ContainerCreation container = dockerClient.createContainer(containerConfig); dockerClient.startContainer(container.id(), ALL_PORTS_HOST_CONFIG); +waitingForSocketToBeReady(container); return container; } +private void waitingForSocketToBeReady(final ContainerCreation container) { +Awaitility +.await() +.atMost(30, TimeUnit.SECONDS) +.with() +.pollInterval(10, TimeUnit.MILLISECONDS) +.and() +.ignoreExceptions() +.until(() -> socketIsReady(container)); +} + +private boolean socketIsReady(ContainerCreation container) throws UnknownHostException, IOException { +try (Socket socket = new Socket(getHost(container), getIMAPPort(container))) { +return socket.getInputStream().read() >= 0; +} +} + public void stop(ContainerCreation container) { try { dockerClient.killContainer(container.id()); - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Commented] (MPT-32) external-james should only run when JAMES_ADDRESS is defined
[ https://issues.apache.org/jira/browse/MPT-32?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14963208#comment-14963208 ] ASF GitHub Bot commented on MPT-32: --- Github user mbaechler closed the pull request at: https://github.com/apache/james-project/pull/1 > external-james should only run when JAMES_ADDRESS is defined > > > Key: MPT-32 > URL: https://issues.apache.org/jira/browse/MPT-32 > Project: James MPT > Issue Type: Bug > Components: Main >Reporter: Matthieu Baechler > > External-james should run against a freshly compile James to check basic > behaviour. It should not run unless JAMES_ADDRESS environnement entry is set. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Commented] (MPT-31) cyrus mpt tests are unreliable
[ https://issues.apache.org/jira/browse/MPT-31?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14963203#comment-14963203 ] ASF GitHub Bot commented on MPT-31: --- Github user mbaechler closed the pull request at: https://github.com/apache/james-project/pull/4 > cyrus mpt tests are unreliable > -- > > Key: MPT-31 > URL: https://issues.apache.org/jira/browse/MPT-31 > Project: James MPT > Issue Type: Bug > Components: Main >Reporter: Matthieu Baechler > > Cyrus tests are very time-sensitive : they run well with some timing between > container creation and container usage. > There's a loop to wait for service start but it seems broken. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Commented] (MPT-31) cyrus mpt tests are unreliable
[ https://issues.apache.org/jira/browse/MPT-31?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14963198#comment-14963198 ] ASF GitHub Bot commented on MPT-31: --- Github user rouazana commented on the pull request: https://github.com/apache/james-project/pull/4#issuecomment-149195820 :+1: > cyrus mpt tests are unreliable > -- > > Key: MPT-31 > URL: https://issues.apache.org/jira/browse/MPT-31 > Project: James MPT > Issue Type: Bug > Components: Main >Reporter: Matthieu Baechler > > Cyrus tests are very time-sensitive : they run well with some timing between > container creation and container usage. > There's a loop to wait for service start but it seems broken. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Commented] (MPT-31) cyrus mpt tests are unreliable
[ https://issues.apache.org/jira/browse/MPT-31?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14963197#comment-14963197 ] ASF GitHub Bot commented on MPT-31: --- Github user aduprat commented on the pull request: https://github.com/apache/james-project/pull/4#issuecomment-149195691 :+1: > cyrus mpt tests are unreliable > -- > > Key: MPT-31 > URL: https://issues.apache.org/jira/browse/MPT-31 > Project: James MPT > Issue Type: Bug > Components: Main >Reporter: Matthieu Baechler > > Cyrus tests are very time-sensitive : they run well with some timing between > container creation and container usage. > There's a loop to wait for service start but it seems broken. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Commented] (MPT-31) cyrus mpt tests are unreliable
[ https://issues.apache.org/jira/browse/MPT-31?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14963192#comment-14963192 ] ASF GitHub Bot commented on MPT-31: --- GitHub user mbaechler opened a pull request: https://github.com/apache/james-project/pull/4 MPT-31 make sure service is ok at container creation time You can merge this pull request into a Git repository by running: $ git pull https://github.com/mbaechler/james-project MPT-31-over-apache-trunk Alternatively you can review and apply these changes as the patch at: https://github.com/apache/james-project/pull/4.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #4 commit 1545b434f7891e3552bdd9fc2819743f80272b59 Author: Matthieu Baechler Date: 2015-10-14T13:36:34Z MPT-31 make sure service is ok at container creation time > cyrus mpt tests are unreliable > -- > > Key: MPT-31 > URL: https://issues.apache.org/jira/browse/MPT-31 > Project: James MPT > Issue Type: Bug > Components: Main >Reporter: Matthieu Baechler > > Cyrus tests are very time-sensitive : they run well with some timing between > container creation and container usage. > There's a loop to wait for service start but it seems broken. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Commented] (MPT-33) Support optional features when running mpt tests
[ https://issues.apache.org/jira/browse/MPT-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14963053#comment-14963053 ] ASF GitHub Bot commented on MPT-33: --- GitHub user mbaechler opened a pull request: https://github.com/apache/james-project/pull/3 MPT-33 introduce namespace support feature and run related tests only… … when supported This uses junit Assume that allowes to disable a test when a condition if false. ImapHostSystem is supposed to implements supports(Feature... feature) for this purpose You can merge this pull request into a Git repository by running: $ git pull https://github.com/mbaechler/james-project MPT-33 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/james-project/pull/3.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #3 commit e59ed2a9df740c5ca62d1243105c87c79d564593 Author: Matthieu Baechler Date: 2015-10-19T09:28:27Z MPT-33 introduce namespace support feature and run related tests only when supported This uses junit Assume that allowes to disable a test when a condition if false. ImapHostSystem is supposed to implements supports(Feature... feature) for this purpose > Support optional features when running mpt tests > > > Key: MPT-33 > URL: https://issues.apache.org/jira/browse/MPT-33 > Project: James MPT > Issue Type: Improvement > Components: Main >Reporter: Matthieu Baechler > > MAILBOX-241 basically says : "I wrote some tests but it breaks on maildir > because maildir doesn't have namespace support". > I think this kind of feature set mismatch between backends is going to happen > as we move on with generic tests. > I propose to introduce feature conditioned tests in mpt to workaround this > kind of problems. > Come is coming soon. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Commented] (MPT-33) Support optional features when running mpt tests
[ https://issues.apache.org/jira/browse/MPT-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14963054#comment-14963054 ] ASF GitHub Bot commented on MPT-33: --- Github user mbaechler commented on the pull request: https://github.com/apache/james-project/pull/3#issuecomment-149159781 It's a new try at implementing features based testing > Support optional features when running mpt tests > > > Key: MPT-33 > URL: https://issues.apache.org/jira/browse/MPT-33 > Project: James MPT > Issue Type: Improvement > Components: Main >Reporter: Matthieu Baechler > > MAILBOX-241 basically says : "I wrote some tests but it breaks on maildir > because maildir doesn't have namespace support". > I think this kind of feature set mismatch between backends is going to happen > as we move on with generic tests. > I propose to introduce feature conditioned tests in mpt to workaround this > kind of problems. > Come is coming soon. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Commented] (MPT-33) Support optional features when running mpt tests
[ https://issues.apache.org/jira/browse/MPT-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14963049#comment-14963049 ] ASF GitHub Bot commented on MPT-33: --- Github user mbaechler closed the pull request at: https://github.com/apache/james-project/pull/2 > Support optional features when running mpt tests > > > Key: MPT-33 > URL: https://issues.apache.org/jira/browse/MPT-33 > Project: James MPT > Issue Type: Improvement > Components: Main >Reporter: Matthieu Baechler > > MAILBOX-241 basically says : "I wrote some tests but it breaks on maildir > because maildir doesn't have namespace support". > I think this kind of feature set mismatch between backends is going to happen > as we move on with generic tests. > I propose to introduce feature conditioned tests in mpt to workaround this > kind of problems. > Come is coming soon. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1709372 - in /james/project/trunk/mpt/core: pom.xml src/main/java/org/apache/james/mpt/session/ExternalSession.java
Author: matthieu Date: Mon Oct 19 07:33:22 2015 New Revision: 1709372 URL: http://svn.apache.org/viewvc?rev=1709372&view=rev Log: MPT-29 handle EOF in read retry Modified: james/project/trunk/mpt/core/pom.xml james/project/trunk/mpt/core/src/main/java/org/apache/james/mpt/session/ExternalSession.java Modified: james/project/trunk/mpt/core/pom.xml URL: http://svn.apache.org/viewvc/james/project/trunk/mpt/core/pom.xml?rev=1709372&r1=1709371&r2=1709372&view=diff == --- james/project/trunk/mpt/core/pom.xml (original) +++ james/project/trunk/mpt/core/pom.xml Mon Oct 19 07:33:22 2015 @@ -61,7 +61,11 @@ test-jar test - + +com.jayway.awaitility +awaitility +1.6.5 + commons-io commons-io Modified: james/project/trunk/mpt/core/src/main/java/org/apache/james/mpt/session/ExternalSession.java URL: http://svn.apache.org/viewvc/james/project/trunk/mpt/core/src/main/java/org/apache/james/mpt/session/ExternalSession.java?rev=1709372&r1=1709371&r2=1709372&view=diff == --- james/project/trunk/mpt/core/src/main/java/org/apache/james/mpt/session/ExternalSession.java (original) +++ james/project/trunk/mpt/core/src/main/java/org/apache/james/mpt/session/ExternalSession.java Mon Oct 19 07:33:22 2015 @@ -19,17 +19,21 @@ package org.apache.james.mpt.session; +import java.io.IOException; import java.nio.ByteBuffer; import java.nio.channels.SocketChannel; import java.nio.charset.Charset; +import java.util.concurrent.Callable; +import java.util.concurrent.TimeUnit; +import org.apache.commons.lang.mutable.MutableInt; import org.apache.james.mpt.api.Monitor; import org.apache.james.mpt.api.Session; -public final class ExternalSession implements Session { +import com.jayway.awaitility.Awaitility; +import com.jayway.awaitility.Duration; -/** Number of milliseconds to sleep after empty read */ -private static final int SHORT_WAIT_FOR_INPUT = 10; +public final class ExternalSession implements Session { private static final byte[] CRLF = { '\r', '\n' }; @@ -112,19 +116,30 @@ public final class ExternalSession imple else { monitor.debug("[Reading into buffer]"); readBuffer.clear(); -while (socket.read(readBuffer) == 0) { -// No response yet -// Wait a little while -Thread.sleep(SHORT_WAIT_FOR_INPUT); -} +result = tryReadFromSocket(); // Reset for transfer into string buffer readBuffer.flip(); monitor.debug("[Done]"); -result = true; } return result; } +private boolean tryReadFromSocket() throws IOException, InterruptedException { +final MutableInt status = new MutableInt(0); +Awaitility +.waitAtMost(Duration.ONE_MINUTE) +.pollDelay(new Duration(10, TimeUnit.MILLISECONDS)) +.until(new Callable() { +@Override +public Boolean call() throws Exception { +int read = socket.read(readBuffer); +status.setValue(read); +return read != 0; +} +}); +return status.intValue() > 0; +} + public void start() throws Exception { while (!socket.finishConnect()) { monitor.note("connecting..."); - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1709373 - /james/project/trunk/mpt/core/src/main/java/org/apache/james/mpt/session/ExternalSession.java
Author: matthieu Date: Mon Oct 19 07:33:27 2015 New Revision: 1709373 URL: http://svn.apache.org/viewvc?rev=1709373&view=rev Log: fixup! MPT-29 handle EOF in read retry Modified: james/project/trunk/mpt/core/src/main/java/org/apache/james/mpt/session/ExternalSession.java Modified: james/project/trunk/mpt/core/src/main/java/org/apache/james/mpt/session/ExternalSession.java URL: http://svn.apache.org/viewvc/james/project/trunk/mpt/core/src/main/java/org/apache/james/mpt/session/ExternalSession.java?rev=1709373&r1=1709372&r2=1709373&view=diff == --- james/project/trunk/mpt/core/src/main/java/org/apache/james/mpt/session/ExternalSession.java (original) +++ james/project/trunk/mpt/core/src/main/java/org/apache/james/mpt/session/ExternalSession.java Mon Oct 19 07:33:27 2015 @@ -119,7 +119,7 @@ public final class ExternalSession imple result = tryReadFromSocket(); // Reset for transfer into string buffer readBuffer.flip(); -monitor.debug("[Done]"); +monitor.debug(String.format("[Read %d characters]", readBuffer.limit())); } return result; } @@ -137,7 +137,11 @@ public final class ExternalSession imple return read != 0; } }); -return status.intValue() > 0; +if (status.intValue() == -1) { +monitor.debug("Error reading, got -1"); +return false; +} +return true; } public void start() throws Exception { - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org