I got this to work for the simple-bigbank sample. It was much less
painful than I expected. Here's what I did:
1. Created a samples directory under sca/itest.
2. Created a simple-bigbank directory under sca/itest/samples.
3. Created poms for both of the above.
4. Removed the src/test files from samples/simple-bigbank.
5. Created src/test/bigbank/BigBankTestCase.java in
sca/itest/samples/simple-bigbank.
This "wrapper" JUnit test case is extremely simple:
package bigbank;
import bigbank.client.BigBankClient;
import junit.framework.TestCase;
public class BigBankTestCase extends TestCase {
public void test() throws Exception {
BigBankClient.main(null);
}
}
6. That's all! The pom for sca/itest/samples/simple-bigbank
contains sample-simple-bigbank as a dependency, so the jar
file for this is picked up from my local maven repo.
I'll try another sample, then raise a JIRA and post a complete patch
for the changes.
Simon
Simon Nash wrote:
I am wondering if we could get the best of both worlds by having
JUnit tests under sca/itest that invoke the samples (think of these
tests as "wrappers"), and removing all traces of JUnit from the
samples themselves. I'll try to do this on one or two samples and
see how well this works out.
Simon
Simon Laws wrote:
snip
I don't think the client that is used should be different
depending on whether ant or mvn was used to run the sample.
In both cases I think calculatorClient should be used.
So we would need to engineer the poms in the build to run the new client
classes rather than the junit classes. I don't think we should take the
junit tests out of the samples for the main build as the samples
provide a
useful extra set of tests (although if we have to to make for a better
user
experience then we have to). I'm just going to look at how the
distribution
build works. Maybe we can ship a different pom for the samples. If
someone
knows let us know.
Simon
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Simon C Nash IBM Distinguished Engineer
Hursley Park, Winchester, UK [EMAIL PROTECTED]
Tel. +44-1962-815156 Fax +44-1962-818999
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]