Java 类和对象并且更新 Log4j2 的配置。
This commit is contained in:
parent
575d7c02c0
commit
aeafc6f848
9
pom.xml
9
pom.xml
@ -38,6 +38,10 @@
|
|||||||
</license>
|
</license>
|
||||||
</licenses>
|
</licenses>
|
||||||
|
|
||||||
|
<modules>
|
||||||
|
<module>toolkits</module>
|
||||||
|
</modules>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<!-- Generic properties -->
|
<!-- Generic properties -->
|
||||||
<java.version>11</java.version>
|
<java.version>11</java.version>
|
||||||
@ -75,8 +79,8 @@
|
|||||||
<!-- LOG -->
|
<!-- LOG -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.logging.log4j</groupId>
|
<groupId>org.apache.logging.log4j</groupId>
|
||||||
<artifactId>log4j-slf4j-impl</artifactId>
|
<artifactId>log4j-slf4j18-impl</artifactId>
|
||||||
<version>2.11.0</version>
|
<version>2.14.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- APACHE COMMONS -->
|
<!-- APACHE COMMONS -->
|
||||||
@ -305,6 +309,7 @@
|
|||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
<snapshotRepository>
|
<snapshotRepository>
|
||||||
<id>ossrh</id>
|
<id>ossrh</id>
|
||||||
|
@ -0,0 +1,64 @@
|
|||||||
|
package com.ossez.toolkits.codebank.tests;
|
||||||
|
|
||||||
|
import junit.framework.TestCase;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.jupiter.api.AfterAll;
|
||||||
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
|
import org.junit.jupiter.api.TestInstance;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Object of VariableOssez
|
||||||
|
*
|
||||||
|
* @author YuCheng
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
class OssezVariable {
|
||||||
|
int s1, s2;
|
||||||
|
static int s3;
|
||||||
|
|
||||||
|
OssezVariable(int x, int y, int z) {
|
||||||
|
s1 = x;
|
||||||
|
s2 = y;
|
||||||
|
s3 = z;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author YuCheng Hu
|
||||||
|
*/
|
||||||
|
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||||
|
public class DataStructureTest{
|
||||||
|
|
||||||
|
private final static Logger logger = LoggerFactory.getLogger(DataStructureTest.class);
|
||||||
|
|
||||||
|
|
||||||
|
@BeforeAll
|
||||||
|
protected void setUp() throws Exception {
|
||||||
|
}
|
||||||
|
|
||||||
|
@AfterAll
|
||||||
|
protected void tearDown() throws Exception {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Do RetsServerConnection Test
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testArrayDataStructure() {
|
||||||
|
|
||||||
|
int[] intArraySize = new int[3];
|
||||||
|
Integer intArrayW[] = new Integer[3];
|
||||||
|
logger.debug("Array Size - [{}]", intArraySize.length);
|
||||||
|
logger.debug("Array Size - [{}]", intArrayW.length);
|
||||||
|
|
||||||
|
int[] intArrayValue = {1,2,3};
|
||||||
|
String[] strArray = {"COM","OSSEZ","US"};
|
||||||
|
logger.debug("Array Size - [{}]", intArrayValue.length);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -7,10 +7,11 @@
|
|||||||
</Appenders>
|
</Appenders>
|
||||||
<Loggers>
|
<Loggers>
|
||||||
<Logger name="com.ossez" level="trace">
|
<Logger name="com.ossez" level="trace">
|
||||||
<AppenderRef ref="Console"/>
|
<AppenderRef ref="Console" />
|
||||||
</Logger>
|
</Logger>
|
||||||
<Root level="error">
|
|
||||||
<AppenderRef ref="Console"/>
|
<Root level="all">
|
||||||
|
|
||||||
</Root>
|
</Root>
|
||||||
</Loggers>
|
</Loggers>
|
||||||
</Configuration>
|
</Configuration>
|
Loading…
x
Reference in New Issue
Block a user