You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Ioan Eugen Stan <st...@gmail.com> on 2011/08/16 00:18:39 UTC
mailbox integration tests preview
Hello,
The integration tests are done. I have created a second repository for
them at [1]. You can get a working copy with the following command:
hg clone https://stan.ieugen@code.google.com/a/apache-extras.org/p/hbase-mailbox-integration-test/
.
I have runt the tests and some pass and other don't. Short version:
Tests run: 291, Failures: 0, Errors: 216, Skipped: 0
Mostly due to Cast exceptions and the like. I will see what I can do
to solve them. Help is appreciated.
[1] http://code.google.com/a/apache-extras.org/p/hbase-mailbox-integration-test/
Regards,
--
Ioan Eugen Stan
http://ieugen.blogspot.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
Re: mailbox integration tests preview
Posted by Ioan Eugen Stan <st...@gmail.com>.
> A NO or BAD response usual means that there was an exception thrown from the
> mailbox code. To get an better idea what happens you should use this patch
> on the integration tests:
I applied the patch but I don;t see more information that could help
me. Could you please have a look at the test output and see if I am
missing something?
Please grab the latest source from repo. I made some modifications.
Thanks,
--
Ioan Eugen Stan
http://ieugen.blogspot.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
Re: mailbox integration tests preview
Posted by Ioan Eugen Stan <st...@gmail.com>.
2011/8/16 Norman Maurer <no...@apache.org>:
> Am 16.08.2011 11:25, schrieb Ioan Eugen Stan:
>>
>> 2011/8/16 Eric Charles<er...@apache.org>:
>>>
>>> Hi Ioan,
>>>
>>> I've run a few tests but didn't see the ClassCastException.
>>
>> Thats because last night some gremlins worked on the code and
>> committed the fixes for that ;).
>>
>>> e.g. Running from eclipse:
>>>
>>> NonAuthenticatedStateTest : 100% OK
>>>
>>> SelectTest :
>>>
>>> org.apache.james.imap.tester.base.ProtocolSession$InvalidServerResponseException:
>>> Location: /org/apache/james/imap/scripts/SelectUnseen.test:24
>>> LastClientMsg: 10 SELECT selectappend
>>> Expected: '\* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)'
>>> Actual : '10 NO SELECT completed.'
>>>
>>> I don't think there is a dependency/class incompatibility.
>>> It's more on the scripts results.
>>>
>>> I would track them one by one, trying to understand what the scripts are
>>> doing (in src/main/resources/org/apache/james/imap/script) and
>>> correcting. A
>>> fix in your code could solve many integration tests...
>>
>> I hope so. I'm planning to write some unit tests for message mapper to
>> see if I get fails on methods. It seems that one method fails, because
>> I get many errors with EXISTS. E.g. expected \* 2 EXISTS, actual \* 0
>> EXISTS.
>
> A NO or BAD response usual means that there was an exception thrown from the
> mailbox code. To get an better idea what happens you should use this patch
> on the integration tests:
>
> diff -r 3c892cf9a2c0 pom.xml
> --- a/pom.xml Tue Aug 16 03:06:46 2011 +0300
> +++ b/pom.xml Tue Aug 16 11:40:17 2011 +0200
> @@ -198,7 +198,7 @@
> </dependency>
> <dependency>
> <groupId>org.slf4j</groupId>
> - <artifactId>slf4j-simple</artifactId>
> + <artifactId>slf4j-log4j12</artifactId>
> <version>1.6.1</version>
> </dependency>
> <dependency>
> diff -r 3c892cf9a2c0 src/main/resources/log4j.properties
> --- a/src/main/resources/log4j.properties Tue Aug 16 03:06:46 2011 +0300
> +++ b/src/main/resources/log4j.properties Tue Aug 16 11:40:17 2011 +0200
> @@ -17,11 +17,9 @@
> # under the License. #
> ################################################################
>
> -log4j.rootLogger=ERROR, A1
> +log4j.rootLogger=DEBUG, A1
> log4j.appender.A1=org.apache.log4j.ConsoleAppender
> log4j.appender.A1.layout=org.apache.log4j.PatternLayout
>
> # Print the date in ISO 8601 format
> log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
> -
> -org.apache.james.imap=DEBUG,CONS
> \ No newline at end of file
Thanks for the patch Norman. I re-ran the test suite after integrating
the fixes and suggestions you provided and now we stand at:
Tests run: 291, Failures: 0, Errors: 171, Skipped: 0.
This is a great improvement. I will test again with the debugging
options to see if I can get it to comply 100%.
I have committed and pushed the changes so the repos are up to date.
Thanks,
--
Ioan Eugen Stan
http://ieugen.blogspot.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
Re: mailbox integration tests preview
Posted by Norman Maurer <no...@apache.org>.
Am 16.08.2011 11:25, schrieb Ioan Eugen Stan:
> 2011/8/16 Eric Charles<er...@apache.org>:
>> Hi Ioan,
>>
>> I've run a few tests but didn't see the ClassCastException.
> Thats because last night some gremlins worked on the code and
> committed the fixes for that ;).
>
>> e.g. Running from eclipse:
>>
>> NonAuthenticatedStateTest : 100% OK
>>
>> SelectTest :
>> org.apache.james.imap.tester.base.ProtocolSession$InvalidServerResponseException:
>> Location: /org/apache/james/imap/scripts/SelectUnseen.test:24
>> LastClientMsg: 10 SELECT selectappend
>> Expected: '\* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)'
>> Actual : '10 NO SELECT completed.'
>>
>> I don't think there is a dependency/class incompatibility.
>> It's more on the scripts results.
>>
>> I would track them one by one, trying to understand what the scripts are
>> doing (in src/main/resources/org/apache/james/imap/script) and correcting. A
>> fix in your code could solve many integration tests...
> I hope so. I'm planning to write some unit tests for message mapper to
> see if I get fails on methods. It seems that one method fails, because
> I get many errors with EXISTS. E.g. expected \* 2 EXISTS, actual \* 0
> EXISTS.
A NO or BAD response usual means that there was an exception thrown from
the mailbox code. To get an better idea what happens you should use this
patch on the integration tests:
diff -r 3c892cf9a2c0 pom.xml
--- a/pom.xml Tue Aug 16 03:06:46 2011 +0300
+++ b/pom.xml Tue Aug 16 11:40:17 2011 +0200
@@ -198,7 +198,7 @@
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
+ <artifactId>slf4j-log4j12</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
diff -r 3c892cf9a2c0 src/main/resources/log4j.properties
--- a/src/main/resources/log4j.properties Tue Aug 16 03:06:46 2011 +0300
+++ b/src/main/resources/log4j.properties Tue Aug 16 11:40:17 2011 +0200
@@ -17,11 +17,9 @@
# under the License. #
################################################################
-log4j.rootLogger=ERROR, A1
+log4j.rootLogger=DEBUG, A1
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
# Print the date in ISO 8601 format
log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
-
-org.apache.james.imap=DEBUG,CONS
\ No newline at end of file
This will help you to see the exceptions thrown..
Bye,
Norman
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
Re: mailbox integration tests preview
Posted by Ioan Eugen Stan <st...@gmail.com>.
2011/8/16 Eric Charles <er...@apache.org>:
> Hi Ioan,
>
> I've run a few tests but didn't see the ClassCastException.
Thats because last night some gremlins worked on the code and
committed the fixes for that ;).
>
> e.g. Running from eclipse:
>
> NonAuthenticatedStateTest : 100% OK
>
> SelectTest :
> org.apache.james.imap.tester.base.ProtocolSession$InvalidServerResponseException:
> Location: /org/apache/james/imap/scripts/SelectUnseen.test:24
> LastClientMsg: 10 SELECT selectappend
> Expected: '\* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)'
> Actual : '10 NO SELECT completed.'
>
> I don't think there is a dependency/class incompatibility.
> It's more on the scripts results.
>
> I would track them one by one, trying to understand what the scripts are
> doing (in src/main/resources/org/apache/james/imap/script) and correcting. A
> fix in your code could solve many integration tests...
I hope so. I'm planning to write some unit tests for message mapper to
see if I get fails on methods. It seems that one method fails, because
I get many errors with EXISTS. E.g. expected \* 2 EXISTS, actual \* 0
EXISTS.
> For the SelecTest for example, the stacktrace tells you there is an issue on
> SelectUnseen.test:24 (line 24)
>
> C: 10 SELECT selectappend
> S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
>
>
> The client send SELECT selctappend to the hbase mailbox, which answers 'NO
> SELECT completed', and it should be as stated in the script '\* FLAGS
> \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)'
>
> Hopes this help.
Thanks I will try to figure out what's wrong in my code and keep you up to date.
Bye,
--
Ioan Eugen Stan
http://ieugen.blogspot.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
Re: mailbox integration tests preview
Posted by Eric Charles <er...@apache.org>.
Hi Ioan,
I've run a few tests but didn't see the ClassCastException.
e.g. Running from eclipse:
NonAuthenticatedStateTest : 100% OK
SelectTest :
org.apache.james.imap.tester.base.ProtocolSession$InvalidServerResponseException:
Location: /org/apache/james/imap/scripts/SelectUnseen.test:24
LastClientMsg: 10 SELECT selectappend
Expected: '\* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)'
Actual : '10 NO SELECT completed.'
I don't think there is a dependency/class incompatibility.
It's more on the scripts results.
I would track them one by one, trying to understand what the scripts are
doing (in src/main/resources/org/apache/james/imap/script) and
correcting. A fix in your code could solve many integration tests...
For the SelecTest for example, the stacktrace tells you there is an
issue on SelectUnseen.test:24 (line 24)
C: 10 SELECT selectappend
S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
The client send SELECT selctappend to the hbase mailbox, which answers
'NO SELECT completed', and it should be as stated in the script '\*
FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)'
Hopes this help.
On 16/08/11 00:18, Ioan Eugen Stan wrote:
> Hello,
>
> The integration tests are done. I have created a second repository for
> them at [1]. You can get a working copy with the following command:
> hg clone https://stan.ieugen@code.google.com/a/apache-extras.org/p/hbase-mailbox-integration-test/
> .
>
> I have runt the tests and some pass and other don't. Short version:
> Tests run: 291, Failures: 0, Errors: 216, Skipped: 0
> Mostly due to Cast exceptions and the like. I will see what I can do
> to solve them. Help is appreciated.
>
> [1] http://code.google.com/a/apache-extras.org/p/hbase-mailbox-integration-test/
>
> Regards,
--
Eric
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
Re: mailbox integration tests preview
Posted by Ioan Eugen Stan <st...@gmail.com>.
2011/8/16 Norman Maurer <no...@apache.org>:
> Hi Ioan,
>
> I just found a bug in your impl. Here is the fix..
>
> diff -r edb0b99712ce
> src/main/java/org/apache/james/mailbox/hbase/mail/HBaseMessageMapper.java
> ---
> a/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseMessageMapper.java
> Tue Aug 16 03:07:49 2011 +0300
> +++
> b/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseMessageMapper.java
> Tue Aug 16 09:58:02 2011 +0200
> @@ -401,7 +401,9 @@
> scanner = messages.getScanner(scan);
> Result result = scanner.next();
> if (result == null) {
> - throw new MailboxException("Search of first unseen message
> failed in mailbox " + mailbox);
> +
> + // Return null as there are no unseen messages in the
> mailbox
> + return null;
> }
> return Bytes.toLong(result.getRow(), 16, 8);
> } catch (IOException e) {
>
> I will do more review later..
>
> Bye,
> Norman
Thanks Norman, I will apply the patch right away.
--
Ioan Eugen Stan
http://ieugen.blogspot.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
Re: mailbox integration tests preview
Posted by Norman Maurer <no...@apache.org>.
Hi Ioan,
I just found a bug in your impl. Here is the fix..
diff -r edb0b99712ce
src/main/java/org/apache/james/mailbox/hbase/mail/HBaseMessageMapper.java
---
a/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseMessageMapper.java
Tue Aug 16 03:07:49 2011 +0300
+++
b/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseMessageMapper.java
Tue Aug 16 09:58:02 2011 +0200
@@ -401,7 +401,9 @@
scanner = messages.getScanner(scan);
Result result = scanner.next();
if (result == null) {
- throw new MailboxException("Search of first unseen
message failed in mailbox " + mailbox);
+
+ // Return null as there are no unseen messages in the
mailbox
+ return null;
}
return Bytes.toLong(result.getRow(), 16, 8);
} catch (IOException e) {
I will do more review later..
Bye,
Norman
Am 16.08.2011 00:18, schrieb Ioan Eugen Stan:
> Hello,
>
> The integration tests are done. I have created a second repository for
> them at [1]. You can get a working copy with the following command:
> hg clone https://stan.ieugen@code.google.com/a/apache-extras.org/p/hbase-mailbox-integration-test/
> .
>
> I have runt the tests and some pass and other don't. Short version:
> Tests run: 291, Failures: 0, Errors: 216, Skipped: 0
> Mostly due to Cast exceptions and the like. I will see what I can do
> to solve them. Help is appreciated.
>
> [1] http://code.google.com/a/apache-extras.org/p/hbase-mailbox-integration-test/
>
> Regards,
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org