diff --git a/fhir-database-utils/src/main/java/com/ibm/fhir/database/utils/model/PhysicalDataModel.java b/fhir-database-utils/src/main/java/com/ibm/fhir/database/utils/model/PhysicalDataModel.java index cc306a142fa..f5b8dd3793d 100644 --- a/fhir-database-utils/src/main/java/com/ibm/fhir/database/utils/model/PhysicalDataModel.java +++ b/fhir-database-utils/src/main/java/com/ibm/fhir/database/utils/model/PhysicalDataModel.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019 + * (C) Copyright IBM Corp. 2019, 2020 * * SPDX-License-Identifier: Apache-2.0 */ @@ -53,7 +53,7 @@ public class PhysicalDataModel implements IDataModel { * Default constructor. No federated models */ public PhysicalDataModel() { - + // No Operation } /** @@ -403,5 +403,4 @@ public void applyGrants(IDatabaseAdapter target, String groupName, String userna obj.grant(target, groupName, username); } } - -} +} \ No newline at end of file diff --git a/fhir-persistence-schema/src/main/java/com/ibm/fhir/schema/app/processor/SchemaUtil.java b/fhir-persistence-schema/src/main/java/com/ibm/fhir/schema/app/processor/SchemaUtil.java index e725d11c868..be5f288c6c6 100644 --- a/fhir-persistence-schema/src/main/java/com/ibm/fhir/schema/app/processor/SchemaUtil.java +++ b/fhir-persistence-schema/src/main/java/com/ibm/fhir/schema/app/processor/SchemaUtil.java @@ -44,9 +44,13 @@ public static void logClasspath() { if (logger.isLoggable(Level.FINE)) { logger.fine("CLASSPATH: "); ClassLoader cl = ClassLoader.getSystemClassLoader(); - URL[] classpath = ((URLClassLoader) cl).getURLs(); - for (URL u : classpath) { - logger.fine(" " + u.getFile()); + if (cl instanceof URLClassLoader) { + URL[] classpath = ((URLClassLoader) cl).getURLs(); + for (URL u : classpath) { + logger.fine(" " + u.getFile()); + } + } else { + logger.fine(" " + System.getProperty("java.class.path")); } } } diff --git a/fhir-persistence-schema/src/main/java/com/ibm/fhir/schema/app/processor/action/GrantPrivilegesAction.java b/fhir-persistence-schema/src/main/java/com/ibm/fhir/schema/app/processor/action/GrantPrivilegesAction.java index 7c9423e386f..a81b35c461b 100644 --- a/fhir-persistence-schema/src/main/java/com/ibm/fhir/schema/app/processor/action/GrantPrivilegesAction.java +++ b/fhir-persistence-schema/src/main/java/com/ibm/fhir/schema/app/processor/action/GrantPrivilegesAction.java @@ -16,7 +16,6 @@ import com.ibm.fhir.schema.control.FhirSchemaGenerator; public class GrantPrivilegesAction implements ISchemaAction { - public GrantPrivilegesAction() { // No Operation } diff --git a/fhir-persistence-schema/src/main/java/com/ibm/fhir/schema/app/processor/action/UpdateSchemaAction.java b/fhir-persistence-schema/src/main/java/com/ibm/fhir/schema/app/processor/action/UpdateSchemaAction.java index f5afa6ef986..caa3f8bd662 100644 --- a/fhir-persistence-schema/src/main/java/com/ibm/fhir/schema/app/processor/action/UpdateSchemaAction.java +++ b/fhir-persistence-schema/src/main/java/com/ibm/fhir/schema/app/processor/action/UpdateSchemaAction.java @@ -19,14 +19,13 @@ import com.ibm.fhir.task.core.service.TaskService; /** - * --prop-file /Users/paulbastide/git/wffh/FHIR/fhir-persistence-schema/db2.properties + * --prop-file /fhir-persistence-schema/db2.properties --pool-size 2 --schema-name FHIRDATA --update-schema --dry-run */ public class UpdateSchemaAction implements ISchemaAction { - public UpdateSchemaAction() { // No Operation } diff --git a/fhir-persistence-schema/src/main/java/com/ibm/fhir/schema/control/FhirSchemaConstants.java b/fhir-persistence-schema/src/main/java/com/ibm/fhir/schema/control/FhirSchemaConstants.java index 7cf5d0bfdd3..eb585571016 100644 --- a/fhir-persistence-schema/src/main/java/com/ibm/fhir/schema/control/FhirSchemaConstants.java +++ b/fhir-persistence-schema/src/main/java/com/ibm/fhir/schema/control/FhirSchemaConstants.java @@ -10,11 +10,6 @@ * Constants related to Schema creation and updating. */ public class FhirSchemaConstants { - - private FhirSchemaConstants() { - // No Operation - } - // Standard connection/thread pool size public static final int DEFAULT_POOL_SIZE = 80; @@ -119,4 +114,8 @@ private FhirSchemaConstants() { // Initial partition range values for table create public static final int PART_LOWER = 0; public static final int PART_UPPER = 0; + + private FhirSchemaConstants() { + // No Operation + } } \ No newline at end of file diff --git a/fhir-persistence-schema/src/test/java/com/ibm/fhir/schema/app/processor/action/GrantPrivelegesActionTest.java b/fhir-persistence-schema/src/test/java/com/ibm/fhir/schema/app/processor/action/GrantPrivelegesActionTest.java new file mode 100644 index 00000000000..1dc91ca3b9d --- /dev/null +++ b/fhir-persistence-schema/src/test/java/com/ibm/fhir/schema/app/processor/action/GrantPrivelegesActionTest.java @@ -0,0 +1,34 @@ +/* + * (C) Copyright IBM Corp. 2020 + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.ibm.fhir.schema.app.processor.action; + +import static org.testng.Assert.assertNotNull; + +import org.testng.annotations.Test; + +import com.ibm.fhir.database.utils.api.IDatabaseAdapter; +import com.ibm.fhir.database.utils.api.ITransactionProvider; +import com.ibm.fhir.schema.app.processor.action.bean.ActionBean; +import com.ibm.fhir.schema.app.processor.action.exceptions.SchemaActionException; + +/** + * GrantPrivilegesAction Test + */ +public class GrantPrivelegesActionTest { + @Test + public void testGrantPrivilegesAction() throws SchemaActionException { + ActionBean actionBean = new ActionBean(); + actionBean.setTenantId(1); + actionBean.setAdminSchemaName("ADMIN_SCHEMA"); + actionBean.setSchemaName("FHIR_SCHEMA"); + IDatabaseAdapter adapter = DatabaseSupport.generateMapAdapter(null); //DatabaseSupport.generateUndefinedName() + ITransactionProvider transactionProvider = DatabaseSupport.generateTransactionProvider(); + GrantPrivilegesAction action = new GrantPrivilegesAction(); + action.run(actionBean, null, adapter, transactionProvider); + assertNotNull(actionBean.getAdminSchemaName()); + } +} \ No newline at end of file diff --git a/fhir-persistence-schema/src/test/java/com/ibm/fhir/schema/app/processor/action/UpdateTenantStatusActionTest.java b/fhir-persistence-schema/src/test/java/com/ibm/fhir/schema/app/processor/action/UpdateTenantStatusActionTest.java index 9aeafceeb8f..4ef81244e5d 100644 --- a/fhir-persistence-schema/src/test/java/com/ibm/fhir/schema/app/processor/action/UpdateTenantStatusActionTest.java +++ b/fhir-persistence-schema/src/test/java/com/ibm/fhir/schema/app/processor/action/UpdateTenantStatusActionTest.java @@ -16,7 +16,7 @@ import com.ibm.fhir.schema.app.processor.action.exceptions.SchemaActionException; /** - * AddTenantKeyAction Test + * UpdateTenantStatusAction Test */ public class UpdateTenantStatusActionTest { @Test