Merge branch 'master' of https://github.com/eugenp/tutorials into BAEL-9550

This commit is contained in:
amit2103 2018-10-20 00:38:26 +05:30
commit 72cec87e82
39 changed files with 80 additions and 79 deletions

View File

@ -29,7 +29,6 @@
- [AWS Lambda With Java](http://www.baeldung.com/java-aws-lambda) - [AWS Lambda With Java](http://www.baeldung.com/java-aws-lambda)
- [Introduction to Nashorn](http://www.baeldung.com/java-nashorn) - [Introduction to Nashorn](http://www.baeldung.com/java-nashorn)
- [Chained Exceptions in Java](http://www.baeldung.com/java-chained-exceptions) - [Chained Exceptions in Java](http://www.baeldung.com/java-chained-exceptions)
- [A Quick JUnit vs TestNG Comparison](http://www.baeldung.com/junit-vs-testng)
- [Java Primitive Conversions](http://www.baeldung.com/java-primitive-conversions) - [Java Primitive Conversions](http://www.baeldung.com/java-primitive-conversions)
- [Java Money and the Currency API](http://www.baeldung.com/java-money-and-currency) - [Java Money and the Currency API](http://www.baeldung.com/java-money-and-currency)
- [JVM Log Forging](http://www.baeldung.com/jvm-log-forging) - [JVM Log Forging](http://www.baeldung.com/jvm-log-forging)
@ -150,9 +149,11 @@
- [Throw Exception in Optional in Java 8](https://www.baeldung.com/java-optional-throw-exception) - [Throw Exception in Optional in Java 8](https://www.baeldung.com/java-optional-throw-exception)
- [Add a Character to a String at a Given Position](https://www.baeldung.com/java-add-character-to-string) - [Add a Character to a String at a Given Position](https://www.baeldung.com/java-add-character-to-string)
- [Synthetic Constructs in Java](https://www.baeldung.com/java-synthetic) - [Synthetic Constructs in Java](https://www.baeldung.com/java-synthetic)
- [Calculating the nth Root in Java](https://www.baeldung.com/java-nth-root)
- [Convert Double to String, Removing Decimal Places](https://www.baeldung.com/java-double-to-string) - [Convert Double to String, Removing Decimal Places](https://www.baeldung.com/java-double-to-string)
- [Different Ways to Capture Java Heap Dumps](https://www.baeldung.com/java-heap-dump-capture) - [Different Ways to Capture Java Heap Dumps](https://www.baeldung.com/java-heap-dump-capture)
- [How to Separate Double into Integer and Decimal Parts](https://www.baeldung.com/java-separate-double-into-integer-decimal-parts) - [How to Separate Double into Integer and Decimal Parts](https://www.baeldung.com/java-separate-double-into-integer-decimal-parts)
- [ZoneOffset in Java](https://www.baeldung.com/java-zone-offset) - [ZoneOffset in Java](https://www.baeldung.com/java-zone-offset)
- [Hashing a Password in Java](https://www.baeldung.com/java-password-hashing) - [Hashing a Password in Java](https://www.baeldung.com/java-password-hashing)
- [Java Switch Statement](https://www.baeldung.com/java-switch) - [Java Switch Statement](https://www.baeldung.com/java-switch)
- [The Modulo Operator in Java](https://www.baeldung.com/modulo-java)

View File

@ -484,6 +484,7 @@
<module>spring-boot-mvc</module> <module>spring-boot-mvc</module>
<module>spring-boot-vue</module> <module>spring-boot-vue</module>
<module>spring-boot-logging-log4j2</module> <module>spring-boot-logging-log4j2</module>
<module>spring-boot-disable-console-logging</module>
<module>spring-cloud-data-flow</module> <module>spring-cloud-data-flow</module>
<module>spring-cloud</module> <module>spring-cloud</module>
<module>spring-cloud-bus</module> <module>spring-cloud-bus</module>
@ -1026,6 +1027,7 @@
<module>spring-boot-security</module> <module>spring-boot-security</module>
<module>spring-boot-mvc</module> <module>spring-boot-mvc</module>
<module>spring-boot-logging-log4j2</module> <module>spring-boot-logging-log4j2</module>
<module>spring-boot-disable-console-logging</module>
<module>spring-cloud-data-flow</module> <module>spring-cloud-data-flow</module>
<module>spring-cloud</module> <module>spring-cloud</module>
<module>spring-cloud-bus</module> <module>spring-cloud-bus</module>
@ -1384,6 +1386,7 @@
<module>spring-boot-security</module> <module>spring-boot-security</module>
<module>spring-boot-mvc</module> <module>spring-boot-mvc</module>
<module>spring-boot-logging-log4j2</module> <module>spring-boot-logging-log4j2</module>
<module>spring-boot-disable-console-logging</module>
<module>spring-cloud-data-flow</module> <module>spring-cloud-data-flow</module>
<module>spring-cloud</module> <module>spring-cloud</module>
<module>spring-cloud-bus</module> <module>spring-cloud-bus</module>

View File

@ -0,0 +1,2 @@
### Relevant Articles:
- [How to Disable Console Logging in Spring Boot](https://www.baeldung.com/spring-boot-disable-console-logging)

View File

@ -3,10 +3,12 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>disabling-console-jul</artifactId> <artifactId>disabling-console-jul</artifactId>
<!-- this needs to use the boot parent directly in order to not inherit logback dependencies -->
<parent> <parent>
<groupId>com.baeldung</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>disabling-console-logging</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>2.0.5.RELEASE</version>
</parent> </parent>
<dependencies> <dependencies>

View File

@ -3,10 +3,12 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>disabling-console-log4j2</artifactId> <artifactId>disabling-console-log4j2</artifactId>
<!-- this needs to use the boot parent directly in order to not inherit logback dependencies -->
<parent> <parent>
<groupId>com.baeldung</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>disabling-console-logging</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>2.0.5.RELEASE</version>
</parent> </parent>
<dependencies> <dependencies>

View File

@ -2,8 +2,16 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>com.baeldung</groupId> <groupId>com.baeldung</groupId>
<artifactId>disabling-console-logging</artifactId> <artifactId>spring-boot-disable-console-logging</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
</parent> </parent>
<artifactId>disabling-console-logback</artifactId> <artifactId>disabling-console-logback</artifactId>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
</project> </project>

View File

@ -1,14 +1,15 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <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"> 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> <modelVersion>4.0.0</modelVersion>
<artifactId>disabling-console-logging</artifactId> <artifactId>spring-boot-disable-console-logging</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<description>Projects for Disabling Spring Boot Console Logging tutorials</description> <description>Projects for Disabling Spring Boot Console Logging tutorials</description>
<parent> <parent>
<artifactId>parent-boot-2</artifactId>
<groupId>com.baeldung</groupId> <groupId>com.baeldung</groupId>
<artifactId>spring-boot-logging-log4j2</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<relativePath>../parent-boot-2</relativePath>
</parent> </parent>
<modules> <modules>

View File

@ -1,3 +1,2 @@
### Relevant Articles: ### Relevant Articles:
- [Logging in Spring Boot](http://www.baeldung.com/spring-boot-logging) - [Logging in Spring Boot](http://www.baeldung.com/spring-boot-logging)
- [How to Disable Console Logging in Spring Boot](https://www.baeldung.com/spring-boot-disable-console-logging)

View File

@ -4,41 +4,58 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>spring-boot-logging-log4j2</artifactId> <artifactId>spring-boot-logging-log4j2</artifactId>
<packaging>pom</packaging> <packaging>jar</packaging>
<description>Projects for Spring Boot Logging tutorials</description> <description>Demo project for Spring Boot Logging with Log4J2</description>
<!-- this needs to use the boot parent directly in order to not inherit logback dependencies -->
<parent> <parent>
<artifactId>parent-boot-2</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<groupId>com.baeldung</groupId> <groupId>org.springframework.boot</groupId>
<version>0.0.1-SNAPSHOT</version> <version>2.0.5.RELEASE</version>
<relativePath>../parent-boot-2</relativePath>
</parent> </parent>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId> <artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
</dependency> </dependency>
</dependencies> </dependencies>
<modules>
<module>spring-boot-logging-log4j2-app</module>
<module>disabling-console-logging</module>
</modules>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
</plugin> <configuration>
</plugins> <forkCount>3</forkCount>
<reuseForks>true</reuseForks>
<excludes>
<exclude>**/*IntegrationTest.java</exclude>
<exclude>**/*IntTest.java</exclude>
<exclude>**/*ManualTest.java</exclude>
<exclude>**/*LiveTest.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build> </build>
<properties>
</properties>
</project> </project>

View File

@ -1,33 +0,0 @@
<?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>spring-boot-logging-log4j2-app</artifactId>
<packaging>jar</packaging>
<description>Demo project for Spring Boot Logging with Log4J2</description>
<parent>
<artifactId>spring-boot-logging-log4j2</artifactId>
<groupId>com.baeldung</groupId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -32,6 +32,6 @@ public class LoggingController {
loggerNative.warn("This WARN message been printed by Log4j2 without passing through SLF4J"); loggerNative.warn("This WARN message been printed by Log4j2 without passing through SLF4J");
loggerNative.error("This ERROR message been printed by Log4j2 without passing through SLF4J"); loggerNative.error("This ERROR message been printed by Log4j2 without passing through SLF4J");
loggerNative.fatal("This FATAL message been printed by Log4j2 without passing through SLF4J"); loggerNative.fatal("This FATAL message been printed by Log4j2 without passing through SLF4J");
return "Howdy! Check out the Logs to see the output printed directly throguh Log4j2..."; return "Howdy! Check out the Logs to see the output printed directly through Log4j2...";
} }
} }

View File

@ -15,3 +15,4 @@
- [The Order of Tests in JUnit](http://www.baeldung.com/junit-5-test-order) - [The Order of Tests in JUnit](http://www.baeldung.com/junit-5-test-order)
- [Running JUnit Tests Programmatically, from a Java Application](https://www.baeldung.com/junit-tests-run-programmatically-from-java) - [Running JUnit Tests Programmatically, from a Java Application](https://www.baeldung.com/junit-tests-run-programmatically-from-java)
- [Testing an Abstract Class With JUnit](https://www.baeldung.com/junit-test-abstract-class) - [Testing an Abstract Class With JUnit](https://www.baeldung.com/junit-test-abstract-class)
- [A Quick JUnit vs TestNG Comparison](http://www.baeldung.com/junit-vs-testng)

View File

@ -1,4 +1,4 @@
package com.baeldung.throwsexception; package com.baeldung.junit5vstestng;
public class Calculator { public class Calculator {

View File

@ -1,4 +1,4 @@
package com.baeldung.throwsexception; package com.baeldung.junit5vstestng;
public class DivideByZeroException extends RuntimeException { public class DivideByZeroException extends RuntimeException {

View File

@ -1,4 +1,4 @@
package com.baeldung.throwsexception; package com.baeldung.junit5vstestng;
import org.junit.Test; import org.junit.Test;

View File

@ -1,4 +1,4 @@
package org.baeldung.java.suite.childpackage1; package com.baeldung.junit5vstestng;
import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;

View File

@ -1,4 +1,4 @@
package org.baeldung.java.suite.childpackage2; package com.baeldung.junit5vstestng;
import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;

View File

@ -1,4 +1,4 @@
package org.baeldung.java.customtestname; package com.baeldung.junit5vstestng;
import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNotNull;

View File

@ -1,4 +1,4 @@
package org.baeldung.java.parameterisedsource; package com.baeldung.junit5vstestng;
import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;

View File

@ -1,4 +1,4 @@
package org.baeldung.java.parameterisedsource; package com.baeldung.junit5vstestng;
public enum PizzaDeliveryStrategy { public enum PizzaDeliveryStrategy {
EXPRESS, EXPRESS,

View File

@ -1,7 +1,5 @@
package org.baeldung.java.suite; package com.baeldung.junit5vstestng;
import org.baeldung.java.suite.childpackage1.Class1UnitTest;
import org.baeldung.java.suite.childpackage2.Class2UnitTest;
import org.junit.platform.runner.JUnitPlatform; import org.junit.platform.runner.JUnitPlatform;
import org.junit.platform.suite.api.SelectClasses; import org.junit.platform.suite.api.SelectClasses;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;

View File

@ -1,4 +1,4 @@
package org.baeldung.java.suite; package com.baeldung.junit5vstestng;
import org.junit.platform.runner.JUnitPlatform; import org.junit.platform.runner.JUnitPlatform;
import org.junit.platform.suite.api.SelectPackages; import org.junit.platform.suite.api.SelectPackages;

View File

@ -11,7 +11,7 @@ import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
public class SummationServiceIntegrationTest { public class SummationServiceUnitTest {
private static List<Integer> numbers; private static List<Integer> numbers;
@BeforeAll @BeforeAll

View File

@ -1,6 +1,6 @@
package org.baeldung.mockito; package org.baeldung.mockito;
public class FinalList extends MyList { public final class FinalList extends MyList {
@Override @Override
public int size() { public int size() {