ARTEMIS-4279 Improving BAD JDBC Configuration Test
Test was intermittently failing. It does not matter the return code, as long as the process is not alive
This commit is contained in:
parent
3671829993
commit
e959e3cfe8
|
@ -19,25 +19,28 @@ package org.apache.activemq.artemis.tests.smoke.jdbc;
|
|||
import org.apache.activemq.artemis.tests.smoke.common.SmokeTestBase;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class JdbcStartupTest extends SmokeTestBase {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
protected static final String SERVER_NAME = "jdbc-bad-driver";
|
||||
|
||||
@Test
|
||||
public void startupBadJdbcConnectionTest() throws Exception {
|
||||
|
||||
Integer exitVal = -1;
|
||||
Process p = startServer(SERVER_NAME, 0, 0);
|
||||
try {
|
||||
p.waitFor(10, TimeUnit.SECONDS);
|
||||
exitVal = p.exitValue();
|
||||
p.waitFor(20, TimeUnit.SECONDS);
|
||||
Assert.assertFalse(p.isAlive());
|
||||
} catch (Exception e) {
|
||||
Assert.fail();
|
||||
}
|
||||
|
||||
Assert.assertEquals(0, (long) exitVal);
|
||||
logger.warn(e.getMessage(), e);
|
||||
Assert.fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue