From 8790740ee63930c785fef43dcb7110b908d9e706 Mon Sep 17 00:00:00 2001 From: YuCheng Hu Date: Wed, 21 Nov 2018 14:12:17 -0500 Subject: [PATCH] =?UTF-8?q?=E7=B1=BB=E5=8F=98=E9=87=8F=E5=AE=9E=E4=BE=8B?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lang/tutorial/tests/VariableTest.java | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/test/java/com/ossez/lang/tutorial/tests/VariableTest.java diff --git a/src/test/java/com/ossez/lang/tutorial/tests/VariableTest.java b/src/test/java/com/ossez/lang/tutorial/tests/VariableTest.java new file mode 100644 index 0000000000..a7112e3aea --- /dev/null +++ b/src/test/java/com/ossez/lang/tutorial/tests/VariableTest.java @@ -0,0 +1,49 @@ +package com.ossez.lang.tutorial.tests; + +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import junit.framework.TestCase; + +/** + * 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 + * + */ +public class VariableTest extends TestCase { + + private final static Logger logger = LoggerFactory.getLogger(VariableTest.class); + + /** + * Do RetsServerConnection Test + */ + @Test + public void testStaticVariableChange() { + + OssezVariable objA = new OssezVariable(1, 2, 3); + logger.debug("s1/s2/s3 - [{}]/[{}]/[{}]", objA.s1, objA.s2, OssezVariable.s3); + + OssezVariable objB = new OssezVariable(4, 5, 6); + logger.debug("s1/s2/s3 - [{}]/[{}]/[{}]", objA.s1, objA.s2, OssezVariable.s3); + logger.debug("s1/s2/s3 - [{}]/[{}]/[{}]", objB.s1, objB.s2, OssezVariable.s3); + } + +}