commit
72120d88cb
@ -4,7 +4,6 @@
|
|||||||
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>core-java-8</artifactId>
|
<artifactId>core-java-8</artifactId>
|
||||||
<version>0.1.0-SNAPSHOT</version>
|
|
||||||
<name>core-java-8</name>
|
<name>core-java-8</name>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ import java.util.GregorianCalendar;
|
|||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
|
||||||
public class DateFormatUnitTest {
|
public class DateFormatUnitTest {
|
||||||
|
|
||||||
@Tes t
|
@Tes t
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package com.ossez.util;
|
package com.ossez.util;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
//import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
import java.time.Clock;
|
import java.time.Clock;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
@ -9,7 +9,7 @@ import java.time.LocalTime;
|
|||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.time.temporal.ChronoField;
|
import java.time.temporal.ChronoField;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
public class CurrentDateTimeUnitTest {
|
public class CurrentDateTimeUnitTest {
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
This module contains articles about the Java List collection
|
This module contains articles about the Java List collection
|
||||||
|
|
||||||
### Relevant Articles:
|
### Relevant Articles:
|
||||||
- [Java – Get Random Item/Element From a List](http://www.baeldung.com/java-random-list-element)
|
- [Java 如何从一个 List 中随机获得元素](https://www.ossez.com/t/java-list/13934)
|
||||||
- [Removing all nulls from a List in Java](http://www.baeldung.com/java-remove-nulls-from-list)
|
- [Removing all nulls from a List in Java](http://www.baeldung.com/java-remove-nulls-from-list)
|
||||||
- [Removing all duplicates from a List in Java](http://www.baeldung.com/java-remove-duplicates-from-list)
|
- [Removing all duplicates from a List in Java](http://www.baeldung.com/java-remove-duplicates-from-list)
|
||||||
- [How to TDD a List Implementation in Java](http://www.baeldung.com/java-test-driven-list)
|
- [How to TDD a List Implementation in Java](http://www.baeldung.com/java-test-driven-list)
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
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>core-java-collections-list</artifactId>
|
<artifactId>core-java-collections-list</artifactId>
|
||||||
<version>0.1.0-SNAPSHOT</version>
|
|
||||||
<name>core-java-collections-list</name>
|
<name>core-java-collections-list</name>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
@ -12,7 +11,7 @@
|
|||||||
<groupId>com.ossez.core-java-modules</groupId>
|
<groupId>com.ossez.core-java-modules</groupId>
|
||||||
<artifactId>core-java-modules</artifactId>
|
<artifactId>core-java-modules</artifactId>
|
||||||
<version>0.0.2-SNAPSHOT</version>
|
<version>0.0.2-SNAPSHOT</version>
|
||||||
<relativePath></relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
@ -3,6 +3,8 @@ package com.ossez.list;
|
|||||||
import org.junit.jupiter.api.BeforeAll;
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.TestInstance;
|
import org.junit.jupiter.api.TestInstance;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
@ -11,12 +13,18 @@ import static org.hamcrest.MatcherAssert.assertThat;
|
|||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List Remove Tes
|
* Test for remove list
|
||||||
*
|
*
|
||||||
* @author YuCheng Hu
|
* <p><a href="https://www.ossez.com/t/java-list/13919">https://www.ossez.com/t/java-list/13919</a></p>
|
||||||
|
*
|
||||||
|
* @author YuCheng
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||||
public class RemoveFirstElementTest {
|
public class RemoveFirstElementTest {
|
||||||
|
private final static Logger logger = LoggerFactory.getLogger(RemoveFirstElementTest.class);
|
||||||
|
|
||||||
|
|
||||||
private ArrayList<String> list = new ArrayList();
|
private ArrayList<String> list = new ArrayList();
|
||||||
private LinkedList<String> linkedList = new LinkedList<>();
|
private LinkedList<String> linkedList = new LinkedList<>();
|
||||||
|
|
||||||
@ -41,6 +49,8 @@ public class RemoveFirstElementTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testGivenList_whenRemoveFirst_thenRemoved() {
|
public void testGivenList_whenRemoveFirst_thenRemoved() {
|
||||||
|
logger.debug("Get Size of List - [{}]", list.size());
|
||||||
|
|
||||||
list.remove(0);
|
list.remove(0);
|
||||||
|
|
||||||
assertThat(list, hasSize(4));
|
assertThat(list, hasSize(4));
|
||||||
|
@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<configuration debug="true">
|
||||||
|
<appender name="STDOUT"
|
||||||
|
class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<!-- encoders are assigned by default the type
|
||||||
|
ch.qos.logback.classic.encoder.PatternLayoutEncoder -->
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
||||||
|
|
||||||
|
</encoder>
|
||||||
|
<layout class="ch.qos.logback.classic.PatternLayout">
|
||||||
|
<Pattern>
|
||||||
|
%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n
|
||||||
|
</Pattern>
|
||||||
|
</layout>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<logger name="com.ossez" level="DEBUG"/>
|
||||||
|
|
||||||
|
<root level="DEBUG">
|
||||||
|
<appender-ref ref="STDOUT"/>
|
||||||
|
</root>
|
||||||
|
</configuration>
|
Loading…
x
Reference in New Issue
Block a user