You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Mark Lowe <me...@gmail.com> on 2004/10/27 13:49:20 UTC

[email] test cases

Should these test cases work (after editing the EmailConfig test class)?

I had most of them working yesterday enough to mail me the test mails,
but today i cant get them doing anything. I have an smtp service
running locally, but is this being done by this dumpster thing now?

Anything you could do to help be get these cases working would be
great. All of them are related to the Test classes themselves not the
actual code they are testing. Once I have a clearer idea what could be
up i'll be able to enter a bug report, but i don't even have that
amount of clarity yet.

Mark

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


Re: [email] test cases

Posted by Mark Lowe <me...@gmail.com>.
Testcase: testSetFrom2(org.apache.commons.mail.EmailTest):	FAILED
Should have thrown an exception
junit.framework.AssertionFailedError: Should have thrown an exception
	at org.apache.commons.mail.EmailTest.testSetFrom2(EmailTest.java:420)

which is this piece of code

            MockEmailConcrete anotherEmail = new MockEmailConcrete();
            // set a dodgy encoding scheme
            anotherEmail.setCharset("bad.encoding??\n");
            // set a valid address but bad personal name
            anotherEmail.setFrom("me@home.com", "\t.bad.personal.name.??\n");
            fail("Should have thrown an exception");

The AddressException patches I submitted yesterday help it throw if
the name is snide. But I couldn't get it throwing
unsupportedcharseteception for the life of me.

Mark


On Fri, 29 Oct 2004 20:08:06 +0800, Corey Scott <co...@gmail.com> wrote:
> Mark,
> 
> Can you please clarify regarding the unsupportedcharset exception,  as
> I have had no problem with this, except for this fact that the unicode
> chars are not being submitted to the cvs nicely.
> 
> Thanks,
> Corey
>

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


Re: [email] test cases

Posted by Corey Scott <co...@gmail.com>.
Mark,

Can you please clarify regarding the unsupportedcharset exception,  as
I have had no problem with this, except for this fact that the unicode
chars are not being submitted to the cvs nicely.

Thanks,
Corey

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


Re: [email] test cases

Posted by Mark Lowe <me...@gmail.com>.
I wont give up eric, no worries there :o) 

I'm looking into offline email browsing, ideally a swing app that can
be fired up from maven. But I'll need to get a bit of time on this,
hope fully pointing my mail client at the outputted files will remove
the self-spam dependency.

Have you any suggestions of how to go about working around
UnsupportedEncodingException not being thrown but the compiler
insisting that it needs to be caught? The test case seems to suggest
that the mail api doesn't really care about bogus charsets.

Were the AddressException patches dog or any use? Point me in the
right direction in terms of what needs doing and I'll try and get some
patches to you. At the moment I'm guessing a little bit, as I'm not
sure what the project's priourities are, but I'm glad to try and help
as much as i can.

Mark

On Fri, 29 Oct 2004 13:39:06 +0200, Eric Pugh <ep...@upstate.com> wrote:
> Alright..  I've made some progress.  I refactored all the unit tests to
> extend from BaseEmailTestCase.  BaseEmailTestCase contains the various bits
> of shared code.  It also starts and stops dumbster.
> 
> So, on to my problem... I added an example of Dumster being quried for the
> email, and validating the subject.  It also writes the email out to
> /target/test-emails as a .txt file.  Look at TestEmail.testSend.  If you
> JUST run that method, everything works great.  If you run everything,
> dumbster seems to fail.  I am still digging through it.
> 
> At any rate, Mark, would writing the email out like that solve your needs?
> 
> I know it's frustrating getting everything setup, but don't give up!
> 
> Eric
> 
> > -----Original Message-----
> > From: Mark Lowe [mailto:melowe@gmail.com]
> > Sent: Friday, October 29, 2004 12:16 PM
> > To: Jakarta Commons Developers List
> > Subject: Re: [email] test cases
> >
> >
> > Thinking about it , if a simple swing app could be fired up (like
> > junit (test:ui)) then that could be used for testing the output
> > without using an smtp server, perhaps even just something that can
> > render and output to a image or pdf. I'll have a read around.
> >
> >
> >
> > On Fri, 29 Oct 2004 11:39:29 +0200, Mark Lowe <me...@gmail.com> wrote:
> > > The smtp jar does seem required to run the tests and only have them
> > > failing rather than throwing errors. The mail api seems to have
> > > trouble throwing a UnsupportedEncodingException. But this isn't really
> > > a test case issue, as the unit test correctly report that no exception
> > > is thrown.
> > >
> > > Mark
> > >
> > >
> > >
> > > On Fri, 29 Oct 2004 11:20:54 +0200, Eric Pugh <ep...@upstate.com> wrote:
> > > > I can see the value of *actually* recieving the email.  I
> > think we could add
> > > > it commented out to project.xml.   And a FAQ entry
> > (xdocs/faq.fml) about
> > > > swapping between dumbster and really sending emails...
> > > >
> > > > Eric
> > > >
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: Corey Scott [mailto:corey.scott@gmail.com]
> > > > > Sent: Friday, October 29, 2004 3:23 AM
> > > > > To: Jakarta Commons Developers List; Mark Lowe
> > > > > Subject: Re: [email] test cases
> > > > >
> > > > >
> > > > > It doesnt use smtp.jar, right?
> > > > >
> > > > >
> > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > > > > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> > > >
> > > >
> > >
> >
> > ---------------------------------------------------------------------
> 
> 
> > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 
>

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


Re: [email] test cases

Posted by Corey Scott <co...@gmail.com>.
Ok, sounds good.

I will make sure I test the patch before sending it too you.  Seeing
as we are both using eclipse, hopefully this will mean that I can be
sure that it applies before I send it.

Regards,
Corey

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


RE: [email] test cases

Posted by Eric Pugh <ep...@upstate.com>.
Since I can't seem to apply a patch cleanly this week, sure, send it all in
one.

I have thought about the string compare approach, but often that can be very
brittle.  It's so easy for some environmental thing to happen and cause and
extra " " or whatnot to creep in, and then it fails.  Also, its a bunch more
external files to keep up to date.

However, w/ dumbster, we can manualy check stuff within the test.  If you
look at the EmailTest, I check the subject.

We could do something like assertTrue(getBody().indexOf("my message")>0) and
that would work.

Try the .eml, and lets see!

Eric

> -----Original Message-----
> From: Corey Scott [mailto:corey.scott@gmail.com]
> Sent: Friday, October 29, 2004 5:11 PM
> To: epugh@upstate.com
> Cc: Jakarta Commons Developers List
> Subject: Re: [email] test cases
>
>
> We have quite a few style violations that have crept back in, do you
> mind if i fix those as well?  Do you recommend a separate patch?  If
> it is ok with you, i would rather submit one patch for all of it cause
> stuff keeps getting lost :-)
>
> Thanks for the advice,
> Corey
>
> PS.  I will try to take you lead with the validation of the email
> contents from dumbster.
> I think that we might also find that if we say emails to .eml (i
> think) then most windows clients should open them up automatically.
> What do you think about making a set of expected outputs (files) and
> then doing a plain string compare?


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


Re: [email] test cases

Posted by Corey Scott <co...@gmail.com>.
We have quite a few style violations that have crept back in, do you
mind if i fix those as well?  Do you recommend a separate patch?  If
it is ok with you, i would rather submit one patch for all of it cause
stuff keeps getting lost :-)

Thanks for the advice,
Corey

PS.  I will try to take you lead with the validation of the email
contents from dumbster.
I think that we might also find that if we say emails to .eml (i
think) then most windows clients should open them up automatically.
What do you think about making a set of expected outputs (files) and
then doing a plain string compare?

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


RE: [email] test cases

Posted by Eric Pugh <ep...@upstate.com>.
Cool..  I think you know then the path to fix the rest?  The unicode seems
to make sense to me.

On the second part, is there ever a time we would want to send a null
message?  I can't think of one really, and the point of Email is to hide the
complexity from you, so that sounds good to me..

Eric

> -----Original Message-----
> From: Corey Scott [mailto:corey.scott@gmail.com]
> Sent: Friday, October 29, 2004 4:05 PM
> To: Jakarta Commons Developers List
> Subject: Re: [email] test cases
>
>
> Guys,
>
> I need some guidance.  The test cases mentioned are failing for a
> couple of reasons.  The ones that are failing are doing so because the
> personal names are still using ? instead of an invalid unicode
> character, we can replace them with something like \uc5ec (this is
> korean i believe) they will then pass properly.
>
> One of the others is failing due to lack of content and this is
> because the functions are allowing this to set, I would like to
> propose changing the (MultipartEmail) setMsg, setHTML, etc. to throw a
> MessagingException on null message.  This will bring them in line with
> HtmlEmail which is already doing this.   This would also mean changing
> the test array of strings (thanks eric!!!) by removing the null.
>
> If this is all ok, I will happily generate a patch for these changes.
>
> Thanks,
> Corey
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org


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


Re: [email] test cases

Posted by Corey Scott <co...@gmail.com>.
Guys,

I need some guidance.  The test cases mentioned are failing for a
couple of reasons.  The ones that are failing are doing so because the
personal names are still using ? instead of an invalid unicode
character, we can replace them with something like \uc5ec (this is
korean i believe) they will then pass properly.

One of the others is failing due to lack of content and this is
because the functions are allowing this to set, I would like to
propose changing the (MultipartEmail) setMsg, setHTML, etc. to throw a
MessagingException on null message.  This will bring them in line with
HtmlEmail which is already doing this.   This would also mean changing
the test array of strings (thanks eric!!!) by removing the null.

If this is all ok, I will happily generate a patch for these changes.

Thanks,
Corey

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


Re: [email] test cases

Posted by Mark Lowe <me...@gmail.com>.
A lot of these are caused by unsupportedcharseteception not being
thrown, and the InternetAddresses not being validated

InterenetAddress.validate();

}
catch(unsupportedcharseteception e) {
   throw new MessagingException("Snide charset",e);
}
catch (AddressException e) {
   throw new MessagingException("Snide address",e);
}

But if the internet address is valid and the charset not, it just wont
throw it.

Mark

On Fri, 29 Oct 2004 14:10:01 +0200, Eric Pugh <ep...@upstate.com> wrote:
> By playing games with starting and stopping dumbster, it now outputs the
> text in /target/test-emails.  The other sending targets fail due to missing
> content errors.
> 
> I am now getting 8 failures and 1 error.  I have pasted below the errors
> that I am getting.  It would be nice if someone can verify that they are
> getting the same ones!
> 
> Since we are getting known errors, I tweaked maven to ignore errors and
> failures so you can generate the docs by just running maven site.
> 
> Eric
> 
>  Failure details
>         testSetFrom2
> Should have thrown an exception
> junit.framework.AssertionFailedError: Should have thrown an exception at
> org.apache.commons.mail.EmailTest.testSetFrom2(EmailTest.java:420)
>         testAddTo2
> Should have thrown an exception
> junit.framework.AssertionFailedError: Should have thrown an exception at
> org.apache.commons.mail.EmailTest.testAddTo2(EmailTest.java:582)
>         testAddCc2
> Should have thrown an exception
> junit.framework.AssertionFailedError: Should have thrown an exception at
> org.apache.commons.mail.EmailTest.testAddCc2(EmailTest.java:822)
>         testAddBcc2
> Should have thrown an exception
> junit.framework.AssertionFailedError: Should have thrown an exception at
> org.apache.commons.mail.EmailTest.testAddBcc2(EmailTest.java:1050)
>         testAddReplyTo2
> Should have thrown an exception
> junit.framework.AssertionFailedError: Should have thrown an exception at
> org.apache.commons.mail.EmailTest.testAddReplyTo2(EmailTest.java:1291)
>         testSend
> Unexpected exception thrown
> junit.framework.AssertionFailedError: Unexpected exception thrown at
> org.apache.commons.mail.HtmlEmailTest.testSend(HtmlEmailTest.java:204)
>         testGetSetMsg
> N/A
> java.lang.NullPointerException at java.lang.String.indexOf(String.java:1236)
> at java.lang.String.indexOf(String.java:1218) at
> org.apache.commons.mail.HtmlEmailTest.testGetSetMsg(HtmlEmailTest.java:88)
>         testSend
> Unexpected exception thrown
> junit.framework.AssertionFailedError: Unexpected exception thrown at
> org.apache.commons.mail.MultiPartEmailTest.testSend(MultiPartEmailTest.java:
> 185)
>         testSetMsg
> expected:<> but was:<null>
> junit.framework.ComparisonFailure: expected:<> but was:<null> at
> org.apache.commons.mail.MultiPartEmailTest.testSetMsg(MultiPartEmailTest.jav
> a:86)
> 
> 
> 
> > -----Original Message-----
> > From: Eric Pugh [mailto:epugh@upstate.com]
> > Sent: Friday, October 29, 2004 1:39 PM
> > To: Jakarta Commons Developers List; Mark Lowe
> > Subject: RE: [email] test cases
> >
> >
> > Alright..  I've made some progress.  I refactored all the unit tests to
> > extend from BaseEmailTestCase.  BaseEmailTestCase contains the
> > various bits
> > of shared code.  It also starts and stops dumbster.
> >
> > So, on to my problem... I added an example of Dumster being quried for the
> > email, and validating the subject.  It also writes the email out to
> > /target/test-emails as a .txt file.  Look at TestEmail.testSend.  If you
> > JUST run that method, everything works great.  If you run everything,
> > dumbster seems to fail.  I am still digging through it.
> >
> > At any rate, Mark, would writing the email out like that solve your needs?
> >
> > I know it's frustrating getting everything setup, but don't give up!
> >
> > Eric
> >
> > > -----Original Message-----
> > > From: Mark Lowe [mailto:melowe@gmail.com]
> > > Sent: Friday, October 29, 2004 12:16 PM
> > > To: Jakarta Commons Developers List
> > > Subject: Re: [email] test cases
> > >
> > >
> > > Thinking about it , if a simple swing app could be fired up (like
> > > junit (test:ui)) then that could be used for testing the output
> > > without using an smtp server, perhaps even just something that can
> > > render and output to a image or pdf. I'll have a read around.
> > >
> > >
> > >
> > > On Fri, 29 Oct 2004 11:39:29 +0200, Mark Lowe <me...@gmail.com> wrote:
> > > > The smtp jar does seem required to run the tests and only have them
> > > > failing rather than throwing errors. The mail api seems to have
> > > > trouble throwing a UnsupportedEncodingException. But this isn't really
> > > > a test case issue, as the unit test correctly report that no exception
> > > > is thrown.
> > > >
> > > > Mark
> > > >
> > > >
> > > >
> > > > On Fri, 29 Oct 2004 11:20:54 +0200, Eric Pugh
> > <ep...@upstate.com> wrote:
> > > > > I can see the value of *actually* recieving the email.  I
> > > think we could add
> > > > > it commented out to project.xml.   And a FAQ entry
> > > (xdocs/faq.fml) about
> > > > > swapping between dumbster and really sending emails...
> > > > >
> > > > > Eric
> > > > >
> > > > >
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Corey Scott [mailto:corey.scott@gmail.com]
> > > > > > Sent: Friday, October 29, 2004 3:23 AM
> > > > > > To: Jakarta Commons Developers List; Mark Lowe
> > > > > > Subject: Re: [email] test cases
> > > > > >
> > > > > >
> > > > > > It doesnt use smtp.jar, right?
> > > > > >
> > > > > >
> > > ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > > > > > For additional commands, e-mail:
> > commons-dev-help@jakarta.apache.org
> > > > >
> > > > >
> > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > > > > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> > > > >
> > > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 
>

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


RE: [email] test cases

Posted by Eric Pugh <ep...@upstate.com>.
By playing games with starting and stopping dumbster, it now outputs the
text in /target/test-emails.  The other sending targets fail due to missing
content errors.

I am now getting 8 failures and 1 error.  I have pasted below the errors
that I am getting.  It would be nice if someone can verify that they are
getting the same ones!

Since we are getting known errors, I tweaked maven to ignore errors and
failures so you can generate the docs by just running maven site.

Eric

 Failure details
	testSetFrom2
Should have thrown an exception
junit.framework.AssertionFailedError: Should have thrown an exception at
org.apache.commons.mail.EmailTest.testSetFrom2(EmailTest.java:420)
	testAddTo2
Should have thrown an exception
junit.framework.AssertionFailedError: Should have thrown an exception at
org.apache.commons.mail.EmailTest.testAddTo2(EmailTest.java:582)
	testAddCc2
Should have thrown an exception
junit.framework.AssertionFailedError: Should have thrown an exception at
org.apache.commons.mail.EmailTest.testAddCc2(EmailTest.java:822)
	testAddBcc2
Should have thrown an exception
junit.framework.AssertionFailedError: Should have thrown an exception at
org.apache.commons.mail.EmailTest.testAddBcc2(EmailTest.java:1050)
	testAddReplyTo2
Should have thrown an exception
junit.framework.AssertionFailedError: Should have thrown an exception at
org.apache.commons.mail.EmailTest.testAddReplyTo2(EmailTest.java:1291)
	testSend
Unexpected exception thrown
junit.framework.AssertionFailedError: Unexpected exception thrown at
org.apache.commons.mail.HtmlEmailTest.testSend(HtmlEmailTest.java:204)
	testGetSetMsg
N/A
java.lang.NullPointerException at java.lang.String.indexOf(String.java:1236)
at java.lang.String.indexOf(String.java:1218) at
org.apache.commons.mail.HtmlEmailTest.testGetSetMsg(HtmlEmailTest.java:88)
	testSend
Unexpected exception thrown
junit.framework.AssertionFailedError: Unexpected exception thrown at
org.apache.commons.mail.MultiPartEmailTest.testSend(MultiPartEmailTest.java:
185)
	testSetMsg
expected:<> but was:<null>
junit.framework.ComparisonFailure: expected:<> but was:<null> at
org.apache.commons.mail.MultiPartEmailTest.testSetMsg(MultiPartEmailTest.jav
a:86)

> -----Original Message-----
> From: Eric Pugh [mailto:epugh@upstate.com]
> Sent: Friday, October 29, 2004 1:39 PM
> To: Jakarta Commons Developers List; Mark Lowe
> Subject: RE: [email] test cases
>
>
> Alright..  I've made some progress.  I refactored all the unit tests to
> extend from BaseEmailTestCase.  BaseEmailTestCase contains the
> various bits
> of shared code.  It also starts and stops dumbster.
>
> So, on to my problem... I added an example of Dumster being quried for the
> email, and validating the subject.  It also writes the email out to
> /target/test-emails as a .txt file.  Look at TestEmail.testSend.  If you
> JUST run that method, everything works great.  If you run everything,
> dumbster seems to fail.  I am still digging through it.
>
> At any rate, Mark, would writing the email out like that solve your needs?
>
> I know it's frustrating getting everything setup, but don't give up!
>
> Eric
>
> > -----Original Message-----
> > From: Mark Lowe [mailto:melowe@gmail.com]
> > Sent: Friday, October 29, 2004 12:16 PM
> > To: Jakarta Commons Developers List
> > Subject: Re: [email] test cases
> >
> >
> > Thinking about it , if a simple swing app could be fired up (like
> > junit (test:ui)) then that could be used for testing the output
> > without using an smtp server, perhaps even just something that can
> > render and output to a image or pdf. I'll have a read around.
> >
> >
> >
> > On Fri, 29 Oct 2004 11:39:29 +0200, Mark Lowe <me...@gmail.com> wrote:
> > > The smtp jar does seem required to run the tests and only have them
> > > failing rather than throwing errors. The mail api seems to have
> > > trouble throwing a UnsupportedEncodingException. But this isn't really
> > > a test case issue, as the unit test correctly report that no exception
> > > is thrown.
> > >
> > > Mark
> > >
> > >
> > >
> > > On Fri, 29 Oct 2004 11:20:54 +0200, Eric Pugh
> <ep...@upstate.com> wrote:
> > > > I can see the value of *actually* recieving the email.  I
> > think we could add
> > > > it commented out to project.xml.   And a FAQ entry
> > (xdocs/faq.fml) about
> > > > swapping between dumbster and really sending emails...
> > > >
> > > > Eric
> > > >
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: Corey Scott [mailto:corey.scott@gmail.com]
> > > > > Sent: Friday, October 29, 2004 3:23 AM
> > > > > To: Jakarta Commons Developers List; Mark Lowe
> > > > > Subject: Re: [email] test cases
> > > > >
> > > > >
> > > > > It doesnt use smtp.jar, right?
> > > > >
> > > > >
> > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > > > > For additional commands, e-mail:
> commons-dev-help@jakarta.apache.org
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> > > >
> > > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org


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


RE: [email] test cases

Posted by Eric Pugh <ep...@upstate.com>.
Alright..  I've made some progress.  I refactored all the unit tests to
extend from BaseEmailTestCase.  BaseEmailTestCase contains the various bits
of shared code.  It also starts and stops dumbster.

So, on to my problem... I added an example of Dumster being quried for the
email, and validating the subject.  It also writes the email out to
/target/test-emails as a .txt file.  Look at TestEmail.testSend.  If you
JUST run that method, everything works great.  If you run everything,
dumbster seems to fail.  I am still digging through it.

At any rate, Mark, would writing the email out like that solve your needs?

I know it's frustrating getting everything setup, but don't give up!

Eric

> -----Original Message-----
> From: Mark Lowe [mailto:melowe@gmail.com]
> Sent: Friday, October 29, 2004 12:16 PM
> To: Jakarta Commons Developers List
> Subject: Re: [email] test cases
>
>
> Thinking about it , if a simple swing app could be fired up (like
> junit (test:ui)) then that could be used for testing the output
> without using an smtp server, perhaps even just something that can
> render and output to a image or pdf. I'll have a read around.
>
>
>
> On Fri, 29 Oct 2004 11:39:29 +0200, Mark Lowe <me...@gmail.com> wrote:
> > The smtp jar does seem required to run the tests and only have them
> > failing rather than throwing errors. The mail api seems to have
> > trouble throwing a UnsupportedEncodingException. But this isn't really
> > a test case issue, as the unit test correctly report that no exception
> > is thrown.
> >
> > Mark
> >
> >
> >
> > On Fri, 29 Oct 2004 11:20:54 +0200, Eric Pugh <ep...@upstate.com> wrote:
> > > I can see the value of *actually* recieving the email.  I
> think we could add
> > > it commented out to project.xml.   And a FAQ entry
> (xdocs/faq.fml) about
> > > swapping between dumbster and really sending emails...
> > >
> > > Eric
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Corey Scott [mailto:corey.scott@gmail.com]
> > > > Sent: Friday, October 29, 2004 3:23 AM
> > > > To: Jakarta Commons Developers List; Mark Lowe
> > > > Subject: Re: [email] test cases
> > > >
> > > >
> > > > It doesnt use smtp.jar, right?
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> > >
> > >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org


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


Re: [email] test cases

Posted by Mark Lowe <me...@gmail.com>.
Thinking about it , if a simple swing app could be fired up (like
junit (test:ui)) then that could be used for testing the output
without using an smtp server, perhaps even just something that can
render and output to a image or pdf. I'll have a read around.



On Fri, 29 Oct 2004 11:39:29 +0200, Mark Lowe <me...@gmail.com> wrote:
> The smtp jar does seem required to run the tests and only have them
> failing rather than throwing errors. The mail api seems to have
> trouble throwing a UnsupportedEncodingException. But this isn't really
> a test case issue, as the unit test correctly report that no exception
> is thrown.
> 
> Mark
> 
> 
> 
> On Fri, 29 Oct 2004 11:20:54 +0200, Eric Pugh <ep...@upstate.com> wrote:
> > I can see the value of *actually* recieving the email.  I think we could add
> > it commented out to project.xml.   And a FAQ entry (xdocs/faq.fml) about
> > swapping between dumbster and really sending emails...
> >
> > Eric
> >
> >
> >
> > > -----Original Message-----
> > > From: Corey Scott [mailto:corey.scott@gmail.com]
> > > Sent: Friday, October 29, 2004 3:23 AM
> > > To: Jakarta Commons Developers List; Mark Lowe
> > > Subject: Re: [email] test cases
> > >
> > >
> > > It doesnt use smtp.jar, right?
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> >
> >
>

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


Re: [email] test cases

Posted by Mark Lowe <me...@gmail.com>.
The smtp jar does seem required to run the tests and only have them
failing rather than throwing errors. The mail api seems to have
trouble throwing a UnsupportedEncodingException. But this isn't really
a test case issue, as the unit test correctly report that no exception
is thrown.

Mark

On Fri, 29 Oct 2004 11:20:54 +0200, Eric Pugh <ep...@upstate.com> wrote:
> I can see the value of *actually* recieving the email.  I think we could add
> it commented out to project.xml.   And a FAQ entry (xdocs/faq.fml) about
> swapping between dumbster and really sending emails...
> 
> Eric
> 
> 
> 
> > -----Original Message-----
> > From: Corey Scott [mailto:corey.scott@gmail.com]
> > Sent: Friday, October 29, 2004 3:23 AM
> > To: Jakarta Commons Developers List; Mark Lowe
> > Subject: Re: [email] test cases
> >
> >
> > It doesnt use smtp.jar, right?
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 
>

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


RE: [email] test cases

Posted by Eric Pugh <ep...@upstate.com>.
I can see the value of *actually* recieving the email.  I think we could add
it commented out to project.xml.   And a FAQ entry (xdocs/faq.fml) about
swapping between dumbster and really sending emails...

Eric

> -----Original Message-----
> From: Corey Scott [mailto:corey.scott@gmail.com]
> Sent: Friday, October 29, 2004 3:23 AM
> To: Jakarta Commons Developers List; Mark Lowe
> Subject: Re: [email] test cases
>
>
> It doesnt use smtp.jar, right?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org


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


Re: [email] test cases

Posted by Corey Scott <co...@gmail.com>.
It doesnt use smtp.jar, right?

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


Re: [email] test cases

Posted by Mark Lowe <me...@gmail.com>.
Got the problem, there's not smtp.jar dependency in the project.xml..
I'll submit a patch..

Mark


On Thu, 28 Oct 2004 11:56:23 +0200, Eric Pugh <ep...@upstate.com> wrote:
> Also, isn't there a "debug" setting that you can use so you see the output
> of the STMP connection?  Try that as well..
> 
> 
> 
> > -----Original Message-----
> > From: Corey Scott [mailto:corey.scott@gmail.com]
> > Sent: Wednesday, October 27, 2004 4:14 PM
> > To: Jakarta Commons Developers List; Mark Lowe
> > Subject: Re: [email] test cases
> >
> >
> > Do you have anymore info on why the tests are failing?
> >
> > If it the previous set of tests (before last nights updates) then it
> > is probably due to some validation that was missing in one of the
> > patches and should now be there.
> > Namely, throwing exceptions on bad inputs like a null message.
> >
> > Other than that it I am can only think of a few places i have
> > come accross this:
> > 1) it may be an issue caused by the server requiring authentication
> > and it not being set.
> > 2) I thought that I had some problem running the tests with maven at
> > one time, I never confirmed this, so this is unlikely
> > 3) it may just be the tests that were testing the email validation and
> > since that was removed they are failing as SMTP servers (atleast
> > dumbster) is NOT throwing a messaging exception on invalid addresses I
> > had expected.
> >
> > All that said, I have not being experiencing these troubles, I even
> > rechecked out the project and applied the last patch that I submitted
> > into a new project and it was all still ok.
> >
> > I will check it out again and see what I can find.
> >
> > Regards,
> > Corey
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 
>

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


RE: [email] and net

Posted by Eric Pugh <ep...@upstate.com>.
Thanks..  I'll take a look at it.  One of our objectives of 1.0 is to get
something out soon.  So we may put integration/reuse of net stuff for 1.1.
But anything that gives ideas is great!

> -----Original Message-----
> From: news [mailto:news@sea.gmane.org]On Behalf Of Vic Cekvenich
> Sent: Thursday, October 28, 2004 3:40 AM
> To: commons-dev@jakarta.apache.org
> Subject: Re: [email] and net
>
>
> to the people of thinking of releaseing email:
>
> I think a lot more work is in net's smtp package such as simple emailer.
> So, maybe build on that,that is a superset.
>
>
> just in case you missed it.
> .V
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org


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


Re: [email] and net

Posted by Vic Cekvenich <ce...@portalvu.com>.
to the people of thinking of releaseing email:

I think a lot more work is in net's smtp package such as simple emailer.
So, maybe build on that,that is a superset.


just in case you missed it.
.V


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


Re: [email] test cases

Posted by Mark Lowe <me...@gmail.com>.
All the errors (not failures) I get are
javax.mail.NoSuchProviderException: smtp ..

It could be a misconguration on my part. If I had a better idea I'd
enter a bug.

Mark
P.S. Thanks!! For the gmail address. 


On Wed, 27 Oct 2004 22:23:00 +0800, Corey Scott <co...@gmail.com> wrote:
> Ok... please ignore my previous message.
> 
> I have checked out the current source.  An I do get 5 errors.
> The errors are ALL caused by the same thing.
> Now please let me try to explain what is causing this.
> 
> The error is tests are for invalid character sets in the personal
> section of and email address (eg the persons name or desc).
> 
> The tests originally had some unicode extended characters in them and
> some how we have lost them and they are now plain question marks.  The
> question marks are ofcourse valid characters and therefore the
> expected exceptions are not thrown.
> 
> The original characters where: (note some may not see this)
> "ä", "ß"
> 
> Any thoughts?
> Regards,
> Corey
>

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


RE: [email] test cases

Posted by Eric Pugh <ep...@upstate.com>.
Could have been the way I submitted the patch?  Or CVS?  If you want to send
me a patch, I'll apply it, and then lets verify it didn't just change them
to ? characters.

Could we use the unicode equivalent or something?

> -----Original Message-----
> From: Corey Scott [mailto:corey.scott@gmail.com]
> Sent: Wednesday, October 27, 2004 4:23 PM
> To: Jakarta Commons Developers List; Mark Lowe
> Subject: Re: [email] test cases
>
>
> Ok... please ignore my previous message.
>
> I have checked out the current source.  An I do get 5 errors.
> The errors are ALL caused by the same thing.
> Now please let me try to explain what is causing this.
>
> The error is tests are for invalid character sets in the personal
> section of and email address (eg the persons name or desc).
>
> The tests originally had some unicode extended characters in them and
> some how we have lost them and they are now plain question marks.  The
> question marks are ofcourse valid characters and therefore the
> expected exceptions are not thrown.
>
> The original characters where: (note some may not see this)
> "ä", "ß"
>
> Any thoughts?
> Regards,
> Corey
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org


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


Re: [email] test cases

Posted by Corey Scott <co...@gmail.com>.
Ok... please ignore my previous message.

I have checked out the current source.  An I do get 5 errors.
The errors are ALL caused by the same thing.
Now please let me try to explain what is causing this.

The error is tests are for invalid character sets in the personal
section of and email address (eg the persons name or desc).

The tests originally had some unicode extended characters in them and
some how we have lost them and they are now plain question marks.  The
question marks are ofcourse valid characters and therefore the
expected exceptions are not thrown.

The original characters where: (note some may not see this)
"ä", "ß"

Any thoughts?
Regards,
Corey

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


RE: [email] test cases

Posted by Eric Pugh <ep...@upstate.com>.
Also, isn't there a "debug" setting that you can use so you see the output
of the STMP connection?  Try that as well..

> -----Original Message-----
> From: Corey Scott [mailto:corey.scott@gmail.com]
> Sent: Wednesday, October 27, 2004 4:14 PM
> To: Jakarta Commons Developers List; Mark Lowe
> Subject: Re: [email] test cases
>
>
> Do you have anymore info on why the tests are failing?
>
> If it the previous set of tests (before last nights updates) then it
> is probably due to some validation that was missing in one of the
> patches and should now be there.
> Namely, throwing exceptions on bad inputs like a null message.
>
> Other than that it I am can only think of a few places i have
> come accross this:
> 1) it may be an issue caused by the server requiring authentication
> and it not being set.
> 2) I thought that I had some problem running the tests with maven at
> one time, I never confirmed this, so this is unlikely
> 3) it may just be the tests that were testing the email validation and
> since that was removed they are failing as SMTP servers (atleast
> dumbster) is NOT throwing a messaging exception on invalid addresses I
> had expected.
>
> All that said, I have not being experiencing these troubles, I even
> rechecked out the project and applied the last patch that I submitted
> into a new project and it was all still ok.
>
> I will check it out again and see what I can find.
>
> Regards,
> Corey
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org


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


Re: [email] test cases

Posted by Corey Scott <co...@gmail.com>.
Do you have anymore info on why the tests are failing?

If it the previous set of tests (before last nights updates) then it
is probably due to some validation that was missing in one of the
patches and should now be there.
Namely, throwing exceptions on bad inputs like a null message.

Other than that it I am can only think of a few places i have come accross this:
1) it may be an issue caused by the server requiring authentication
and it not being set.
2) I thought that I had some problem running the tests with maven at
one time, I never confirmed this, so this is unlikely
3) it may just be the tests that were testing the email validation and
since that was removed they are failing as SMTP servers (atleast
dumbster) is NOT throwing a messaging exception on invalid addresses I
had expected.

All that said, I have not being experiencing these troubles, I even
rechecked out the project and applied the last patch that I submitted
into a new project and it was all still ok.

I will check it out again and see what I can find.

Regards,
Corey

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


Re: [email] test cases

Posted by Mark Lowe <me...@gmail.com>.
The problem is I need to check output, the stuff that Junit cant do.
So the easiest way is having teh emails mailed from the test cases..

test:test:
    [junit] Running org.apache.commons.mail.DefaultAuthenticatorTest
    [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 1.964 sec
    [junit] Running org.apache.commons.mail.EmailAttachmentTest
    [junit] Tests run: 5, Failures: 0, Errors: 0, Time elapsed: 4.907 sec
    [junit] Running org.apache.commons.mail.EmailTest
    [junit] Tests run: 37, Failures: 7, Errors: 0, Time elapsed: 2.171 sec
    [junit] [ERROR] TEST org.apache.commons.mail.EmailTest FAILED
    [junit] Running org.apache.commons.mail.HtmlEmailTest
    [junit] Tests run: 5, Failures: 1, Errors: 0, Time elapsed: 9.349 sec
    [junit] [ERROR] TEST org.apache.commons.mail.HtmlEmailTest FAILED
    [junit] Running org.apache.commons.mail.MultiPartEmailTest
    [junit] Tests run: 11, Failures: 1, Errors: 0, Time elapsed: 11.09 sec
    [junit] [ERROR] TEST org.apache.commons.mail.MultiPartEmailTest FAILED
    [junit] Running org.apache.commons.mail.SimpleEmailTest
    [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 2.779 sec

All these errors seem related to when the mails attempt to send.

Mark

On Wed, 27 Oct 2004 14:23:08 +0200, Eric Pugh <ep...@upstate.com> wrote:
> All but the "EmailTest" should run..   Dumbster [1] fakes out your SMTP
> server, so you don't even need one.  Of course, I am not sure what happens
> if you have a real smtp server running on port 25 and you use Dumbster.
> 
> I assume you are running under Maven?  Run "maven test" and most should
> work.
> 
> Eric
> 
> [1] http://www.quintanasoft.com/dumbster/
> 
> 
> 
> > -----Original Message-----
> > From: Mark Lowe [mailto:melowe@gmail.com]
> > Sent: Wednesday, October 27, 2004 1:49 PM
> > To: Commons dev list
> > Subject: [email] test cases
> >
> >
> > Should these test cases work (after editing the EmailConfig test class)?
> >
> > I had most of them working yesterday enough to mail me the test mails,
> > but today i cant get them doing anything. I have an smtp service
> > running locally, but is this being done by this dumpster thing now?
> >
> > Anything you could do to help be get these cases working would be
> > great. All of them are related to the Test classes themselves not the
> > actual code they are testing. Once I have a clearer idea what could be
> > up i'll be able to enter a bug report, but i don't even have that
> > amount of clarity yet.
> >
> > Mark
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 
>

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


RE: [email] test cases

Posted by Eric Pugh <ep...@upstate.com>.
All but the "EmailTest" should run..   Dumbster [1] fakes out your SMTP
server, so you don't even need one.  Of course, I am not sure what happens
if you have a real smtp server running on port 25 and you use Dumbster.

I assume you are running under Maven?  Run "maven test" and most should
work.

Eric


[1] http://www.quintanasoft.com/dumbster/

> -----Original Message-----
> From: Mark Lowe [mailto:melowe@gmail.com]
> Sent: Wednesday, October 27, 2004 1:49 PM
> To: Commons dev list
> Subject: [email] test cases
>
>
> Should these test cases work (after editing the EmailConfig test class)?
>
> I had most of them working yesterday enough to mail me the test mails,
> but today i cant get them doing anything. I have an smtp service
> running locally, but is this being done by this dumpster thing now?
>
> Anything you could do to help be get these cases working would be
> great. All of them are related to the Test classes themselves not the
> actual code they are testing. Once I have a clearer idea what could be
> up i'll be able to enter a bug report, but i don't even have that
> amount of clarity yet.
>
> Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org


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