Skip to content

Commit 0fec171

Browse files
Anders Breiderik-edling
Anders Breid
authored andcommitted
Reverted back the way we read files (#20)
- Revert back the way we read files - Add .travis file for travis tests. - Update to README
1 parent 5eea369 commit 0fec171

File tree

8 files changed

+67
-9
lines changed

8 files changed

+67
-9
lines changed

.travis.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
sudo: required
2+
3+
dist: xenial
4+
5+
language: java
6+
7+
# services:
8+
# - docker
9+
10+
env:
11+
- JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64
12+
13+
# Run before every job
14+
before_install:
15+
- sudo apt-get update
16+
- sudo apt-get install -y openjdk-8-jdk
17+
- PATH=$(echo "$PATH" | sed -e 's/:\/usr\/local\/lib\/jvm\/openjdk11\/bin//')
18+
- java -version
19+
- uname -a
20+
- chmod +x pom.xml
21+
22+
23+
# This is only run before integrationTests job
24+
# To ensure docker containers are fully up and running we sleep 20s
25+
# before_script:
26+
# - cd src/main/docker/
27+
# - source env.bash
28+
# - docker-compose up -d
29+
# - sleep 60
30+
# - cd ../../../
31+
32+
33+
# Generate site documentation using mvn site plugin
34+
# before_deploy:
35+
# - rm -rf docs
36+
# - mvn site -B
37+
38+
39+
# Using default stage 'test' for all our test jobs, and only running deploy stage
40+
# (after merge) to master branch
41+
stages:
42+
- test
43+
# - name: deploy
44+
# if: branch = master
45+
46+
47+
# List of jobs to run, tied to specific stages
48+
jobs:
49+
include:
50+
- stage: test
51+
name: AllTests
52+
before_script: skip
53+
script:
54+
- mvn test -B

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@
1818
<img src="./images/logo.png" alt="Eiffel Shared Java" width="350"/>
1919

2020
# Eiffel Commons
21-
** To be added **
21+
## Java Library
22+
* Jenkins Manager
23+
* RegExProvider
24+
* Subsceription object
2225

2326
# About this repository
2427
The contents of this repository are licensed under the [Apache License 2.0](./LICENSE).

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>com.github.ericsson</groupId>
66
<artifactId>eiffel-commons-java</artifactId>
7-
<version>0.0.10</version>
7+
<version>0.0.11</version>
88

99
<name>eiffel commons java</name>
1010
<description>A shared library for eiffel components</description>

src/main/java/com/ericsson/eiffelcommons/helpers/JenkinsXmlData.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
*/
3636
public class JenkinsXmlData {
3737

38-
private static final String JENKINS_TEMPLATE_FILE_NAME = "/jenkinsJobTemplate.xml";
38+
private static final String JENKINS_TEMPLATE_FILE_NAME = "jenkinsJobTemplate.xml";
3939
private static final String XML_VERSION = "<?xml version='1.1' encoding='UTF-8'?>";
4040
private static final String HUDSON_PARAMETERS_DEFINITION_KEY = "hudson.model.ParametersDefinitionProperty";
4141
private static final String PARAMETER_DEFINITION_KEY = "parameterDefinitions";

src/main/java/com/ericsson/eiffelcommons/utils/RegExProvider.java renamed to src/main/java/com/ericsson/eiffelcommons/helpers/RegExProvider.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
package com.ericsson.eiffelcommons.utils;
1+
package com.ericsson.eiffelcommons.helpers;
22

33
public final class RegExProvider {
44

5-
public static final String SUBSCRIPTION_NAME = "(\\W)";
6-
public static final String NOTIFICATION_META = "^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$";;
5+
public static final String SUBSCRIPTION_NAME = "(\\W)";
6+
public static final String NOTIFICATION_META = "^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$";
77

88
private RegExProvider() {
99
throw new AssertionError();

src/main/java/com/ericsson/eiffelcommons/subscriptionobject/SubscriptionObject.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import lombok.Getter;
1111

1212
public abstract class SubscriptionObject {
13-
private static final String SUBSCRIPTION_TEMPLATE_PATH = "/subscriptionsTemplate.json";
13+
private static final String SUBSCRIPTION_TEMPLATE_PATH = "subscriptionsTemplate.json";
1414

1515
@Getter
1616
protected JSONObject subscriptionJson;

src/main/java/com/ericsson/eiffelcommons/utils/Utils.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ public class Utils {
3636
* @throws FileNotFoundException
3737
*/
3838
public static String getResourceFileAsString(String fileName) throws FileNotFoundException {
39-
InputStream inputStream = Utils.class.getResourceAsStream(fileName);
39+
ClassLoader classLoader = ClassLoader.getSystemClassLoader();
40+
InputStream inputStream = classLoader.getResourceAsStream(fileName);
4041
if (inputStream != null) {
4142
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
4243
return reader.lines()

src/test/java/com/ericsson/eiffelcommons/Utilstest/RegExProviderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import org.junit.Test;
66

7-
import com.ericsson.eiffelcommons.utils.RegExProvider;
7+
import com.ericsson.eiffelcommons.helpers.RegExProvider;
88

99
public class RegExProviderTest {
1010

0 commit comments

Comments
 (0)