Skip to content

Commit 1b8985a

Browse files
authored
Merge pull request eugenp#20 from eugenp/master
update
2 parents a8f4dcb + 7451392 commit 1b8985a

File tree

53 files changed

+1185
-481
lines changed

Some content is hidden

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

53 files changed

+1185
-481
lines changed

akka-http/src/test/java/com/baeldung/akkahttp/UserServerUnitTest.java

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import akka.http.javadsl.model.HttpRequest;
88
import akka.http.javadsl.testkit.JUnitRouteTest;
99
import akka.http.javadsl.testkit.TestRoute;
10+
11+
import org.junit.Ignore;
1012
import org.junit.Test;
1113

1214
public class UserServerUnitTest extends JUnitRouteTest {
@@ -17,6 +19,7 @@ public class UserServerUnitTest extends JUnitRouteTest {
1719

1820
TestRoute appRoute = testRoute(new UserServer(userActorRef).routes());
1921

22+
@Ignore
2023
@Test
2124
public void whenRequest_thenActorResponds() {
2225

cloud-foundry-uaa/pom.xml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<artifactId>cloud-foundry-uaa</artifactId>
6+
<version>0.0.1-SNAPSHOT</version>
7+
<name>cloud-foundry-uaa</name>
8+
<packaging>pom</packaging>
9+
10+
<parent>
11+
<groupId>com.baeldung</groupId>
12+
<artifactId>parent-modules</artifactId>
13+
<version>1.0.0-SNAPSHOT</version>
14+
</parent>
15+
16+
<modules>
17+
<module>cf-uaa-oauth2-client</module>
18+
<module>cf-uaa-oauth2-resource-server</module>
19+
</modules>
20+
21+
</project>

core-groovy-2/src/test/groovy/com/baeldung/category/CategoryUnitTest.groovy

+11-10
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,17 @@ class CategoryUnitTest extends GroovyTestCase {
2828
}
2929
}
3030

31-
void test_whenUsingTimeCategory_thenOperationOnNumber() {
32-
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy")
33-
use (TimeCategory) {
34-
assert sdf.format(5.days.from.now) == sdf.format(new Date() + 5.days)
35-
36-
sdf = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss")
37-
assert sdf.format(10.minutes.from.now) == sdf.format(new Date() + 10.minutes)
38-
assert sdf.format(2.hours.ago) == sdf.format(new Date() - 2.hours)
39-
}
40-
}
31+
// http://team.baeldung.com/browse/BAEL-20687
32+
// void test_whenUsingTimeCategory_thenOperationOnNumber() {
33+
// SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy")
34+
// use (TimeCategory) {
35+
// assert sdf.format(5.days.from.now) == sdf.format(new Date() + 5.days)
36+
//
37+
// sdf = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss")
38+
// assert sdf.format(10.minutes.from.now) == sdf.format(new Date() + 10.minutes)
39+
// assert sdf.format(2.hours.ago) == sdf.format(new Date() - 2.hours)
40+
// }
41+
// }
4142

4243
void test_whenUsingDOMCategory_thenOperationOnXML() {
4344

core-groovy-2/src/test/groovy/com/baeldung/webservice/WebserviceUnitTest.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import wslite.soap.SOAPMessageBuilder
99
import wslite.http.auth.HTTPBasicAuthorization
1010
import org.junit.Test
1111

12-
class WebserviceUnitTest extends GroovyTestCase {
12+
class WebserviceManualTest extends GroovyTestCase {
1313

1414
JsonSlurper jsonSlurper = new JsonSlurper()
1515

core-groovy/src/test/groovy/com/baeldung/file/ReadFileUnitTest.groovy

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.baeldung.file
22

33
import spock.lang.Specification
4+
import spock.lang.Ignore
45

56
class ReadFileUnitTest extends Specification {
67

@@ -32,6 +33,7 @@ class ReadFileUnitTest extends Specification {
3233
assert lines.size(), 3
3334
}
3435

36+
@Ignore
3537
def 'Should return file content in string using ReadFile.readFileString given filePath' () {
3638
given:
3739
def filePath = "src/main/resources/fileContent.txt"

core-java-modules/core-java-concurrency-advanced-3/src/test/java/com/baeldung/rejection/SaturationPolicyUnitTest.java

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.baeldung.rejection;
22

33
import org.junit.After;
4+
import org.junit.Ignore;
45
import org.junit.Test;
56

67
import java.util.ArrayList;
@@ -28,6 +29,7 @@ public void shutdownExecutor() {
2829
}
2930
}
3031

32+
@Ignore
3133
@Test
3234
public void givenAbortPolicy_WhenSaturated_ThenShouldThrowRejectedExecutionException() {
3335
executor = new ThreadPoolExecutor(1, 1, 0, MILLISECONDS, new SynchronousQueue<>(), new AbortPolicy());
@@ -36,6 +38,7 @@ public void givenAbortPolicy_WhenSaturated_ThenShouldThrowRejectedExecutionExcep
3638
assertThatThrownBy(() -> executor.execute(() -> System.out.println("Will be rejected"))).isInstanceOf(RejectedExecutionException.class);
3739
}
3840

41+
@Ignore
3942
@Test
4043
public void givenCallerRunsPolicy_WhenSaturated_ThenTheCallerThreadRunsTheTask() {
4144
executor = new ThreadPoolExecutor(1, 1, 0, MILLISECONDS, new SynchronousQueue<>(), new CallerRunsPolicy());
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<artifactId>core-java-datetime-java8</artifactId>
6+
<version>${project.parent.version}</version>
7+
<name>core-java-datetime-java8</name>
8+
<packaging>jar</packaging>
9+
10+
<parent>
11+
<groupId>com.baeldung</groupId>
12+
<artifactId>parent-java</artifactId>
13+
<version>0.0.1-SNAPSHOT</version>
14+
<relativePath>../../parent-java</relativePath>
15+
</parent>
16+
17+
<dependencies>
18+
<dependency>
19+
<groupId>org.apache.commons</groupId>
20+
<artifactId>commons-lang3</artifactId>
21+
<version>${commons-lang3.version}</version>
22+
</dependency>
23+
<dependency>
24+
<groupId>joda-time</groupId>
25+
<artifactId>joda-time</artifactId>
26+
<version>${joda-time.version}</version>
27+
</dependency>
28+
<dependency>
29+
<groupId>org.assertj</groupId>
30+
<artifactId>assertj-core</artifactId>
31+
<version>${assertj.version}</version>
32+
<scope>test</scope>
33+
</dependency>
34+
<dependency>
35+
<groupId>log4j</groupId>
36+
<artifactId>log4j</artifactId>
37+
<version>${log4j.version}</version>
38+
<scope>test</scope>
39+
</dependency>
40+
</dependencies>
41+
42+
<build>
43+
<finalName>core-java-datetime-java8</finalName>
44+
<resources>
45+
<resource>
46+
<directory>src/main/resources</directory>
47+
<filtering>true</filtering>
48+
</resource>
49+
</resources>
50+
51+
<plugins>
52+
<plugin>
53+
<groupId>org.apache.maven.plugins</groupId>
54+
<artifactId>maven-compiler-plugin</artifactId>
55+
<version>${maven-compiler-plugin.version}</version>
56+
<configuration>
57+
<source>${maven.compiler.source}</source>
58+
<target>${maven.compiler.target}</target>
59+
</configuration>
60+
</plugin>
61+
</plugins>
62+
</build>
63+
64+
<properties>
65+
<maven.compiler.source>1.9</maven.compiler.source>
66+
<maven.compiler.target>1.9</maven.compiler.target>
67+
<joda-time.version>2.10</joda-time.version>
68+
<!-- testing -->
69+
<assertj.version>3.6.1</assertj.version>
70+
</properties>
71+
72+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package com.baeldung.localdate;
2+
3+
import java.time.LocalDate;
4+
import java.time.Month;
5+
import java.time.format.DateTimeFormatter;
6+
7+
public class LocalDateExample {
8+
public LocalDate getCustomDateOne(int year, int month, int dayOfMonth) {
9+
return LocalDate.of(year, month, dayOfMonth);
10+
}
11+
12+
public LocalDate getCustomDateTwo(int year, Month month, int dayOfMonth) {
13+
return LocalDate.of(year, month, dayOfMonth);
14+
}
15+
16+
public LocalDate getDateFromEpochDay(long epochDay) {
17+
return LocalDate.ofEpochDay(epochDay);
18+
}
19+
20+
public LocalDate getDateFromYearAndDayOfYear(int year, int dayOfYear) {
21+
return LocalDate.ofYearDay(year, dayOfYear);
22+
}
23+
24+
public LocalDate getDateFromString(String date) {
25+
return LocalDate.parse(date);
26+
}
27+
28+
public LocalDate getDateFromStringAndFormatter(String date, String pattern) {
29+
return LocalDate.parse(date, DateTimeFormatter.ofPattern(pattern));
30+
}
31+
}

core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/datebasics/CreateDateUnitTest.java renamed to core-java-modules/core-java-datetime-java8-2/src/test/java/com/baeldung/localdate/LocalDateExampleUnitTest.java

+9-24
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,39 @@
1-
package com.baeldung.datebasics;
1+
package com.baeldung.localdate;
22

33
import static org.junit.Assert.assertEquals;
44

55
import java.time.Month;
66

77
import org.junit.Test;
88

9-
public class CreateDateUnitTest {
10-
private CreateDate date = new CreateDate();
11-
12-
@Test
13-
public void whenUsingNowMethod_thenLocalDate() {
14-
assertEquals("2020-01-08", date.getTodaysDate());
15-
}
16-
17-
@Test
18-
public void whenUsingClock_thenLocalDate() {
19-
assertEquals("2020-01-08", date.getTodaysDateFromClock());
20-
}
21-
22-
@Test
23-
public void givenValues_whenUsingZone_thenLocalDate() {
24-
assertEquals("2020-01-08", date.getTodaysDateFromZone("Asia/Kolkata"));
25-
}
26-
9+
public class LocalDateExampleUnitTest {
10+
private LocalDateExample date = new LocalDateExample();
11+
2712
@Test
2813
public void givenValues_whenUsingOfMethod_thenLocalDate() {
2914
assertEquals("2020-01-08", date.getCustomDateOne(2020, 1, 8));
3015
}
31-
16+
3217
@Test
3318
public void givenValuesWithMonthEnum_whenUsingOfMethod_thenLocalDate() {
3419
assertEquals("2020-01-08", date.getCustomDateTwo(2020, Month.JANUARY, 8));
3520
}
36-
21+
3722
@Test
3823
public void givenValues_whenUsingEpochDay_thenLocalDate() {
3924
assertEquals("2020-01-08", date.getDateFromEpochDay(18269));
4025
}
41-
26+
4227
@Test
4328
public void givenValues_whenUsingYearDay_thenLocalDate() {
4429
assertEquals("2020-01-08", date.getDateFromYearAndDayOfYear(2020, 8));
4530
}
46-
31+
4732
@Test
4833
public void givenValues_whenUsingParse_thenLocalDate() {
4934
assertEquals("2020-01-08", date.getDateFromString("2020-01-08"));
5035
}
51-
36+
5237
@Test
5338
public void givenValuesWithFormatter_whenUsingParse_thenLocalDate() {
5439
assertEquals("2020-01-08", date.getDateFromStringAndFormatter("8-Jan-2020", "d-MMM-yyyy"));

core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/datebasics/CreateDate.java

-45
This file was deleted.

core-java-modules/core-java-io-apis/src/test/java/com/baeldung/file/FileClassUnitTest.java

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.baeldung.file;
22

3+
import org.junit.Ignore;
34
import org.junit.Test;
45

56
import java.io.*;
@@ -73,6 +74,7 @@ public void givenReadOnlyFile_whenCreateNewFile_thenCantModFile() {
7374
assertFalse(writable);
7475
}
7576

77+
@Ignore
7678
@Test
7779
public void givenWriteOnlyFile_whenCreateNewFile_thenCantReadFile() {
7880
File parentDir = makeDir("writeDir");

core-java-modules/core-java-jndi/pom.xml

+8-3
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@
99
<name>core-java-jndi</name>
1010

1111
<parent>
12-
<groupId>com.baeldung</groupId>
13-
<artifactId>parent-modules</artifactId>
12+
<groupId>com.baeldung.core-java-modules</groupId>
13+
<artifactId>core-java-modules</artifactId>
1414
<version>1.0.0-SNAPSHOT</version>
15-
<relativePath>../../</relativePath>
1615
</parent>
1716

1817
<dependencies>
@@ -22,6 +21,12 @@
2221
<version>${jupiter.version}</version>
2322
<scope>test</scope>
2423
</dependency>
24+
<dependency>
25+
<groupId>org.junit.jupiter</groupId>
26+
<artifactId>junit-jupiter-api</artifactId>
27+
<version>5.5.1</version>
28+
<scope>test</scope>
29+
</dependency>
2530
<dependency>
2631
<groupId>org.springframework</groupId>
2732
<artifactId>spring-core</artifactId>

0 commit comments

Comments
 (0)