Skip to content

Commit bce961d

Browse files
Step Qpid version (#256)
* Step Qpid version 6.1.3 -> 7.1.0 * Made necessary adaptions in the tests
1 parent 4966438 commit bce961d

File tree

8 files changed

+191
-200
lines changed

8 files changed

+191
-200
lines changed

pom.xml

Lines changed: 66 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@
5151
</reporting>
5252

5353
<repositories>
54+
<repository>
55+
<id>hortonworks.com</id>
56+
<url>http://nexus-private.hortonworks.com:8081/nexus/content/groups/public</url>
57+
</repository>
5458
<repository>
5559
<id>jboss-public-repository-group</id>
5660
<name>JBoss Public Maven Repository Group</name>
@@ -279,10 +283,36 @@
279283
<dependency>
280284
<groupId>org.apache.qpid</groupId>
281285
<artifactId>qpid-broker</artifactId>
282-
<version>6.1.3</version>
286+
<version>7.1.0</version>
283287
<scope>test</scope>
284288
</dependency>
285289

290+
<dependency>
291+
<groupId>org.apache.qpid</groupId>
292+
<artifactId>qpid-broker-core</artifactId>
293+
<version>7.1.0</version>
294+
</dependency>
295+
296+
<!-- https://mvnrepository.com/artifact/org.apache.qpid/qpid-broker-plugins-management-http -->
297+
<dependency>
298+
<groupId>org.apache.qpid</groupId>
299+
<artifactId>qpid-broker-plugins-management-http</artifactId>
300+
<version>7.1.0</version>
301+
<scope>runtime</scope>
302+
</dependency>
303+
304+
<dependency>
305+
<groupId>org.apache.qpid</groupId>
306+
<artifactId>qpid-broker-plugins-amqp-1-0-protocol</artifactId>
307+
<version>7.1.0</version>
308+
</dependency>
309+
310+
<dependency>
311+
<groupId>org.apache.qpid</groupId>
312+
<artifactId>qpid-broker-plugins-memory-store</artifactId>
313+
<version>7.1.0</version>
314+
</dependency>
315+
286316
<dependency>
287317
<groupId>de.flapdoodle.embed</groupId>
288318
<artifactId>de.flapdoodle.embed.mongo</artifactId>
@@ -364,7 +394,7 @@
364394
<version>${springBootVersion}</version>
365395
</plugin>
366396

367-
<!-- PhoenixNAP RAML Code Generator plugin used to generate sources
397+
<!-- PhoenixNAP RAML Code Generator plugin used to generate sources
368398
from raml -->
369399
<plugin>
370400
<groupId>com.phoenixnap.oss</groupId>
@@ -458,37 +488,37 @@
458488
</plugin>
459489

460490
<plugin>
461-
<groupId>org.apache.maven.plugins</groupId>
462-
<artifactId>maven-failsafe-plugin</artifactId>
463-
<version>2.22.0</version>
464-
<executions>
465-
<execution>
466-
<id>integration-test</id>
467-
<goals>
468-
<goal>integration-test</goal>
469-
<goal>verify</goal>
470-
</goals>
471-
<phase>integration-test</phase>
472-
</execution>
473-
</executions>
474-
<configuration>
475-
<forkCount>3</forkCount>
476-
<reuseForks>false</reuseForks>
477-
<skipTests>${skipTests}</skipTests>
478-
<skipITs>${skipITs}</skipITs>
479-
<systemPropertyVariables>
480-
<systemTest>true</systemTest>
481-
<er.url>http://localhost:8080/eventrepository/search/</er.url>
482-
</systemPropertyVariables>
483-
<excludes>
484-
<exclude>**/test/*</exclude>
485-
<exclude>**/functionaltests/*</exclude>
486-
</excludes>
487-
<additionalClasspathElements>
488-
<additionalClasspathElement>${basedir}/target/classes</additionalClasspathElement>
489-
</additionalClasspathElements>
490-
</configuration>
491-
</plugin>
491+
<groupId>org.apache.maven.plugins</groupId>
492+
<artifactId>maven-failsafe-plugin</artifactId>
493+
<version>2.22.0</version>
494+
<executions>
495+
<execution>
496+
<id>integration-test</id>
497+
<goals>
498+
<goal>integration-test</goal>
499+
<goal>verify</goal>
500+
</goals>
501+
<phase>integration-test</phase>
502+
</execution>
503+
</executions>
504+
<configuration>
505+
<forkCount>3</forkCount>
506+
<reuseForks>false</reuseForks>
507+
<skipTests>${skipTests}</skipTests>
508+
<skipITs>${skipITs}</skipITs>
509+
<systemPropertyVariables>
510+
<systemTest>true</systemTest>
511+
<er.url>http://localhost:8080/eventrepository/search/</er.url>
512+
</systemPropertyVariables>
513+
<excludes>
514+
<exclude>**/test/*</exclude>
515+
<exclude>**/functionaltests/*</exclude>
516+
</excludes>
517+
<additionalClasspathElements>
518+
<additionalClasspathElement>${basedir}/target/classes</additionalClasspathElement>
519+
</additionalClasspathElements>
520+
</configuration>
521+
</plugin>
492522

493523
<plugin>
494524
<groupId>org.apache.maven.plugins</groupId>
@@ -511,8 +541,8 @@
511541
<goal>copy-resources</goal>
512542
</goals>
513543
<configuration>
514-
<!-- site plugin requires all resources to exist within
515-
resources/ directory -->
544+
<!-- site plugin requires all resources to exist
545+
within resources/ directory -->
516546
<!-- but we don't want to break links in documentation -->
517547
<outputDirectory>${basedir}/wiki/resources/images</outputDirectory>
518548
<resources>
@@ -535,7 +565,7 @@
535565
<configuration>
536566
<!-- This is where site.xml is located -->
537567
<siteDirectory>${basedir}/wiki</siteDirectory>
538-
<!-- Github pages only generates documentation from docs
568+
<!-- Github pages only generates documentation from docs
539569
directory -->
540570
<outputDirectory>${basedir}/docs</outputDirectory>
541571
</configuration>
Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,56 @@
11
package com.ericsson.ei.utils;
22

3-
import com.google.common.io.Files;
3+
import java.io.File;
4+
import java.util.HashMap;
5+
import java.util.Map;
46

5-
import org.apache.qpid.server.Broker;
6-
import org.apache.qpid.server.BrokerOptions;
7+
import org.apache.qpid.server.SystemLauncher;
8+
import org.apache.qpid.server.model.SystemConfig;
9+
import org.apache.qpid.server.store.MemoryMessageStore;
10+
import org.slf4j.Logger;
11+
import org.slf4j.LoggerFactory;
712

813
public class AMQPBrokerManager {
14+
private String path;
15+
private int port;
916
public boolean isRunning = false;
17+
private String passwordFile = "src/functionaltests/resources/configs/password.properties";
1018

11-
private final Broker broker = new Broker();
12-
private String path;
13-
private String port;
19+
private SystemLauncher systemLauncher = new SystemLauncher();
20+
21+
private final static Logger LOGGER = LoggerFactory.getLogger(TestConfigs.class);
1422

15-
public AMQPBrokerManager(String path, String port) {
23+
public AMQPBrokerManager(String path, int port) {
1624
super();
1725
this.path = path;
1826
this.port = port;
1927
}
2028

21-
public void startBroker() throws Exception {
22-
final BrokerOptions brokerOptions = new BrokerOptions();
23-
brokerOptions.setConfigProperty("qpid.amqp_port", port);
24-
brokerOptions.setConfigProperty("qpid.pass_file", "src/functionaltests/resources/configs/password.properties");
25-
brokerOptions.setConfigProperty("qpid.work_dir", Files.createTempDir().getAbsolutePath());
26-
brokerOptions.setInitialConfigurationLocation(path);
29+
private Map<String, Object> createSystemConfig() {
30+
String passwordPath = new File(passwordFile).getAbsolutePath();
31+
Map<String, String> context = new HashMap<>();
32+
context.put("qpid.amqp_port", "" + port);
33+
context.put("qpid.pass_file", passwordPath);
34+
35+
Map<String, Object> attributes = new HashMap<>();
36+
attributes.put(SystemConfig.CONTEXT, context);
37+
attributes.put(SystemConfig.TYPE, MemoryMessageStore.TYPE);
38+
attributes.put(SystemConfig.INITIAL_CONFIGURATION_LOCATION, path);
39+
return attributes;
40+
}
2741

28-
broker.startup(brokerOptions);
42+
public void startBroker() throws Exception {
43+
try {
44+
systemLauncher.startup(createSystemConfig());
45+
} catch (Exception e) {
46+
LOGGER.error("Create QPID System Config fail. \nError: {}", e.getMessage());
47+
e.printStackTrace();
48+
}
2949
isRunning = true;
3050
}
3151

3252
public void stopBroker() {
33-
broker.shutdown();
53+
systemLauncher.shutdown();
3454
isRunning = false;
3555
}
3656
}

src/functionaltests/java/com/ericsson/ei/utils/TestConfigs.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ AMQPBrokerManager createAmqpBroker() throws Exception {
3636

3737
String config = "src/functionaltests/resources/configs/qpidConfig.json";
3838
File qpidConfig = new File(config);
39-
AMQPBrokerManager amqpBroker = new AMQPBrokerManager(qpidConfig.getAbsolutePath(), Integer.toString(port));
39+
AMQPBrokerManager amqpBroker = new AMQPBrokerManager(qpidConfig.getAbsolutePath(), port);
4040

4141
LOGGER.debug("Started embedded message bus for tests on port: " + port);
4242
amqpBroker.startBroker();
Lines changed: 25 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,32 @@
11
{
2-
"name" : "broker",
3-
"modelVersion" : "6.0",
4-
"authenticationproviders" : [ {
2+
"name": "Embedded Broker",
3+
"modelVersion": "7.1",
4+
"authenticationproviders" : [ {
55
"name" : "passwordFile",
66
"path" : "${qpid.pass_file}",
77
"type" : "PlainPasswordFile",
88
"secureOnlyMechanisms": []
99
} ],
10-
"ports" : [ {
11-
"name" : "AMQP",
12-
"port" : "${qpid.amqp_port}",
13-
"authenticationProvider" : "passwordFile",
14-
"virtualhostaliases" : [ {
15-
"name" : "defaultAlias",
16-
"type" : "defaultAlias"
17-
}, {
18-
"name" : "hostnameAlias",
19-
"type" : "hostnameAlias"
20-
}, {
21-
"name" : "nameAlias",
22-
"type" : "nameAlias"
23-
} ]
24-
} ],
25-
"virtualhostnodes" : [ {
26-
"name" : "default",
27-
"type" : "JSON",
28-
"defaultVirtualHostNode" : "true",
29-
"virtualHostInitialConfiguration" : "{\"type\" : \"Memory\",\"name\" : \"default\",\"modelVersion\" : \"6.0\"}"
30-
},
31-
{
32-
"name" : "second",
33-
"type" : "JSON",
34-
"defaultVirtualHostNode" : "false",
35-
"virtualHostInitialConfiguration" : "{\"type\" : \"Memory\",\"name\" : \"second\",\"modelVersion\" : \"6.0\"}"
36-
},
37-
{
38-
"name" : "third",
39-
"type" : "JSON",
40-
"defaultVirtualHostNode" : "false",
41-
"virtualHostInitialConfiguration" : "{\"type\" : \"Memory\",\"name\" : \"third\",\"modelVersion\" : \"6.0\"}"
42-
},
43-
{
44-
"name" : "fourth",
45-
"type" : "JSON",
46-
"defaultVirtualHostNode" : "false",
47-
"virtualHostInitialConfiguration" : "{\"type\" : \"Memory\",\"name\" : \"fourth\",\"modelVersion\" : \"6.0\"}"
48-
},
49-
{
50-
"name" : "fith",
51-
"type" : "JSON",
52-
"defaultVirtualHostNode" : "false",
53-
"virtualHostInitialConfiguration" : "{\"type\" : \"Memory\",\"name\" : \"fith\",\"modelVersion\" : \"6.0\"}"
54-
},
55-
{
56-
"name" : "sixth",
57-
"type" : "JSON",
58-
"defaultVirtualHostNode" : "false",
59-
"virtualHostInitialConfiguration" : "{\"type\" : \"Memory\",\"name\" : \"sixth\",\"modelVersion\" : \"6.0\"}"
60-
},
61-
{
62-
"name" : "seventh",
63-
"type" : "JSON",
64-
"defaultVirtualHostNode" : "false",
65-
"virtualHostInitialConfiguration" : "{\"type\" : \"Memory\",\"name\" : \"seventh\",\"modelVersion\" : \"6.0\"}"
66-
},
67-
{
68-
"name" : "eight",
69-
"type" : "JSON",
70-
"defaultVirtualHostNode" : "false",
71-
"virtualHostInitialConfiguration" : "{\"type\" : \"Memory\",\"name\" : \"eight\",\"modelVersion\" : \"6.0\"}"
72-
} ]
10+
"ports" : [ {
11+
"name" : "AMQP",
12+
"port" : "${qpid.amqp_port}",
13+
"protocols": [ "AMQP_0_9", "AMQP_0_9_1", "AMQP_1_0" ],
14+
"authenticationProvider" : "passwordFile",
15+
"virtualhostaliases" : [ {
16+
"name" : "nameAlias",
17+
"type" : "nameAlias"
18+
}, {
19+
"name" : "defaultAlias",
20+
"type" : "defaultAlias"
21+
}, {
22+
"name" : "hostnameAlias",
23+
"type" : "hostnameAlias"
24+
} ]
25+
}],
26+
"virtualhostnodes" : [ {
27+
"name" : "default",
28+
"type" : "Memory",
29+
"defaultVirtualHostNode" : "true",
30+
"virtualHostInitialConfiguration" : "{\"type\" : \"Memory\",\"name\" : \"default\",\"modelVersion\" : \"7.1\"}"
31+
}]
7332
}

src/test/java/com/ericsson/ei/controller/TestQueryControllerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import com.ericsson.ei.App;
2020
import com.ericsson.ei.queryservice.ProcessQueryParams;
2121

22-
import org.apache.qpid.util.FileUtils;
22+
import org.apache.qpid.server.util.FileUtils;
2323
import org.json.JSONArray;
2424
import org.json.JSONObject;
2525
import org.junit.Before;

0 commit comments

Comments
 (0)