USRE-86 Add new test file

This commit is contained in:
YuCheng Hu 2021-11-29 15:29:21 -05:00
parent 1cd895370b
commit 2ad17c4d7e
1 changed files with 55 additions and 0 deletions

View File

@ -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();
}
}