Skip to content

Commit 0849b06

Browse files
committed
Merge branch 'master' into custom-filter-update
2 parents 45b7401 + ff9d4d4 commit 0849b06

326 files changed

Lines changed: 4981 additions & 730 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.

‎README.md‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,3 @@ This tutorials project is being built **[>> HERE](https://rest-security.ci.cloud
4040
- [Apache Maven Standard Directory Layout](http://www.baeldung.com/maven-directory-structure)
4141
- [Apache Maven Tutorial](http://www.baeldung.com/maven)
4242
- [Designing a User Friendly Java Library](http://www.baeldung.com/design-a-user-friendly-java-library)
43-
- [Java Service Provider Interface](http://www.baeldung.com/java-spi)
44-
- [Java Streams vs Vavr Streams](http://www.baeldung.com/vavr-java-streams)

‎algorithms/src/main/java/com/baeldung/algorithms/mcts/tictactoe/Board.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public void printStatus() {
148148
System.out.println("Game Draw");
149149
break;
150150
case IN_PROGRESS:
151-
System.out.println("Game In rogress");
151+
System.out.println("Game In Progress");
152152
break;
153153
}
154154
}
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
package com.baeldung.algorithms.analysis;
2+
3+
import org.junit.Test;
4+
5+
public class AnalysisRunnerLiveTest {
6+
7+
int n = 10;
8+
int total = 0;
9+
10+
@Test
11+
public void whenConstantComplexity_thenConstantRuntime() {
12+
13+
System.out.println("**** n = " + n + " ****");
14+
System.out.println();
15+
16+
// Constant Time
17+
System.out.println("**** Constant time ****");
18+
19+
System.out.println("Hey - your input is: " + n);
20+
System.out.println("Running time not dependent on input size!");
21+
System.out.println();
22+
}
23+
24+
@Test
25+
public void whenLogarithmicComplexity_thenLogarithmicRuntime() {
26+
// Logarithmic Time
27+
System.out.println("**** Logarithmic Time ****");
28+
for (int i = 1; i < n; i = i * 2) {
29+
// System.out.println("Hey - I'm busy looking at: " + i);
30+
total++;
31+
}
32+
System.out.println("Total amount of times run: " + total);
33+
System.out.println();
34+
}
35+
36+
@Test
37+
public void whenLinearComplexity_thenLinearRuntime() {
38+
// Linear Time
39+
System.out.println("**** Linear Time ****");
40+
for (int i = 0; i < n; i++) {
41+
// System.out.println("Hey - I'm busy looking at: " + i);
42+
total++;
43+
}
44+
System.out.println("Total amount of times run: " + total);
45+
System.out.println();
46+
47+
}
48+
49+
@Test
50+
public void whenNLogNComplexity_thenNLogNRuntime() {
51+
// N Log N Time
52+
System.out.println("**** nlogn Time ****");
53+
total = 0;
54+
for (
55+
56+
int i = 1; i <= n; i++) {
57+
for (int j = 1; j < n; j = j * 2) {
58+
// System.out.println("Hey - I'm busy looking at: " + i + " and " + j);
59+
total++;
60+
}
61+
}
62+
System.out.println("Total amount of times run: " + total);
63+
System.out.println();
64+
}
65+
66+
@Test
67+
public void whenQuadraticComplexity_thenQuadraticRuntime() {
68+
// Quadratic Time
69+
System.out.println("**** Quadratic Time ****");
70+
total = 0;
71+
for (
72+
73+
int i = 1; i <= n; i++) {
74+
for (int j = 1; j <= n; j++) {
75+
// System.out.println("Hey - I'm busy looking at: " + i + " and " + j);
76+
total++;
77+
}
78+
}
79+
System.out.println("Total amount of times run: " + total);
80+
System.out.println();
81+
}
82+
83+
@Test
84+
public void whenCubicComplexity_thenCubicRuntime() {
85+
// Cubic Time
86+
System.out.println("**** Cubic Time ****");
87+
total = 0;
88+
for (
89+
90+
int i = 1; i <= n; i++) {
91+
for (int j = 1; j <= n; j++) {
92+
for (int k = 1; k <= n; k++) {
93+
// System.out.println("Hey - I'm busy looking at: " + i + " and " + j + " and " + k);
94+
total++;
95+
}
96+
}
97+
}
98+
System.out.println("Total amount of times run: " + total);
99+
System.out.println();
100+
}
101+
102+
@Test
103+
public void whenExponentialComplexity_thenExponentialRuntime() {
104+
// Exponential Time
105+
System.out.println("**** Exponential Time ****");
106+
total = 0;
107+
for (
108+
109+
int i = 1; i <= Math.pow(2, n); i++) {
110+
// System.out.println("Hey - I'm busy looking at: " + i);
111+
total++;
112+
}
113+
System.out.println("Total amount of times run: " + total);
114+
System.out.println();
115+
}
116+
117+
@Test
118+
public void whenFactorialComplexity_thenFactorialRuntime() {
119+
// Factorial Time
120+
System.out.println("**** Factorial Time ****");
121+
total = 0;
122+
for (
123+
124+
int i = 1; i <=
125+
126+
factorial(n); i++) {
127+
// System.out.println("Hey - I'm busy looking at: " + i);
128+
total++;
129+
}
130+
System.out.println("Total amount of times run: " + total);
131+
}
132+
133+
static int factorial(int n) {
134+
if (n == 0 || n == 1)
135+
return 1;
136+
else
137+
return n * factorial(n - 1);
138+
}
139+
}

‎animal-sniffer-mvn-plugin/pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<artifactId>animal-sniffer-mvn-plugin</artifactId>
66
<packaging>jar</packaging>
77
<version>1.0-SNAPSHOT</version>
8-
<name>example-animal-sniffer-mvn-plugin</name>
8+
<name>animal-sniffer-mvn-plugin</name>
99
<url>http://maven.apache.org</url>
1010

1111
<parent>

apache-cayenne/src/test/java/com/baeldung/apachecayenne/CayenneAdvancedOperationIntegrationTest.java renamed to apache-cayenne/src/test/java/com/baeldung/apachecayenne/CayenneAdvancedOperationLiveTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import static junit.framework.Assert.assertEquals;
2020
import static org.junit.Assert.assertNotNull;
2121

22-
public class CayenneAdvancedOperationIntegrationTest {
22+
public class CayenneAdvancedOperationLiveTest {
2323
private static ObjectContext context = null;
2424

2525
@BeforeClass

apache-cayenne/src/test/java/com/baeldung/apachecayenne/CayenneOperationIntegrationTest.java renamed to apache-cayenne/src/test/java/com/baeldung/apachecayenne/CayenneOperationLiveTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import static org.junit.Assert.assertNull;
1717

1818

19-
public class CayenneOperationIntegrationTest {
19+
public class CayenneOperationLiveTest {
2020
private static ObjectContext context = null;
2121

2222
@BeforeClass

‎apache-poi/src/test/java/com/baeldung/poi/powerpoint/PowerPointIntegrationTest.java‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
11
package com.baeldung.poi.powerpoint;
22

3+
import java.io.File;
4+
import java.util.List;
5+
36
import org.apache.poi.xslf.usermodel.XMLSlideShow;
47
import org.apache.poi.xslf.usermodel.XSLFShape;
58
import org.apache.poi.xslf.usermodel.XSLFSlide;
69
import org.junit.After;
710
import org.junit.Assert;
811
import org.junit.Before;
12+
import org.junit.Rule;
913
import org.junit.Test;
10-
11-
import java.io.File;
12-
import java.util.List;
14+
import org.junit.rules.TemporaryFolder;
1315

1416
public class PowerPointIntegrationTest {
1517

1618
private PowerPointHelper pph;
1719
private String fileLocation;
1820
private static final String FILE_NAME = "presentation.pptx";
21+
22+
@Rule
23+
public TemporaryFolder tempFolder = new TemporaryFolder();
1924

2025
@Before
2126
public void setUp() throws Exception {
22-
File currDir = new File(".");
27+
File currDir = tempFolder.newFolder();
2328
String path = currDir.getAbsolutePath();
2429
fileLocation = path.substring(0, path.length() - 1) + FILE_NAME;
2530

azure/src/test/java/com/baeldung/springboot/azure/AzureApplicationTests.java renamed to azure/src/test/java/com/baeldung/springboot/azure/AzureApplicationIntegrationTest.java

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

88
@RunWith(SpringRunner.class)
99
@SpringBootTest
10-
public class AzureApplicationTests {
10+
public class AzureApplicationIntegrationTest {
1111

1212
@Test
1313
public void contextLoads() {

‎camel-api/pom.xml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
<groupId>com.example</groupId>
66
<artifactId>spring-boot-camel</artifactId>
77
<version>0.0.1-SNAPSHOT</version>
8-
<name>Spring-Boot - Camel API</name>
98

109
<parent>
1110
<groupId>com.baeldung</groupId>

‎core-java-8/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@
5252
- [Measure Elapsed Time in Java](http://www.baeldung.com/java-measure-elapsed-time)
5353
- [Java Optional – orElse() vs orElseGet()](http://www.baeldung.com/java-optional-or-else-vs-or-else-get)
5454
- [An Introduction to Java.util.Hashtable Class](http://www.baeldung.com/java-hash-table)
55-
55+
- [Method Parameter Reflection in Java](http://www.baeldung.com/java-parameter-reflection)

0 commit comments

Comments
 (0)