-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Daniel John Debrunner wrote: > [EMAIL PROTECTED] wrote: > >> Author: andreask >> Date: Fri Aug 18 06:05:45 2006 >> New Revision: 432569 >> >> URL: http://svn.apache.org/viewvc?rev=432569&view=rev >> Log: >> Fixed bug in setUp causing it to only start server when running in embedded >> mode. > >> final public class NetworkServerTestSetup extends TestSetup { >> @@ -57,7 +53,7 @@ >> */ >> protected void setUp() throws Exception { >> >> - if (config.getJDBCClient().isEmbedded()) { >> + if (!config.getJDBCClient().isEmbedded()) { >> BaseTestCase.println("Starting network server:"); >> networkServerController = new NetworkServerControl >> (InetAddress.getByName(config.getHostName()), >> config.getPort()); >> > > Why is the check for isEmbedded even there? >
As it is now, I need the check of isEmbedded() somewhere. Either in NetworkServerTestSetup, or in the jdbcapi._Suite.suite() method. > Wouldn't a test or a suite installing this decorator indicate that the > network server needs to be started? Not saying it's wrong, I'm just > trying to understand how it would be used. I was assuming that this > decorator would only be used outside of the existing harness, or inside > the harness only for tests that only run in network server mode. > > E.g. I was imanging a top level JUnit suite AllJDBC that would include > the jdbcapi._Suite and jdbc40._Suite like this. > > suite.add(jdbcapi._Suite.suite()); > suite.add(jdbcapi._Suite.suite()); > > suite.add(new NetworkServerTestSetup(jdbcapi._Suite.suite())); > suite.add(new NetworkServerTestSetup(jdbc40._Suite.suite())); > Then NetworkServerTestSetup would also need a mechanism to tell the underlying test(s) that they should use network driver instead of embedded. The way I was planning to use NetworkServerTestSetup, right now, was to have : jdbcapi._Suite.suite() { .. suite.addTest(ConcurrencyTest.suite()); suite.addTest(..); .. return new NetworkServerTestSetup(suite)) } Alternatively, I could move the check to the suite() method: jdbcapi._Suite.suite() { .. suite.addTest(ConcurrencyTest.suite()); suite.addTest(..); .. if (isEmbedded) { return suite } else { return new NetworkServerTestSetup(suite)) } } I would also need to disable starting of network server from the harness for the _Suite test. Andreas > Dan. > > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.4 (SunOS) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFE5dc936DpyYjYNyIRAu67AKDJ/96f1NqWIjYdAOGoJzJtYwfk+QCdEVRL 5HebJuZtQtqgYBroFJQaKUo= =u76I -----END PGP SIGNATURE-----