Skip to content

Commit e0abfb8

Browse files
committed
gerge branch 'master' of https://github.com/eugenp/tutorials
2 parents f966f27 + d1ea5e8 commit e0abfb8

152 files changed

Lines changed: 3280 additions & 644 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.

‎apache-fop/pom.xml‎

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,14 @@
9797
<version>8.0.2</version>
9898
</dependency>
9999

100+
<dependency>
101+
<groupId>org.dbdoclet</groupId>
102+
<artifactId>herold</artifactId>
103+
<version>6.1.0</version>
104+
<scope>system</scope>
105+
<systemPath>${basedir}/src/test/resources/jars/herold.jar</systemPath>
106+
</dependency>
107+
100108
<dependency>
101109
<groupId>net.sf.jtidy</groupId>
102110
<artifactId>jtidy</artifactId>
@@ -132,7 +140,8 @@
132140
<version>${maven-surefire-plugin.version}</version>
133141
<configuration>
134142
<excludes>
135-
<exclude>**/*IntegrationTest.java</exclude>
143+
<exclude>**/*IntegrationTest.java</exclude>
144+
<exclude>**/*LiveTest.java</exclude>
136145
</excludes>
137146
</configuration>
138147
</plugin>
@@ -141,6 +150,42 @@
141150

142151
</build>
143152

153+
<profiles>
154+
<profile>
155+
<id>integration</id>
156+
<build>
157+
<plugins>
158+
<plugin>
159+
<groupId>org.apache.maven.plugins</groupId>
160+
<artifactId>maven-surefire-plugin</artifactId>
161+
<executions>
162+
<execution>
163+
<phase>integration-test</phase>
164+
<goals>
165+
<goal>test</goal>
166+
</goals>
167+
<configuration>
168+
<excludes>
169+
<exclude>**/*ManualTest.java</exclude>
170+
</excludes>
171+
<includes>
172+
<include>**/*IntegrationTest.java</include>
173+
<exclude>**/*LiveTest.java</exclude>
174+
</includes>
175+
</configuration>
176+
</execution>
177+
</executions>
178+
<configuration>
179+
<systemPropertyVariables>
180+
<test.mime>json</test.mime>
181+
</systemPropertyVariables>
182+
</configuration>
183+
</plugin>
184+
</plugins>
185+
</build>
186+
</profile>
187+
</profiles>
188+
144189
<properties>
145190
<!-- persistence -->
146191
<hibernate.version>4.3.11.Final</hibernate.version>

apache-fop/src/test/java/org/baeldung/java/ApacheFOPConvertHTMLTest.java renamed to apache-fop/src/test/java/org/baeldung/java/ApacheFOPConvertHTMLIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import org.w3c.dom.Document;
2626
import org.w3c.tidy.Tidy;
2727

28-
public class ApacheFOPConvertHTMLTest {
28+
public class ApacheFOPConvertHTMLIntegrationTest {
2929
private String inputFile = "src/test/resources/input.html";
3030
private String style = "src/test/resources/xhtml2fo.xsl";
3131
private String style1 = "src/test/resources/docbook-xsl/fo/docbook.xsl";

apache-fop/src/test/java/org/baeldung/java/ApacheFOPHeroldTest.java renamed to apache-fop/src/test/java/org/baeldung/java/ApacheFOPHeroldLiveTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import org.junit.Test;
3131
import org.w3c.dom.Document;
3232

33-
public class ApacheFOPHeroldTest {
33+
public class ApacheFOPHeroldLiveTest {
3434
private String[] inputUrls = {// @formatter:off
3535
"http://www.baeldung.com/2011/10/20/bootstraping-a-web-application-with-spring-3-1-and-java-based-configuration-part-1/",
3636
"http://www.baeldung.com/2011/10/25/building-a-restful-web-service-with-spring-3-1-and-java-based-configuration-part-2/",
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
package com.baeldung.java9.language.stream;
2+
3+
import org.junit.Test;
4+
5+
import java.util.Arrays;
6+
import java.util.HashMap;
7+
import java.util.List;
8+
import java.util.Map;
9+
import java.util.stream.Collectors;
10+
import java.util.stream.Stream;
11+
12+
import static java.lang.Integer.*;
13+
import static org.junit.Assert.assertEquals;
14+
15+
public class StreamFeaturesTest {
16+
17+
public static class TakeAndDropWhileTest {
18+
19+
public Stream<String> getStreamAfterTakeWhileOperation() {
20+
return Stream
21+
.iterate("", s -> s + "s")
22+
.takeWhile(s -> s.length() < 10);
23+
}
24+
25+
public Stream<String> getStreamAfterDropWhileOperation() {
26+
return Stream
27+
.iterate("", s -> s + "s")
28+
.takeWhile(s -> s.length() < 10)
29+
.dropWhile(s -> !s.contains("sssss"));
30+
}
31+
32+
@Test
33+
public void testTakeWhileOperation() {
34+
List<String> list = getStreamAfterTakeWhileOperation().collect(Collectors.toList());
35+
36+
assertEquals(10, list.size());
37+
38+
assertEquals("", list.get(0));
39+
assertEquals("ss", list.get(2));
40+
assertEquals("sssssssss", list.get(list.size() - 1));
41+
}
42+
43+
@Test
44+
public void testDropWhileOperation() {
45+
List<String> list = getStreamAfterDropWhileOperation().collect(Collectors.toList());
46+
47+
assertEquals(5, list.size());
48+
49+
assertEquals("sssss", list.get(0));
50+
assertEquals("sssssss", list.get(2));
51+
assertEquals("sssssssss", list.get(list.size() - 1));
52+
}
53+
54+
}
55+
56+
public static class IterateTest {
57+
58+
private Stream<Integer> getStream() {
59+
return Stream.iterate(0, i -> i < 10, i -> i + 1);
60+
}
61+
62+
@Test
63+
public void testIterateOperation() {
64+
List<Integer> list = getStream().collect(Collectors.toList());
65+
66+
assertEquals(10, list.size());
67+
68+
assertEquals(valueOf(0), list.get(0));
69+
assertEquals(valueOf(5), list.get(5));
70+
assertEquals(valueOf(9), list.get(list.size() - 1));
71+
}
72+
73+
}
74+
75+
public static class OfNullableTest {
76+
77+
private List<String> collection = Arrays.asList("A", "B", "C");
78+
private Map<String, Integer> map = new HashMap<>() {{
79+
put("A", 10);
80+
put("C", 30);
81+
}};
82+
83+
private Stream<Integer> getStreamWithOfNullable() {
84+
return collection.stream()
85+
.flatMap(s -> Stream.ofNullable(map.get(s)));
86+
}
87+
88+
private Stream<Integer> getStream() {
89+
return collection.stream()
90+
.flatMap(s -> {
91+
Integer temp = map.get(s);
92+
return temp != null ? Stream.of(temp) : Stream.empty();
93+
});
94+
}
95+
96+
private List<Integer> testOfNullableFrom(Stream<Integer> stream) {
97+
List<Integer> list = stream.collect(Collectors.toList());
98+
99+
assertEquals(2, list.size());
100+
101+
assertEquals(valueOf(10), list.get(0));
102+
assertEquals(valueOf(30), list.get(list.size() - 1));
103+
104+
return list;
105+
}
106+
107+
@Test
108+
public void testOfNullable() {
109+
110+
assertEquals(
111+
testOfNullableFrom(getStream()),
112+
testOfNullableFrom(getStreamWithOfNullable())
113+
);
114+
115+
}
116+
117+
}
118+
119+
}

‎core-java/0.12457740242410742‎

Whitespace-only changes.

core-java/src/main/java/org/baeldung/equalshashcode/entities/ComplexClass.java renamed to core-java/src/main/java/com/baeldung/equalshashcode/entities/ComplexClass.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.baeldung.equalshashcode.entities;
1+
package com.baeldung.equalshashcode.entities;
22

33
import java.util.List;
44
import java.util.Set;

core-java/src/main/java/org/baeldung/equalshashcode/entities/PrimitiveClass.java renamed to core-java/src/main/java/com/baeldung/equalshashcode/entities/PrimitiveClass.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.baeldung.equalshashcode.entities;
1+
package com.baeldung.equalshashcode.entities;
22

33
public class PrimitiveClass {
44

core-java/src/main/java/org/baeldung/equalshashcode/entities/Rectangle.java renamed to core-java/src/main/java/com/baeldung/equalshashcode/entities/Rectangle.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.baeldung.equalshashcode.entities;
1+
package com.baeldung.equalshashcode.entities;
22

33
public class Rectangle extends Shape {
44
private double width;

core-java/src/main/java/org/baeldung/equalshashcode/entities/Shape.java renamed to core-java/src/main/java/com/baeldung/equalshashcode/entities/Shape.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.baeldung.equalshashcode.entities;
1+
package com.baeldung.equalshashcode.entities;
22

33
public abstract class Shape {
44
public abstract double area();

core-java/src/main/java/org/baeldung/equalshashcode/entities/Square.java renamed to core-java/src/main/java/com/baeldung/equalshashcode/entities/Square.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.baeldung.equalshashcode.entities;
1+
package com.baeldung.equalshashcode.entities;
22

33
import java.awt.Color;
44

0 commit comments

Comments
 (0)