This commit is contained in:
Clebert Suconic 2018-02-21 12:55:49 -05:00
commit d83758e1aa
6 changed files with 37 additions and 23 deletions

View File

@ -380,7 +380,7 @@ public class NetworkHealthCheck extends ActiveMQScheduledComponent {
if (error) { if (error) {
ActiveMQUtilLogger.LOGGER.failedToReadFromStream(inputLine); ActiveMQUtilLogger.LOGGER.failedToReadFromStream(inputLine);
} else { } else {
logger.trace(inputLine); logger.debug(inputLine);
} }
} }

View File

@ -37,6 +37,8 @@ import org.junit.Assert;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import static org.junit.Assume.assumeTrue;
public class NetworkHealthTest { public class NetworkHealthTest {
private static final InetAddress INVALID_ADDRESS; private static final InetAddress INVALID_ADDRESS;
@ -127,6 +129,7 @@ public class NetworkHealthTest {
@Test @Test
public void testCheck6() throws Exception { public void testCheck6() throws Exception {
assumeTrue(purePingWorks(IPV6_LOCAL));
NetworkHealthCheck check = addCheck(new NetworkHealthCheck(null, 100, 100)); NetworkHealthCheck check = addCheck(new NetworkHealthCheck(null, 100, 100));
check.addComponent(component); check.addComponent(component);
@ -161,6 +164,7 @@ public class NetworkHealthTest {
@Test @Test
public void testPings() throws Exception { public void testPings() throws Exception {
assumeTrue(purePingWorks("127.0.0.1"));
doCheck("127.0.0.1"); doCheck("127.0.0.1");
} }
@ -181,9 +185,18 @@ public class NetworkHealthTest {
@Test @Test
public void testPingsIPV6() throws Exception { public void testPingsIPV6() throws Exception {
assumeTrue(purePingWorks(IPV6_LOCAL));
doCheck(IPV6_LOCAL); doCheck(IPV6_LOCAL);
} }
private boolean purePingWorks(String localaddress) throws Exception {
try {
return addCheck(new NetworkHealthCheck(null, 100, 100)).purePing(InetAddress.getByName(localaddress));
} catch (Exception e) {
return false;
}
}
@Test @Test
public void testCheckNoNodes() throws Exception { public void testCheckNoNodes() throws Exception {
NetworkHealthCheck check = addCheck(new NetworkHealthCheck()); NetworkHealthCheck check = addCheck(new NetworkHealthCheck());

View File

@ -34,6 +34,7 @@ under the License.
<name>Artemis Tomcat JNDI Resources Example</name> <name>Artemis Tomcat JNDI Resources Example</name>
<properties> <properties>
<activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<projectBaseUri>${project.baseUri}</projectBaseUri> <projectBaseUri>${project.baseUri}</projectBaseUri>
<java.version>1.6</java.version> <java.version>1.6</java.version>

View File

@ -34,9 +34,8 @@ public class SendMessageController {
@Autowired @Autowired
private JmsTemplate jmsTemplate; private JmsTemplate jmsTemplate;
@RequestMapping("/send") @RequestMapping("/send")
public @ResponseBody String send(@RequestParam(value="text", defaultValue="hello world") final String text) { public @ResponseBody String send(@RequestParam(value = "text", defaultValue = "hello world") final String text) {
jmsTemplate.send(new MessageCreator() { jmsTemplate.send(new MessageCreator() {
@Override @Override
public Message createMessage(Session session) throws JMSException { public Message createMessage(Session session) throws JMSException {

View File

@ -22,8 +22,8 @@ under the License.
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.apache.activemq.examples.clustered</groupId> <groupId>org.apache.activemq.examples.mqtt</groupId>
<artifactId>broker-clustered</artifactId> <artifactId>mqtt-examples</artifactId>
<version>2.5.0-SNAPSHOT</version> <version>2.5.0-SNAPSHOT</version>
</parent> </parent>

11
pom.xml
View File

@ -143,7 +143,6 @@
<skipConcurrentTests>true</skipConcurrentTests> <skipConcurrentTests>true</skipConcurrentTests>
<skipRestTests>true</skipRestTests> <skipRestTests>true</skipRestTests>
<skipActiveMQ5Tests>true</skipActiveMQ5Tests> <skipActiveMQ5Tests>true</skipActiveMQ5Tests>
<skipExtraTests>true</skipExtraTests>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
@ -186,6 +185,10 @@
<netty-transport-native-epoll-classifier>linux-x86_64</netty-transport-native-epoll-classifier> <netty-transport-native-epoll-classifier>linux-x86_64</netty-transport-native-epoll-classifier>
<netty-transport-native-kqueue-classifier>osx-x86_64</netty-transport-native-kqueue-classifier> <netty-transport-native-kqueue-classifier>osx-x86_64</netty-transport-native-kqueue-classifier>
<!-- Ignore failed tests by default because there are "known" failures in the full test-suite.
This will be set to false for the "fast-tests" profile as none of those tests should fail. -->
<testFailureIgnore>true</testFailureIgnore>
</properties> </properties>
<scm> <scm>
@ -996,7 +999,6 @@
<skipExtraTests>false</skipExtraTests> <skipExtraTests>false</skipExtraTests>
<skipStyleCheck>false</skipStyleCheck> <skipStyleCheck>false</skipStyleCheck>
<skipLicenseCheck>false</skipLicenseCheck> <skipLicenseCheck>false</skipLicenseCheck>
<skipExtraTests>false</skipExtraTests>
</properties> </properties>
</profile> </profile>
<profile> <profile>
@ -1026,11 +1028,10 @@
<skipJmsTests>false</skipJmsTests> <skipJmsTests>false</skipJmsTests>
<skipJoramTests>false</skipJoramTests> <skipJoramTests>false</skipJoramTests>
<skipConcurrentTests>false</skipConcurrentTests> <skipConcurrentTests>false</skipConcurrentTests>
<skipRestTests>false</skipRestTests>
<skipExtraTests>true</skipExtraTests>
<skipStyleCheck>false</skipStyleCheck> <skipStyleCheck>false</skipStyleCheck>
<skipLicenseCheck>false</skipLicenseCheck> <skipLicenseCheck>false</skipLicenseCheck>
<skipCompatibilityTests>false</skipCompatibilityTests> <skipCompatibilityTests>false</skipCompatibilityTests>
<testFailureIgnore>false</testFailureIgnore>
</properties> </properties>
</profile> </profile>
<profile> <profile>
@ -1419,7 +1420,7 @@
<version>2.18.1</version> <version>2.18.1</version>
<configuration> <configuration>
<forkMode>once</forkMode> <forkMode>once</forkMode>
<testFailureIgnore>true</testFailureIgnore> <testFailureIgnore>${testFailureIgnore}</testFailureIgnore>
<runOrder>alphabetical</runOrder> <runOrder>alphabetical</runOrder>
<redirectTestOutputToFile>false</redirectTestOutputToFile> <redirectTestOutputToFile>false</redirectTestOutputToFile>
<argLine>${activemq-surefire-argline}</argLine> <argLine>${activemq-surefire-argline}</argLine>