Skip to content

Commit

Permalink
Improve the fhir-persitence-schema #380, #270
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Bastide <pbastide@us.ibm.com>
  • Loading branch information
prb112 committed Jan 29, 2020
1 parent e04f2d0 commit b52b381
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2019
* (C) Copyright IBM Corp. 2019, 2020
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -53,7 +53,7 @@ public class PhysicalDataModel implements IDataModel {
* Default constructor. No federated models
*/
public PhysicalDataModel() {

// No Operation
}

/**
Expand Down Expand Up @@ -403,5 +403,4 @@ public void applyGrants(IDatabaseAdapter target, String groupName, String userna
obj.grant(target, groupName, username);
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import com.ibm.fhir.schema.control.FhirSchemaGenerator;

public class GrantPrivilegesAction implements ISchemaAction {

public GrantPrivilegesAction() {
// No Operation
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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
}
}
Original file line number Diff line number Diff line change
@@ -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());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import com.ibm.fhir.schema.app.processor.action.exceptions.SchemaActionException;

/**
* AddTenantKeyAction Test
* UpdateTenantStatusAction Test
*/
public class UpdateTenantStatusActionTest {
@Test
Expand Down

0 comments on commit b52b381

Please sign in to comment.