Skip to content

Commit faae433

Browse files
committed
Merge remote-tracking branch 'eugenp/master'
2 parents 2bcc38e + b4aa279 commit faae433

326 files changed

Lines changed: 5939 additions & 1638 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.

‎algorithms/README.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,7 @@
2424
- [Practical Java Examples of the Big O Notation](http://www.baeldung.com/java-algorithm-complexity)
2525
- [Find the Middle Element of a Linked List](http://www.baeldung.com/java-linked-list-middle-element)
2626
- [An Introduction to the Theory of Big-O Notation](http://www.baeldung.com/big-o-notation)
27+
- [Check If Two Rectangles Overlap In Java](https://www.baeldung.com/java-check-if-two-rectangles-overlap)
28+
- [Calculate the Distance Between Two Points in Java](https://www.baeldung.com/java-distance-between-two-points)
29+
- [Find the Intersection of Two Lines in Java](https://www.baeldung.com/java-intersection-of-two-lines)
30+
- [Check If a String Contains All The Letters of The Alphabet](https://www.baeldung.com/java-string-contains-all-letters)
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
package com.baeldung.algorithms.mergesort;
2+
3+
public class MergeSort {
4+
5+
public static void main(String[] args) {
6+
int[] a = { 5, 1, 6, 2, 3, 4 };
7+
mergeSort(a, a.length);
8+
for (int i = 0; i < a.length; i++)
9+
System.out.println(a[i]);
10+
}
11+
12+
public static void mergeSort(int[] a, int n) {
13+
if (n < 2)
14+
return;
15+
int mid = n / 2;
16+
int[] l = new int[mid];
17+
int[] r = new int[n - mid];
18+
19+
for (int i = 0; i < mid; i++) {
20+
l[i] = a[i];
21+
}
22+
for (int i = mid; i < n; i++) {
23+
r[i - mid] = a[i];
24+
}
25+
mergeSort(l, mid);
26+
mergeSort(r, n - mid);
27+
28+
merge(a, l, r, mid, n - mid);
29+
}
30+
31+
public static void merge(int[] a, int[] l, int[] r, int left, int right) {
32+
33+
int i = 0, j = 0, k = 0;
34+
35+
while (i < left && j < right) {
36+
37+
if (l[i] < r[j])
38+
a[k++] = l[i++];
39+
else
40+
a[k++] = r[j++];
41+
42+
}
43+
44+
while (i < left)
45+
a[k++] = l[i++];
46+
47+
while (j < right)
48+
a[k++] = r[j++];
49+
}
50+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.baeldung.algorithms.mergesort;
2+
3+
import org.junit.Assert;
4+
5+
import org.junit.Test;
6+
7+
public class MergeSortUnitTest {
8+
9+
@Test
10+
public void positiveTest() {
11+
int[] actual = { 5, 1, 6, 2, 3, 4 };
12+
int[] expected = { 1, 2, 3, 4, 5, 6 };
13+
MergeSort.mergeSort(actual, actual.length);
14+
Assert.assertArrayEquals(expected, actual);
15+
}
16+
17+
}

animal-sniffer-mvn-plugin/src/test/java/com/baeldung/AppTest.java renamed to animal-sniffer-mvn-plugin/src/test/java/com/baeldung/AppUnitTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
/**
88
* Unit test for simple App.
99
*/
10-
public class AppTest
10+
public class AppUnitTest
1111
extends TestCase
1212
{
1313
/**
1414
* Create the test case
1515
*
1616
* @param testName name of the test case
1717
*/
18-
public AppTest( String testName )
18+
public AppUnitTest( String testName )
1919
{
2020
super( testName );
2121
}
@@ -25,7 +25,7 @@ public AppTest( String testName )
2525
*/
2626
public static Test suite()
2727
{
28-
return new TestSuite( AppTest.class );
28+
return new TestSuite( AppUnitTest.class );
2929
}
3030

3131
/**

‎apache-avro/pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<groupId>com.baeldung</groupId>
77
<artifactId>apache-avro</artifactId>
88
<version>0.0.1-SNAPSHOT</version>
9-
<name>Apache Avro</version>
9+
<name>Apache Avro</name>
1010

1111
<properties>
1212
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

apache-avro/src/test/java/com/baeldung/avro/util/serealization/AvroSerealizerDeSerealizerTest.java renamed to apache-avro/src/test/java/com/baeldung/avro/util/serealization/AvroSerealizerDeSerealizerUnitTest.java

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

1414
import static org.junit.Assert.*;
1515

16-
public class AvroSerealizerDeSerealizerTest {
16+
public class AvroSerealizerDeSerealizerUnitTest {
1717

1818
AvroSerealizer serealizer;
1919
AvroDeSerealizer deSerealizer;

‎asciidoctor/README.md‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
### Relevant articles
22

3-
- [Introduction to Asciidoctor](http://www.baeldung.com/introduction-to-asciidoctor)
43
- [Generating a Book with Asciidoctor](http://www.baeldung.com/asciidoctor-book)
54
- [Introduction to Asciidoctor in Java](http://www.baeldung.com/asciidoctor)

‎asciidoctor/pom.xml‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,10 @@
6161
</build>
6262

6363
<properties>
64-
<asciidoctor-maven-plugin.version>1.5.5</asciidoctor-maven-plugin.version>
65-
<asciidoctorj.version>1.5.4</asciidoctorj.version>
66-
<asciidoctorj-pdf.src.version>1.5.0-alpha.11</asciidoctorj-pdf.src.version>
64+
<asciidoctor-maven-plugin.version>1.5.6</asciidoctor-maven-plugin.version>
65+
<asciidoctorj.version>1.5.6</asciidoctorj.version>
66+
67+
<asciidoctorj-pdf.version>1.5.0-alpha.15</asciidoctorj-pdf.version>
6768
<asciidoctorj-pdf.plugin.version>1.5.0-alpha.15</asciidoctorj-pdf.plugin.version>
6869
</properties>
6970

asciidoctor/src/test/java/com/baeldung/asciidoctor/AsciidoctorDemoTest.java renamed to asciidoctor/src/test/java/com/baeldung/asciidoctor/AsciidoctorDemoIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import org.junit.Assert;
44
import org.junit.Test;
55

6-
public class AsciidoctorDemoTest {
6+
public class AsciidoctorDemoIntegrationTest {
77

88
@Test
99
public void givenString_whenConverting_thenResultingHTMLCode() {
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<artifactId>flyway-cdi</artifactId>
8+
9+
<parent>
10+
<groupId>com.baeldung</groupId>
11+
<artifactId>cdi-portable-extension</artifactId>
12+
<version>1.0-SNAPSHOT</version>
13+
</parent>
14+
15+
<dependencies>
16+
<dependency>
17+
<groupId>javax.enterprise</groupId>
18+
<artifactId>cdi-api</artifactId>
19+
<version>2.0.SP1</version>
20+
</dependency>
21+
<dependency>
22+
<groupId>org.flywaydb</groupId>
23+
<artifactId>flyway-core</artifactId>
24+
<version>5.1.4</version>
25+
</dependency>
26+
<dependency>
27+
<groupId>org.apache.tomcat</groupId>
28+
<artifactId>tomcat-jdbc</artifactId>
29+
<version>8.5.33</version>
30+
</dependency>
31+
<dependency>
32+
<groupId>javax.annotation</groupId>
33+
<artifactId>javax.annotation-api</artifactId>
34+
<version>1.3.2</version>
35+
</dependency>
36+
</dependencies>
37+
38+
</project>

0 commit comments

Comments
 (0)