james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ioan Eugen Stan <stan.ieu...@gmail.com>
Subject Re: NoSQL backend for James
Date Tue, 11 Oct 2011 06:14:33 GMT
2011/10/10 Pepijn de Vos <pepijndevos@yahoo.com>:
> Thanks a lot.
> On Oct 10, 2011, at 8:24 PM, Ioan Eugen Stan wrote:
>> Have patience. You will need it if you wish to complete something.
>> Patience and perseverance or else you'll be just another one who
>> tried.
> I don't expect to have it finished by the end of the week, but if I'm still completely
clueless by then, it's just not worth the effort.
> I don't have the ambition to become a James commiter or even a Java dev, I just thought
it would be nice to use CouchDB for my application.
> Somewhere is a point where pragmatism beats learning. There isn't any technical reason
why I can't use JPA.
>>> Can I just copy an existing one and rename stuff? In other words, how are the
modules glued into the whole? How does the server know which class to load? It's not in the
pom.xml, afaict.
>> Not sure what you mean by that. It uses dependency injection provided
>> by Spring framework (and soon Guice) to inject object references into
>> other objects at runtime.
> Ah, dependency injection. *googles* So just the fact that I implement the interface is
enough to @autowire it into James?

Yes. The wonders of DI.

>>> The sample config is gone btw: http://james.apache.org/server/3/config-mailbox.html
>>> Do I inherit tests as well? I would imagine that a lot of tests are common to
all mailbox implementations.
>> I think this is because the configuration changed and now it's spring
>> based, and more modular. I see you are very ambitious but I sense you
>> have a lot of catching up. James is complex so give it time, if you
>> expect too much from yourself and fail you will probably be too
>> disappointed.
> Yea, I read a Java book long ago, never did any big projects with it.
>> Make a public repo, commit something and ask if you get stuck. I will
>> try to help when/if I can. I suggest you start with simple
>> implementation that passes some unit tests.
> So If I take any mailbox impl, put it in a separate repo, will it work? All sorts of
things refer to the parent pom. I'll put something on github once I figure it out. I think
it'll work out once I get to the point where I can write some code.

Maven download all it's dependencies. Just declare the group and the
artifact and make sure the repository has those (it will complain if
it doesn't find them). If not, find a maven repo that has them and put
it in your pom.

>> See for example the unit tests I did for Mailbox interface in HBase
>> implementation:
>> http://svn.apache.org/repos/asf/james/mailbox/trunk/hbase/src/test/java/org/apache/james/mailbox/hbase/mail/model/HBaseMailboxTest.java
> What I mean with inheriting tests is that these all look very generic. They look like
they could test any mailbox implementation.

Up to some point, they should be generic because they implement an
API. Unit testing is suposed to test methods individually so they
should be quite simple. They have the purpose to keep you from writing
methods that accept or return values out of the accepted range. They
also keep you from introducing bugs in your implementation. Changes in
your method body will affect your tests. If they fail, something is
wrong. either your method, or your test. Having good tests is very

Unit tests should especially test for boundary values (null, negatives, 0, etc).

Ioan Eugen Stan

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

View raw message