Skip to content

Commit

Permalink
Merge pull request eugenp#9496 from majajoksovic/master
Browse files Browse the repository at this point in the history
BAEL-4134
  • Loading branch information
JonCook authored Jul 7, 2020
2 parents 06563f4 + 88d30d4 commit dffa1f6
Show file tree
Hide file tree
Showing 2,492 changed files with 515,690 additions and 10,370 deletions.
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,7 @@ transaction.log
*-shell.log

apache-cxf/cxf-aegis/baeldung.xml

libraries-2/*.db
apache-fop/src/test/resources/input.xml
apache-fop/src/test/resources/output_herold.pdf
apache-fop/src/test/resources/output_html2fo.pdf
apache-fop/src/test/resources/output_jtidy.pdf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.baeldung.algorithms.play2048;

public class Play2048 {
private static final int SIZE = 4;
private static final int SIZE = 3;
private static final int INITIAL_NUMBERS = 2;

public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
package com.baeldung.jgrapht;

import static org.junit.Assert.assertTrue;

import java.awt.Color;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;

import org.jgrapht.ext.JGraphXAdapter;
import org.jgrapht.graph.DefaultDirectedGraph;
import org.jgrapht.graph.DefaultEdge;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import com.mxgraph.layout.mxCircleLayout;
import com.mxgraph.layout.mxIGraphLayout;
import com.mxgraph.util.mxCellRenderer;
Expand All @@ -25,7 +20,7 @@ public class GraphImageGenerationUnitTest {

@Before
public void createGraph() throws IOException {
File imgFile = new File("src/test/resources/graph1.png");
File imgFile = new File("src/test/resources/graph.png");
imgFile.createNewFile();
g = new DefaultDirectedGraph<String, DefaultEdge>(DefaultEdge.class);
String x1 = "x1";
Expand All @@ -39,18 +34,12 @@ public void createGraph() throws IOException {
g.addEdge(x3, x1);
}

@After
public void cleanup() {
File imgFile = new File("src/test/resources/graph1.png");
imgFile.deleteOnExit();
}

@Test
public void givenAdaptedGraph_whenWriteBufferedImage_ThenFileShouldExist() throws IOException {
JGraphXAdapter<String, DefaultEdge> graphAdapter = new JGraphXAdapter<String, DefaultEdge>(g);
mxIGraphLayout layout = new mxCircleLayout(graphAdapter);
layout.execute(graphAdapter.getDefaultParent());
File imgFile = new File("src/test/resources/graph1.png");
File imgFile = new File("src/test/resources/graph.png");
BufferedImage image = mxCellRenderer.createBufferedImage(graphAdapter, null, 2, Color.WHITE, true, null);
ImageIO.write(image, "PNG", imgFile);
assertTrue(imgFile.exists());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@

public class DutchNationalFlagPartioning {

public static Partition partition(int[] input, int begin, int end) {
public static Partition partition(int[] a, int begin, int end) {
int lt = begin, current = begin, gt = end;
int partitioningValue = input[begin];
int partitioningValue = a[begin];

while (current <= gt) {
int compareCurrent = compare(input[current], partitioningValue);
int compareCurrent = compare(a[current], partitioningValue);
switch (compareCurrent) {
case -1:
swap(input, current++, lt++);
swap(a, current++, lt++);
break;
case 0:
current++;
break;
case 1:
swap(input, current, gt--);
swap(a, current, gt--);
break;
}
}
Expand Down
6 changes: 6 additions & 0 deletions apache-avro/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## Apache Avro

This module contains articles about Apache Avro

### Relevant Articles:
- [Guide to Apache Avro](https://www.baeldung.com/java-apache-avro)
72 changes: 72 additions & 0 deletions apache-avro/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>apache-avro</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>apache-avro</name>

<parent>
<groupId>com.baeldung</groupId>
<artifactId>parent-modules</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>

<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.avro</groupId>
<artifactId>avro</artifactId>
<version>${avro.version}</version>
</dependency>
<dependency>
<groupId>org.apache.avro</groupId>
<artifactId>avro-compiler</artifactId>
<version>${avro.version}</version>
</dependency>

<dependency>
<groupId>org.apache.avro</groupId>
<artifactId>avro-maven-plugin</artifactId>
<version>${avro.version}</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.avro</groupId>
<artifactId>avro-maven-plugin</artifactId>
<version>${avro.version}</version>
<executions>
<execution>
<id>schemas</id>
<phase>generate-sources</phase>
<goals>
<goal>schema</goal>
<goal>protocol</goal>
<goal>idl-protocol</goal>
</goals>
<configuration>
<sourceDirectory>${project.basedir}/src/main/resources/</sourceDirectory>
<outputDirectory>${project.basedir}/src/main/java/</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

<properties>
<avro.version>1.8.2</avro.version>
<slf4j.version>1.7.25</slf4j.version>
</properties>

</project>
File renamed without changes.
3 changes: 3 additions & 0 deletions apache-beam/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Relevant Articles:

- [Introduction to Apache Beam](https://www.baeldung.com/apache-beam)
43 changes: 43 additions & 0 deletions apache-beam/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.baeldung</groupId>
<artifactId>parent-modules</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>

<groupId>com.baeldung.apache</groupId>
<artifactId>apache-beam</artifactId>
<version>0.0.1-SNAPSHOT</version>

<dependencies>
<dependency>
<groupId>org.apache.beam</groupId>
<artifactId>beam-sdks-java-core</artifactId>
<version>${beam.version}</version>
</dependency>
<!-- runtime scoped -->
<dependency>
<groupId>org.apache.beam</groupId>
<artifactId>beam-runners-direct-java</artifactId>
<version>${beam.version}</version>
<scope>runtime</scope>
</dependency>
<!-- test scoped -->
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<properties>
<beam.version>2.19.0</beam.version>
<assertj.version>3.6.1</assertj.version>
</properties>

</project>
7 changes: 7 additions & 0 deletions apache-bval/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Apache BVal

This module contains articles about Apache BVal

### Relevant Articles:

- [Intro to Apache BVal](https://www.baeldung.com/apache-bval)
40 changes: 40 additions & 0 deletions apache-bval/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>apache-bval</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>apache-bval</name>

<parent>
<groupId>com.baeldung</groupId>
<artifactId>parent-modules</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>

<dependencies>
<dependency>
<groupId>org.apache.bval</groupId>
<artifactId>bval-jsr</artifactId>
<version>${bval.version}</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>${javax.validation.validation-api.version}</version>
</dependency>
<dependency>
<groupId>org.apache.bval</groupId>
<artifactId>bval-extras</artifactId>
<version>${bval.version}</version>
</dependency>
</dependencies>

<properties>
<bval.version>1.1.2</bval.version>
<javax.validation.validation-api.version>1.1.0.Final</javax.validation.validation-api.version>
</properties>

</project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.baeldung.bval.model;
package com.baeldung.model;

import java.io.File;

Expand All @@ -13,7 +13,7 @@
import org.apache.bval.extras.constraints.file.Directory;
import org.apache.bval.extras.constraints.net.InetAddress;

import com.baeldung.bval.validation.Password;
import com.baeldung.validation.Password;

public class User {
@NotNull
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.baeldung.bval.validation;
package com.baeldung.validation;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.baeldung.bval.validation;
package com.baeldung.validation;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.baeldung.bval.validation;
package com.baeldung.validation;

import java.io.File;
import java.util.Set;
Expand All @@ -13,10 +13,10 @@
import org.junit.BeforeClass;
import org.junit.Test;

import com.baeldung.bval.model.User;

import static org.junit.Assert.*;

import com.baeldung.model.User;

public class ValidationIntegrationTest {
private static ValidatorFactory validatorFactory;
private static Validator validator;
Expand Down
7 changes: 7 additions & 0 deletions apache-curator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Apache Curator

This module contains articles about Apache Curator

### Relevant Articles:

- [Introduction to Apache Curator](https://www.baeldung.com/apache-curator)
Loading

0 comments on commit dffa1f6

Please sign in to comment.