Skip to content

Commit

Permalink
review updates
Browse files Browse the repository at this point in the history
  • Loading branch information
lilgreenbird committed Nov 27, 2019
1 parent cdaa085 commit 05c2fe3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,12 @@ public static void setUpConnection() throws TestAbortedException, Exception {

readFromFile(Constants.JAVA_KEY_STORE_FILENAME, "Alias name");

String enclaveAttestationUrl = System.getProperty("enclaveAttestationUrl");
String enclaveAttestationUrl = getConfiguredProperty("enclaveAttestationUrl");
if (null != enclaveAttestationUrl) {
AETestConnectionString = TestUtils.addOrOverrideProperty(AETestConnectionString, "enclaveAttestationUrl",
enclaveAttestationUrl);
}
String enclaveAttestationProtocol = System.getProperty("enclaveAttestationProtocol");
String enclaveAttestationProtocol = getConfiguredProperty("enclaveAttestationProtocol");
if (null != enclaveAttestationProtocol) {
AETestConnectionString = TestUtils.addOrOverrideProperty(AETestConnectionString,
"enclaveAttestationProtocol", enclaveAttestationProtocol);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1776,8 +1776,8 @@ void testChars(SQLServerStatement stmt, String cekName, String[][] table, String
testChar(null, values);

if (isTestEnclave) {
if (null == System.getProperty(Constants.ENCLAVE_ATTESTATIONURL)
|| null == System.getProperty(Constants.ENCLAVE_ATTESTATIONPROTOCOL)) {
if (null == getConfiguredProperty(Constants.ENCLAVE_ATTESTATIONURL)
|| null == getConfiguredProperty(Constants.ENCLAVE_ATTESTATIONPROTOCOL)) {
fail(TestResource.getResource("R_reqExternalSetup"));
}

Expand Down Expand Up @@ -1815,8 +1815,8 @@ void testBinaries(SQLServerStatement stmt, String cekName, String[][] table, Lin
testBinary(null, values);

if (isTestEnclave) {
if (null == System.getProperty(Constants.ENCLAVE_ATTESTATIONURL)
|| null == System.getProperty(Constants.ENCLAVE_ATTESTATIONPROTOCOL)) {
if (null == getConfiguredProperty(Constants.ENCLAVE_ATTESTATIONURL)
|| null == getConfiguredProperty(Constants.ENCLAVE_ATTESTATIONPROTOCOL)) {
fail(TestResource.getResource("R_reqExternalSetup"));
}

Expand Down Expand Up @@ -1858,8 +1858,8 @@ void testDates(SQLServerStatement stmt, String cekName, String[][] table, Linked
testDate(null, values);

if (isTestEnclave) {
if (null == System.getProperty(Constants.ENCLAVE_ATTESTATIONURL)
|| null == System.getProperty(Constants.ENCLAVE_ATTESTATIONPROTOCOL)) {
if (null == getConfiguredProperty(Constants.ENCLAVE_ATTESTATIONURL)
|| null == getConfiguredProperty(Constants.ENCLAVE_ATTESTATIONPROTOCOL)) {
fail(TestResource.getResource("R_reqExternalSetup"));
}

Expand Down Expand Up @@ -1897,8 +1897,8 @@ void testNumerics(SQLServerStatement stmt, String cekName, String[][] table, Str
testNumeric(null, values2, isNull);

if (isTestEnclave) {
if (null == System.getProperty(Constants.ENCLAVE_ATTESTATIONURL)
|| null == System.getProperty(Constants.ENCLAVE_ATTESTATIONPROTOCOL)) {
if (null == getConfiguredProperty(Constants.ENCLAVE_ATTESTATIONURL)
|| null == getConfiguredProperty(Constants.ENCLAVE_ATTESTATIONPROTOCOL)) {
fail(TestResource.getResource("R_reqExternalSetup"));
}

Expand All @@ -1920,14 +1920,10 @@ public String getAccessToken(String authority, String resource, String scope) {
ClientCredential cred = new ClientCredential(applicationClientID, applicationKey);
Future<AuthenticationResult> future = context.acquireToken(resource, cred, null);
result = future.get();
return result.getAccessToken();
} catch (Exception e) {
e.printStackTrace();
return null;
fail(TestResource.getResource("R_unexpectedException") + e.getMessage());
}

// return null;
return result.getAccessToken();
}
};

}
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ private static void isSqlAzureOrAzureDW(Connection con) throws SQLException {
* @param key
* @return property value
*/
private static String getConfiguredProperty(String key) {
protected static String getConfiguredProperty(String key) {
String value = System.getProperty(key);

if (null == value && null != configProperties) {
Expand Down

0 comments on commit 05c2fe3

Please sign in to comment.