Skip to content

Commit c233a46

Browse files
erik-edlingtobiasake
authored andcommitted
Add EI Eiffel Agen Systemtests (#227)
1 parent 04eb3ea commit c233a46

36 files changed

+2600
-76
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ install:
3939
- java -Dspring.config.additional-location=file:../src/integrationtest/resources/integration-test.properties -Dserver.port=${EI_BACKEND_PORT} -jar ${EIFFEL_WAR} &
4040
- cd ..
4141

42-
4342
after_script:
4443
- docker-compose -f src/main/docker/docker-compose.yml down
4544
- fuser -k ${EI_BACKEND_PORT}/tcp

pom.xml

Lines changed: 119 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
<java.version>1.8</java.version>
2323
<output-relative-path>src/main/java</output-relative-path>
2424
<skipTests>false</skipTests>
25-
<skipITs>${skipTests}</skipITs>
2625
<skipUTs>${skipTests}</skipUTs>
2726
<springBootVersion>${project.parent.version}</springBootVersion>
2827
<forkCountTests>2.5C</forkCountTests>
@@ -46,13 +45,6 @@
4645
</plugins>
4746
</reporting>
4847

49-
<repositories>
50-
<repository>
51-
<id>jitpack.io</id>
52-
<url>https://jitpack.io</url>
53-
</repository>
54-
</repositories>
55-
5648
<dependencies>
5749
<dependency>
5850
<groupId>org.springframework.boot</groupId>
@@ -81,12 +73,20 @@
8173
<version>${springBootVersion}</version>
8274
<scope>compile</scope>
8375
</dependency>
76+
8477
<dependency>
8578
<groupId>org.springframework.boot</groupId>
8679
<artifactId>spring-boot-starter-test</artifactId>
8780
<version>${springBootVersion}</version>
8881
<scope>test</scope>
82+
<exclusions>
83+
<exclusion>
84+
<groupId>com.vaadin.external.google</groupId>
85+
<artifactId>android-json</artifactId>
86+
</exclusion>
87+
</exclusions>
8988
</dependency>
89+
9090
<dependency>
9191
<groupId>org.apache.httpcomponents</groupId>
9292
<artifactId>httpclient</artifactId>
@@ -132,6 +132,12 @@
132132
<groupId>org.mock-server</groupId>
133133
<artifactId>mockserver-client-java</artifactId>
134134
<version>5.4.1</version>
135+
<exclusions>
136+
<exclusion>
137+
<groupId>com.vaadin.external.google</groupId>
138+
<artifactId>android-json</artifactId>
139+
</exclusion>
140+
</exclusions>
135141
</dependency>
136142
<!-- https://mvnrepository.com/artifact/org.mock-server/mockserver-netty -->
137143
<dependency>
@@ -177,7 +183,20 @@
177183
<artifactId>eiffel-commons</artifactId>
178184
<version>0.0.12</version>
179185
</dependency>
186+
<dependency>
187+
<groupId>org.json</groupId>
188+
<artifactId>json</artifactId>
189+
<version>20180130</version>
190+
</dependency>
180191
</dependencies>
192+
<dependencyManagement>
193+
</dependencyManagement>
194+
<repositories>
195+
<repository>
196+
<id>jitpack.io</id>
197+
<url>https://jitpack.io</url>
198+
</repository>
199+
</repositories>
181200

182201
<build>
183202
<resources>
@@ -237,12 +256,13 @@
237256
<source>src/functionaltest/resources</source>
238257
<source>src/integrationtest/java</source>
239258
<source>src/integrationtest/resources</source>
259+
<source>src/systemtest/java</source>
260+
<source>src/systemtest/resources</source>
240261
</sources>
241262
</configuration>
242263
</execution>
243264
</executions>
244265
</plugin>
245-
246266
<plugin>
247267
<groupId>org.apache.maven.plugins</groupId>
248268
<artifactId>maven-surefire-plugin</artifactId>
@@ -258,49 +278,22 @@
258278
<exclude>TestBaseClass</exclude>
259279
<exclude>SeleniumBaseClass</exclude>
260280
<exclude>CommonSteps</exclude>
281+
<exclude>**/systemtest/**</exclude>
261282
</excludes>
262283
<includes>
263284
<include>${someModule.test.includes}</include>
264285
</includes>
265286
</configuration>
266287
</plugin>
267-
268-
<plugin>
269-
<groupId>org.apache.maven.plugins</groupId>
270-
<artifactId>maven-failsafe-plugin</artifactId>
271-
<version>2.22.0</version>
272-
<configuration>
273-
<skipTests>${skipTests}</skipTests>
274-
<skipITs>${skipITs}</skipITs>
275-
<systemPropertyVariables>
276-
<rabbit.host>localhost</rabbit.host>
277-
<rabbit.port>5672</rabbit.port>
278-
<rabbit.username>myuser</rabbit.username>
279-
<rabbit.password>myuser</rabbit.password>
280-
<rabbit.exchange>ei-exchange</rabbit.exchange>
281-
<rabbit.key>#</rabbit.key>
282-
</systemPropertyVariables>
283-
</configuration>
284-
<executions>
285-
<execution>
286-
<id>integration-test</id>
287-
<goals>
288-
<goal>integration-test</goal>
289-
<goal>verify</goal>
290-
</goals>
291-
<phase>integration-test</phase>
292-
</execution>
293-
</executions>
294-
</plugin>
295-
288+
296289
<plugin>
297290
<groupId>org.apache.maven.plugins</groupId>
298291
<artifactId>maven-site-plugin</artifactId>
299292
<version>3.7.1</version>
300293
<configuration>
301294
<!-- This is where site.xml is located -->
302295
<siteDirectory>${basedir}/wiki</siteDirectory>
303-
<!-- Github pages only generates documentation from docs
296+
<!-- Github pages only generates documentation from docs
304297
directory -->
305298
<outputDirectory>${basedir}/docs</outputDirectory>
306299
</configuration>
@@ -312,7 +305,6 @@
312305
</dependency>
313306
</dependencies>
314307
</plugin>
315-
316308
<plugin>
317309
<artifactId>maven-resources-plugin</artifactId>
318310
<version>3.1.0</version>
@@ -325,7 +317,7 @@
325317
<goal>copy-resources</goal>
326318
</goals>
327319
<configuration>
328-
<!-- plugin requires all resources to exist within
320+
<!-- plugin requires all resources to exist within
329321
resources/ directory -->
330322
<!-- but we don't want to break links in documentation -->
331323
<outputDirectory>${basedir}/wiki/resources/images</outputDirectory>
@@ -341,7 +333,92 @@
341333
</execution>
342334
</executions>
343335
</plugin>
344-
345336
</plugins>
346337
</build>
338+
<profiles>
339+
<!-- The Configuration of the integration-test profile -->
340+
<profile>
341+
<id>integrationTest</id>
342+
<properties>
343+
<skipUTs>true</skipUTs>
344+
</properties>
345+
<activation>
346+
<activeByDefault>false</activeByDefault>
347+
</activation>
348+
<build>
349+
<plugins>
350+
<plugin>
351+
<groupId>org.apache.maven.plugins</groupId>
352+
<artifactId>maven-failsafe-plugin</artifactId>
353+
<version>2.22.0</version>
354+
<configuration>
355+
<skipTests>${skipTests}</skipTests>
356+
<skipITs>${skipITs}</skipITs>
357+
<systemPropertyVariables>
358+
<rabbitmq.host>localhost</rabbitmq.host>
359+
<rabbitmq.port>5672</rabbitmq.port>
360+
<rabbitmq.username>myuser</rabbitmq.username>
361+
<rabbitmq.password>myuser</rabbitmq.password>
362+
<rabbitmq.exchange>ei-exchange</rabbitmq.exchange>
363+
<rabbitmq.key>#</rabbitmq.key>
364+
</systemPropertyVariables>
365+
<excludes>
366+
<exclude>**/systemtest/**</exclude>
367+
</excludes>
368+
</configuration>
369+
<executions>
370+
<execution>
371+
<id>integration-test</id>
372+
<goals>
373+
<goal>integration-test</goal>
374+
<goal>verify</goal>
375+
</goals>
376+
<phase>integration-test</phase>
377+
</execution>
378+
</executions>
379+
</plugin>
380+
</plugins>
381+
</build>
382+
</profile>
383+
<!-- The Configuration of the system-test profile -->
384+
<profile>
385+
<id>systemTest</id>
386+
<properties>
387+
<skipUTs>true</skipUTs>
388+
</properties>
389+
<activation>
390+
<activeByDefault>false</activeByDefault>
391+
</activation>
392+
<build>
393+
<plugins>
394+
<plugin>
395+
<groupId>org.apache.maven.plugins</groupId>
396+
<artifactId>maven-failsafe-plugin</artifactId>
397+
<version>2.22.0</version>
398+
<configuration>
399+
<systemPropertyVariables>
400+
<ei.config.properties.file.path>${systemtestProperties}</ei.config.properties.file.path>
401+
</systemPropertyVariables>
402+
<excludes>
403+
<exclude>**/frontend/*</exclude>
404+
</excludes>
405+
<includes>
406+
<include>**/systemtest/**</include>
407+
</includes>
408+
</configuration>
409+
<executions>
410+
<execution>
411+
<id>systemTest</id>
412+
<phase>integration-test</phase>
413+
<goals>
414+
<goal>integration-test</goal>
415+
<goal>verify</goal>
416+
</goals>
417+
</execution>
418+
</executions>
419+
</plugin>
420+
</plugins>
421+
</build>
422+
</profile>
423+
</profiles>
347424
</project>

src/integrationtest/java/com/ericsson/ei/frontend/CommonSteps.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ public class CommonSteps extends AbstractTestExecutionListener {
5050
private String frontEndHost = "localhost";
5151
private String protocol = "http";
5252
private String baseURL;
53-
private String rabbitHost;
54-
private int rabbitPort;
55-
private String rabbitUsername;
56-
private String rabbitPassword;
57-
private String rabbitExchange;
58-
private String rabbitKey;
53+
private String rabbitmqHost;
54+
private int rabbitmqPort;
55+
private String rabbitmqUsername;
56+
private String rabbitmqPassword;
57+
private String rabbitmqExchange;
58+
private String rabbitmqKey;
5959

6060
private List<HttpRequest> httpRequestList = new ArrayList<>();
6161
private HttpRequest httpRequest;
@@ -75,12 +75,12 @@ public void beforeAllScenarios() {
7575

7676
@Before("@QueryByIdScenario or @QueryFreestyleScenario")
7777
public void beforeQueryScenario() {
78-
rabbitHost = System.getProperty("rabbit.host");
79-
rabbitPort = Integer.getInteger("rabbit.port");
80-
rabbitUsername = System.getProperty("rabbit.username");
81-
rabbitPassword = System.getProperty("rabbit.password");
82-
rabbitExchange = System.getProperty("rabbit.exchange");
83-
rabbitKey = System.getProperty("rabbit.key");
78+
rabbitmqHost = System.getProperty("rabbitmq.host");
79+
rabbitmqPort = Integer.getInteger("rabbitmq.port");
80+
rabbitmqUsername = System.getProperty("rabbitmq.username");
81+
rabbitmqPassword = System.getProperty("rabbitmq.password");
82+
rabbitmqExchange = System.getProperty("rabbitmq.exchange");
83+
rabbitmqKey = System.getProperty("rabbitmq.key");
8484
}
8585

8686
@Given("^frontend is up and running$")
@@ -95,8 +95,8 @@ public void aggregated_object_created() throws IOException, TimeoutException {
9595
String eventFilePath = Paths.get(RESOURCE_PATH, EIFFEL_EVENT_FILE).toString();
9696
String eventFileContent = FileUtils.readFileToString(new File(eventFilePath), "UTF-8");
9797

98-
AMQPCommunication amqp = new AMQPCommunication(rabbitHost, rabbitPort, rabbitUsername, rabbitPassword);
99-
assertEquals(true, amqp.produceMessage(eventFileContent, rabbitExchange, rabbitKey));
98+
AMQPCommunication amqp = new AMQPCommunication(rabbitmqHost, rabbitmqPort, rabbitmqUsername, rabbitmqPassword);
99+
assertEquals(true, amqp.produceMessage(eventFileContent, rabbitmqExchange, rabbitmqKey));
100100
amqp.closeConnection();
101101
LOGGER.debug("Eiffel events sent.");
102102
}

0 commit comments

Comments
 (0)