Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/foundation' into develop
Browse files Browse the repository at this point in the history
Conflicts:
	opennms-services/src/test/java/org/opennms/netmgt/xmlrpcd/XmlrpcdTest.java
  • Loading branch information
Jesse White committed May 5, 2015
2 parents 99f1d3e + 8bbd9e3 commit 8c8fb5e
Show file tree
Hide file tree
Showing 5 changed files with 147 additions and 147 deletions.
Expand Up @@ -141,7 +141,7 @@ private static Service[] getServiceList() throws Exception {
" <class-name>mx4j.tools.adaptor.http.HttpAdaptor</class-name>\n" +
" <attribute>\n" +
" <name>Port</name>\n" +
" <value type=\"java.lang.Integer\">58180</value>\n" +
" <value type=\"java.lang.Integer\">0</value>\n" +
" </attribute>\n" +
" <attribute>\n" +
" <name>Host</name>\n" +
Expand All @@ -167,7 +167,7 @@ private static Service[] getServiceList() throws Exception {
" <class-name>mx4j.tools.adaptor.http.HttpAdaptor</class-name>\n" +
" <attribute>\n" +
" <name>Port</name>\n" +
" <value type=\"java.lang.Integer\">58181</value>\n" +
" <value type=\"java.lang.Integer\">0</value>\n" +
" </attribute>\n" +
" <attribute>\n" +
" <name>Host</name>\n" +
Expand Down
Expand Up @@ -78,27 +78,17 @@ public class XmlRpcNotifierTest {

private static final int s_unknownNodeId = 2;

private static int s_port = 59000;

private static final boolean USE_DIFFERENT_PORT_PER_TEST = false;

@Before
public void setUp() throws Exception, InterruptedException, IOException {



MockLogAppender.setupLogging();

int port = s_port;
if (USE_DIFFERENT_PORT_PER_TEST) {
s_port++;
}

m_anticipator = new XmlrpcAnticipator(port);
m_anticipator = new XmlrpcAnticipator();
m_anticipator.anticipateCall("notifyReceivedEvent", "0", "uei.opennms.org/internal/capsd/xmlrpcNotification", "test connection");

XmlrpcServer remoteServer = new XmlrpcServer();
remoteServer.setUrl("http://localhost:" + port);
remoteServer.setUrl("http://localhost:" + m_anticipator.getPort());

m_notifier = new XmlRpcNotifier(new XmlrpcServer[] { remoteServer }, 1, 1500, false, "");
//m_notifier.setNodeLabel(new NodeLabelJDBCImpl());

Expand Down
Expand Up @@ -171,22 +171,22 @@ private boolean hashtablesMatchIgnoringDescriptionKeys(Object a, Object b) {
private int m_port;

/** default port number */
private static final int DEFAULT_PORT_NUMBER = 59000;
private static final int DEFAULT_PORT_NUMBER = 0;

/** logger */
private Logger m_logger = LoggerFactory.getLogger(getClass());

private static final String CHECK_METHOD_NAME = "XmlrpcAnticipatorCheck";

public XmlrpcAnticipator(int port, boolean delayWebServer) throws IOException {
private XmlrpcAnticipator(int port, boolean delayWebServer) throws IOException {
m_port = port;
if (!delayWebServer) {
setupWebServer();
}
}

public XmlrpcAnticipator(int port) throws IOException {
this(port, false);
public XmlrpcAnticipator(boolean delayWebServer) throws IOException {
this(DEFAULT_PORT_NUMBER, delayWebServer);
}

public XmlrpcAnticipator() throws IOException {
Expand Down
Expand Up @@ -45,7 +45,7 @@ public class XmlrpcAnticipatorTest extends TestCase {
protected void setUp() throws Exception {
super.setUp();

m_anticipator = new XmlrpcAnticipator(0);
m_anticipator = new XmlrpcAnticipator();
}

@Override
Expand Down Expand Up @@ -76,7 +76,7 @@ public void testSetupTwice() throws IOException {
// It's already been set up in setUp(), so just shutdown
m_anticipator.shutdown();

m_anticipator = new XmlrpcAnticipator(0);
m_anticipator = new XmlrpcAnticipator();
// Let tearDown() do the shutdown
}

Expand Down

0 comments on commit 8c8fb5e

Please sign in to comment.