Hello Folks
i have encounter unusual behaviors while testing the role package in the database and these are as follows;
- Padded Values in Database for system_role
When inserting strings likeclinlims.system_role.name
, they were being stored as<results[ ]>
(with spaces) instead of < results > . Now this comes about When you insert a value shorter thann
, it pads the remaining space with spaces due to the fact thename
field is stored aschar(30)
and you can see below:
CREATE TABLE clinlims.system_role ( id numeric(10,0) NOT NULL, name character (30) NOT NULL, description character varying(80), is_grouping_role boolean DEFAULT false, grouping_parent numeric(10,0), display_key character varying(60), active boolean DEFAULT true, editable boolean DEFAULT false
);
now to fix this we can add varying
to the name character varying(30) NOT NULL
but that won’t be consistant with the liqubase file which causes liquibase exceptions causing Liquibase Migration Failure so it this means the type changed in the OpenELIS-Global.sql
has to be reflected in the liquibase file concerning this database table which i can’t quite locate at the moment.
-
DBUnit Boolean Mapping Error
DBUnit tests failed while processing thesystem_role
table, especially theactive
column. the DBUnit passes integersactive="1"
andactive="0"
in the test dataset, but the column is of typeBOOLEAN
as shown in the code block above. Cc. add Role Integration test by josephbate · Pull Request #1925 · DIGI-UW/OpenELIS-Global-2 · GitHub
as you can see in therole.xml
i have opted for intergers for this column though i still think in it might be a configuration issue, haven’t quite known where exactly the problem is. -
according to the code block above the column
grouping_parent
is created but the dbunit doesn’t seem to find the column, and throws aorg.dbunit.DatabaseUnitException: Exception processing table name='system_role'
this makes it hard to testRoleService.getReferencingRoles
here also ive failed to find where exactly this occurscoz according to theOpenELIS-Global.sql
it checks out fine.
still snooping around trying to find a cause and also possible solutions but any dea on this or possible solutions or insights are welcome