From 2ad17c4d7e967510c51f3718bc36314ce140d953 Mon Sep 17 00:00:00 2001 From: YuCheng Hu Date: Mon, 29 Nov 2021 15:29:21 -0500 Subject: [PATCH] USRE-86 Add new test file --- .../usreio/client/tests/MetadataTest.java | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 src/test/java/com/ossez/usreio/client/tests/MetadataTest.java diff --git a/src/test/java/com/ossez/usreio/client/tests/MetadataTest.java b/src/test/java/com/ossez/usreio/client/tests/MetadataTest.java new file mode 100644 index 0000000..3c98e0e --- /dev/null +++ b/src/test/java/com/ossez/usreio/client/tests/MetadataTest.java @@ -0,0 +1,55 @@ +package com.ossez.usreio.client.tests; + +import org.junit.jupiter.api.Test; +import com.ossez.usreio.client.retsapi.RETSConnection; +import com.ossez.usreio.client.retsapi.RETSGetMetadataTransaction; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.InputStream; +import java.util.Properties; + +/** + * @author YuCheng + */ +public class MetadataTest { + + private final static Logger logger = LoggerFactory.getLogger(MetadataTest.class); + + /** + * Do RetsServerConnection Test + */ + @Test + public void testStaticVariableChange() { + + // BasicConfigurator.configure(); + + RETSConnection rc = new RETSConnection(); +// RETSLoginTransaction trans = new RETSLoginTransaction(); + RETSGetMetadataTransaction trans = new RETSGetMetadataTransaction(); + + + try { + Properties props = new Properties(); + ClassLoader loader = Thread.currentThread().getContextClassLoader(); + InputStream inputStream = loader.getResourceAsStream("rets.properties"); + + props.load(inputStream); + + // Add the optional request parameters if they exist, are non-null and non-zero-length + // rc.setRequestHeaderField("Authorization", (String)props.get("login.AUTHORIZATION")); + rc.setServerUrl((String) props.getProperty("rets_server")); +// trans.setUrl((String) props.getProperty("rets_server")); +// trans.setUsername((String) props.getProperty("rets_username")); +// trans.setPassword((String) props.getProperty("rets_password")); + } catch (Exception e) { + e.printStackTrace(); + } + rc.execute(trans); +// rc.execute(transaction); + +// transaction.getVersion(); + + } + +}