Skip to content

Commit 9d75592

Browse files
authored
Merge branch 'master' into all-contributors/add-ravening
2 parents 8d6738b + 16e1863 commit 9d75592

533 files changed

Lines changed: 7797 additions & 2794 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.all-contributorsrc‎

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,6 +1085,116 @@
10851085
"code",
10861086
"review"
10871087
]
1088+
},
1089+
{
1090+
"login": "vINCENT8888801",
1091+
"name": "Wei Seng",
1092+
"avatar_url": "https://avatars0.githubusercontent.com/u/8037883?v=4",
1093+
"profile": "https://github.com/vINCENT8888801",
1094+
"contributions": [
1095+
"code"
1096+
]
1097+
},
1098+
{
1099+
"login": "ashishtrivedi16",
1100+
"name": "Ashish Trivedi",
1101+
"avatar_url": "https://avatars3.githubusercontent.com/u/23194128?v=4",
1102+
"profile": "https://www.linkedin.com/in/ashish-trivedi-218379135/",
1103+
"contributions": [
1104+
"code"
1105+
]
1106+
},
1107+
{
1108+
"login": "RayYH",
1109+
"name": "洪月阳",
1110+
"avatar_url": "https://avatars1.githubusercontent.com/u/41055099?v=4",
1111+
"profile": "https://rayyounghong.com",
1112+
"contributions": [
1113+
"code"
1114+
]
1115+
},
1116+
{
1117+
"login": "xdvrx1",
1118+
"name": "xdvrx1",
1119+
"avatar_url": "https://avatars0.githubusercontent.com/u/47092464?v=4",
1120+
"profile": "https://xdvrx1.github.io/",
1121+
"contributions": [
1122+
"review",
1123+
"ideas"
1124+
]
1125+
},
1126+
{
1127+
"login": "ohbus",
1128+
"name": "Subhrodip Mohanta",
1129+
"avatar_url": "https://avatars0.githubusercontent.com/u/13291222?v=4",
1130+
"profile": "http://subho.xyz",
1131+
"contributions": [
1132+
"code",
1133+
"review"
1134+
]
1135+
},
1136+
{
1137+
"login": "nahteb",
1138+
"name": "Bethan Palmer",
1139+
"avatar_url": "https://avatars3.githubusercontent.com/u/13121570?v=4",
1140+
"profile": "https://github.com/nahteb",
1141+
"contributions": [
1142+
"code"
1143+
]
1144+
},
1145+
{
1146+
"login": "ToxicDreamz",
1147+
"name": "Toxic Dreamz",
1148+
"avatar_url": "https://avatars0.githubusercontent.com/u/45225562?v=4",
1149+
"profile": "https://github.com/ToxicDreamz",
1150+
"contributions": [
1151+
"code"
1152+
]
1153+
},
1154+
{
1155+
"login": "edycutjong",
1156+
"name": "Edy Cu Tjong",
1157+
"avatar_url": "https://avatars1.githubusercontent.com/u/1098102?v=4",
1158+
"profile": "http://www.edycutjong.com",
1159+
"contributions": [
1160+
"doc"
1161+
]
1162+
},
1163+
{
1164+
"login": "mkrzywanski",
1165+
"name": "Michał Krzywański",
1166+
"avatar_url": "https://avatars0.githubusercontent.com/u/15279585?v=4",
1167+
"profile": "https://github.com/mkrzywanski",
1168+
"contributions": [
1169+
"code"
1170+
]
1171+
},
1172+
{
1173+
"login": "stefanbirkner",
1174+
"name": "Stefan Birkner",
1175+
"avatar_url": "https://avatars1.githubusercontent.com/u/711349?v=4",
1176+
"profile": "https://www.stefan-birkner.de",
1177+
"contributions": [
1178+
"code"
1179+
]
1180+
},
1181+
{
1182+
"login": "fedorskvorcov",
1183+
"name": "Fedor Skvorcov",
1184+
"avatar_url": "https://avatars3.githubusercontent.com/u/43882212?v=4",
1185+
"profile": "https://github.com/fedorskvorcov",
1186+
"contributions": [
1187+
"code"
1188+
]
1189+
},
1190+
{
1191+
"login": "samilAyoub",
1192+
"name": "samilAyoub",
1193+
"avatar_url": "https://avatars0.githubusercontent.com/u/61546990?v=4",
1194+
"profile": "https://github.com/samilAyoub",
1195+
"contributions": [
1196+
"code"
1197+
]
10881198
}
10891199
],
10901200
"contributorsPerLine": 4,
Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,37 +24,41 @@
2424
# This workflow will build a Java project with Maven
2525
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
2626

27-
name: Java CI with Maven
27+
name: Java CI
2828

2929
on:
3030
push:
3131
branches: [ master ]
32-
pull_request:
33-
branches: [ master ]
3432

3533
jobs:
3634
build:
3735

38-
runs-on: ubuntu-18.04
36+
runs-on: ubuntu-20.04
3937

4038
steps:
4139
- uses: actions/checkout@v2
40+
with:
41+
# Disabling shallow clone for improving relevancy of SonarQube reporting
42+
fetch-depth: 0
4243
- name: Set up JDK 11
4344
uses: actions/setup-java@v1
4445
with:
4546
java-version: 11
47+
- uses: actions/cache@v2
48+
with:
49+
path: ~/.m2/repository
50+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
51+
restore-keys: |
52+
${{ runner.os }}-maven-
4653
# Some tests need screen access
4754
- name: Install xvfb
48-
run: sudo apt-get install xvfb
49-
# SonarQube scan does not work for forked repositories
55+
run: sudo apt-get install -y xvfb
56+
# The SonarQube analysis is only for the master branch of the main repository.
57+
# SonarQube scan does not work for forked repositories try changing it to xvfb-run mvn clean verify
5058
# See https://jira.sonarsource.com/browse/MMF-1371
51-
- name: Build with Maven
52-
if: github.ref != 'refs/heads/master'
53-
run: xvfb-run mvn clean verify
5459
- name: Build with Maven and run SonarQube analysis
55-
if: github.ref == 'refs/heads/master'
5660
run: xvfb-run mvn clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
5761
env:
5862
# These two env variables are needed for sonar analysis
59-
GITHUB_TOKEN: ${{ secrets.REPOSITORY_ACCESS_TOKEN }}
63+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6064
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#
2+
# The MIT License
3+
# Copyright © 2014-2019 Ilkka Seppälä
4+
#
5+
# Permission is hereby granted, free of charge, to any person obtaining a copy
6+
# of this software and associated documentation files (the "Software"), to deal
7+
# in the Software without restriction, including without limitation the rights
8+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
# copies of the Software, and to permit persons to whom the Software is
10+
# furnished to do so, subject to the following conditions:
11+
#
12+
# The above copyright notice and this permission notice shall be included in
13+
# all copies or substantial portions of the Software.
14+
#
15+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
# THE SOFTWARE.
22+
#
23+
24+
# This workflow will build a Java project with Maven
25+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
26+
27+
name: Java PR Builder
28+
29+
on:
30+
pull_request:
31+
branches: [ master ]
32+
33+
jobs:
34+
build:
35+
36+
runs-on: ubuntu-20.04
37+
38+
steps:
39+
- uses: actions/checkout@v2
40+
- name: Set up JDK 11
41+
uses: actions/setup-java@v1
42+
with:
43+
java-version: 11
44+
- uses: actions/cache@v2
45+
with:
46+
path: ~/.m2/repository
47+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
48+
restore-keys: |
49+
${{ runner.os }}-maven-
50+
# Some tests need screen access
51+
- name: Install xvfb
52+
run: sudo apt-get install -y xvfb
53+
# This worflow is only for building Pull Requests, the master branch runs Sonar analysis on the main repository.
54+
# SonarQube scan does not work for forked repositories.
55+
# See https://jira.sonarsource.com/browse/MMF-1371
56+
- name: Build with Maven
57+
run: xvfb-run mvn clean verify

‎README.md‎

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66

77
![Java CI with Maven](https://github.com/iluwatar/java-design-patterns/workflows/Java%20CI%20with%20Maven/badge.svg)
88
[![License MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/iluwatar/java-design-patterns/master/LICENSE.md)
9+
[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=iluwatar_java-design-patterns&metric=ncloc)](https://sonarcloud.io/dashboard?id=iluwatar_java-design-patterns)
10+
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=iluwatar_java-design-patterns&metric=coverage)](https://sonarcloud.io/dashboard?id=iluwatar_java-design-patterns)
911
[![Join the chat at https://gitter.im/iluwatar/java-design-patterns](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/iluwatar/java-design-patterns?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
10-
[![Sonarcloud Status](https://sonarcloud.io/api/project_badges/measure?project=iluwatar_java-design-patterns&metric=alert_status)](https://sonarcloud.io/dashboard?id=iluwatar_java-design-patterns)
1112
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
12-
[![All Contributors](https://img.shields.io/badge/all_contributors-119-orange.svg?style=flat-square)](#contributors-)
13+
[![All Contributors](https://img.shields.io/badge/all_contributors-131-orange.svg?style=flat-square)](#contributors-)
1314
<!-- ALL-CONTRIBUTORS-BADGE:END -->
1415

1516
# Introduction
@@ -245,7 +246,26 @@ This project is licensed under the terms of the MIT license.
245246
<tr>
246247
<td align="center"><a href="https://github.com/nishant"><img src="https://avatars2.githubusercontent.com/u/15331971?v=4" width="100px;" alt=""/><br /><sub><b>Nishant Arora</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=nishant" title="Code">💻</a></td>
247248
<td align="center"><a href="https://github.com/raja-peeyush-kumar-singh"><img src="https://avatars0.githubusercontent.com/u/5496024?v=4" width="100px;" alt=""/><br /><sub><b>Peeyush</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=raja-peeyush-kumar-singh" title="Code">💻</a></td>
249+
<td align="center"><a href="https://github.com/ravening"><img src="https://avatars1.githubusercontent.com/u/10645273?v=4" width="100px;" alt=""/><br /><sub><b>Rakesh</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=ravening" title="Code">💻</a></td>
250+
<td align="center"><a href="https://github.com/vINCENT8888801"><img src="https://avatars0.githubusercontent.com/u/8037883?v=4" width="100px;" alt=""/><br /><sub><b>Wei Seng</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=vINCENT8888801" title="Code">💻</a></td>
251+
</tr>
252+
<tr>
253+
<td align="center"><a href="https://www.linkedin.com/in/ashish-trivedi-218379135/"><img src="https://avatars3.githubusercontent.com/u/23194128?v=4" width="100px;" alt=""/><br /><sub><b>Ashish Trivedi</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=ashishtrivedi16" title="Code">💻</a></td>
254+
<td align="center"><a href="https://rayyounghong.com"><img src="https://avatars1.githubusercontent.com/u/41055099?v=4" width="100px;" alt=""/><br /><sub><b>洪月阳</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=RayYH" title="Code">💻</a></td>
255+
<td align="center"><a href="https://xdvrx1.github.io/"><img src="https://avatars0.githubusercontent.com/u/47092464?v=4" width="100px;" alt=""/><br /><sub><b>xdvrx1</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/pulls?q=is%3Apr+reviewed-by%3Axdvrx1" title="Reviewed Pull Requests">👀</a> <a href="#ideas-xdvrx1" title="Ideas, Planning, & Feedback">🤔</a></td>
256+
<td align="center"><a href="http://subho.xyz"><img src="https://avatars0.githubusercontent.com/u/13291222?v=4" width="100px;" alt=""/><br /><sub><b>Subhrodip Mohanta</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=ohbus" title="Code">💻</a> <a href="https://github.com/iluwatar/java-design-patterns/pulls?q=is%3Apr+reviewed-by%3Aohbus" title="Reviewed Pull Requests">👀</a></td>
257+
</tr>
258+
<tr>
259+
<td align="center"><a href="https://github.com/nahteb"><img src="https://avatars3.githubusercontent.com/u/13121570?v=4" width="100px;" alt=""/><br /><sub><b>Bethan Palmer</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=nahteb" title="Code">💻</a></td>
260+
<td align="center"><a href="https://github.com/ToxicDreamz"><img src="https://avatars0.githubusercontent.com/u/45225562?v=4" width="100px;" alt=""/><br /><sub><b>Toxic Dreamz</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=ToxicDreamz" title="Code">💻</a></td>
261+
<td align="center"><a href="http://www.edycutjong.com"><img src="https://avatars1.githubusercontent.com/u/1098102?v=4" width="100px;" alt=""/><br /><sub><b>Edy Cu Tjong</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=edycutjong" title="Documentation">📖</a></td>
262+
<td align="center"><a href="https://github.com/mkrzywanski"><img src="https://avatars0.githubusercontent.com/u/15279585?v=4" width="100px;" alt=""/><br /><sub><b>Michał Krzywański</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=mkrzywanski" title="Code">💻</a></td>
263+
</tr>
264+
<tr>
248265
<td align="center"><a href="https://github.com/ravening"><img src="https://avatars1.githubusercontent.com/u/10645273?v=4" width="100px;" alt=""/><br /><sub><b>Rakesh</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=ravening" title="Code">💻</a> <a href="https://github.com/iluwatar/java-design-patterns/pulls?q=is%3Apr+reviewed-by%3Aravening" title="Reviewed Pull Requests">👀</a></td>
266+
<td align="center"><a href="https://www.stefan-birkner.de"><img src="https://avatars1.githubusercontent.com/u/711349?v=4" width="100px;" alt=""/><br /><sub><b>Stefan Birkner</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=stefanbirkner" title="Code">💻</a></td>
267+
<td align="center"><a href="https://github.com/fedorskvorcov"><img src="https://avatars3.githubusercontent.com/u/43882212?v=4" width="100px;" alt=""/><br /><sub><b>Fedor Skvorcov</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=fedorskvorcov" title="Code">💻</a></td>
268+
<td align="center"><a href="https://github.com/samilAyoub"><img src="https://avatars0.githubusercontent.com/u/61546990?v=4" width="100px;" alt=""/><br /><sub><b>samilAyoub</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=samilAyoub" title="Code">💻</a></td>
249269
</tr>
250270
</table>
251271

‎abstract-document/pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<parent>
2222
<artifactId>java-design-patterns</artifactId>
2323
<groupId>com.iluwatar</groupId>
24-
<version>1.23.0-SNAPSHOT</version>
24+
<version>1.24.0-SNAPSHOT</version>
2525
</parent>
2626
<artifactId>abstract-document</artifactId>
2727
<dependencies>

‎abstract-document/src/test/java/com/iluwatar/abstractdocument/AppTest.java‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,23 @@
2525

2626
import org.junit.jupiter.api.Test;
2727

28+
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
29+
2830
/**
2931
* Simple App test
3032
*/
31-
public class AppTest {
33+
class AppTest {
34+
35+
/**
36+
* Issue: Add at least one assertion to this test case.
37+
*
38+
* Solution: Inserted assertion to check whether the execution of the main method in {@link App}
39+
* throws an exception.
40+
*/
3241

3342
@Test
34-
public void shouldExecuteAppWithoutException() {
35-
App.main(null);
43+
void shouldExecuteAppWithoutException() {
44+
assertDoesNotThrow(() -> App.main(null));
3645
}
3746

3847
}

‎abstract-factory/pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<parent>
2323
<groupId>com.iluwatar</groupId>
2424
<artifactId>java-design-patterns</artifactId>
25-
<version>1.23.0-SNAPSHOT</version>
25+
<version>1.24.0-SNAPSHOT</version>
2626
</parent>
2727
<artifactId>abstract-factory</artifactId>
2828
<dependencies>

‎abstract-factory/src/test/java/com/iluwatar/abstractfactory/AppTest.java‎

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,23 @@
2525

2626
import org.junit.jupiter.api.Test;
2727

28+
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
29+
2830
/**
2931
* Tests that Abstract Factory example runs without errors.
3032
*/
31-
public class AppTest {
33+
class AppTest {
34+
35+
/**
36+
* Issue: Add at least one assertion to this test case.
37+
*
38+
* Solution: Inserted assertion to check whether the execution of the main method in {@link App}
39+
* throws an exception.
40+
*/
41+
3242
@Test
33-
public void test() {
34-
App.main(new String[]{});
43+
void shouldExecuteApplicationWithoutException() {
44+
45+
assertDoesNotThrow(() -> App.main(new String[]{}));
3546
}
3647
}

‎acyclic-visitor/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public class ConfigureForUnixVisitor implements ZoomVisitor {
101101
}
102102
```
103103

104-
Finally here are the visitors in action.
104+
Finally, here are the visitors in action.
105105

106106
```java
107107
var conUnix = new ConfigureForUnixVisitor();

‎acyclic-visitor/pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<parent>
2222
<groupId>com.iluwatar</groupId>
2323
<artifactId>java-design-patterns</artifactId>
24-
<version>1.23.0-SNAPSHOT</version>
24+
<version>1.24.0-SNAPSHOT</version>
2525
</parent>
2626

2727
<artifactId>acyclic-visitor</artifactId>

0 commit comments

Comments
 (0)