Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trunk 3142 #40

Closed
wants to merge 3 commits into from
Closed

Trunk 3142 #40

wants to merge 3 commits into from

Conversation

esudharaka
Copy link
Contributor

Fixed the ReportSchemaXmlTest. Tested with both jdk 6 and jdk 7

@bwolfe
Copy link
Member

bwolfe commented Sep 28, 2012

This is a strange fix. What is the id returned? Why is it not "2" ?

@djazayeri
Copy link
Member

I would point out that ReportSchemaXml has been deprecated for several versions already, and to the best of our knowledge nobody is using it in production.

I would prefer to just @ignore the test, or even remove it, if we don't understand what it's doing.

@esudharaka
Copy link
Contributor Author

If we look at the ReportSchemaXml domain class it has two methods to access its primary key (id). getReportSchemaId() and getId() method. When we ask the service to save the object, it assigns this id attribute through hibernate while persisting the object.
So when it execute following code snippet we can retrieve the exact object we saved previously.

rs.saveReportSchemaXml(reportSchemaXml);
ReportSchemaXml reportSchemaXmlFromDB = rs.getReportSchemaXml(reportSchemaXml.getId());

Problem with jdk7 was it cannot retrieved the ReportSchemaXml through the hard coded id.

ReportSchemaXml reportSchemaXmlFromDB = rs.getReportSchemaXml(2);

Here we dont get any ReportSchemaXml since at that time it has only one object in memory data base which has the id 1. Actually here what we want is to retrieve the exact domain object we saved or update early. And we can do it using the object id as shown in above code snippet.

@bwolfe
Ops..putting it as 2 is a mistake. Sorry for that. Initially what I thought is to remove that reportSchemaXmlJodion variable since it has not tested.

// Get an extra object with the same id just to mess things up.
ReportSchemaXml reportSchemaXmlJodion = rs.getReportSchemaXml(2);
ReportSchemaXml reportSchemaXmlJodion = rs.getReportSchemaXml(1);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry. This is a mistake i made. And simple we can remove this since no assert is done for this.

@bwolfe
Copy link
Member

bwolfe commented Oct 1, 2012

I agree with darius that we might just @ignore this instead of giving some strange fix.

@esudharaka, can you debug the test on jdk7 and see what reportSchemaXml.getId() is returning? Why is it returning 1 in my jdk6 environment but 2 in jdk7?

@dkayiwa
Copy link
Member

dkayiwa commented Jan 23, 2014

Closing because author abandoned it.

@dkayiwa dkayiwa closed this Jan 23, 2014
slubwama pushed a commit to slubwama/openmrs-core that referenced this pull request Apr 6, 2022
Added toast messages on page to return process feedback from the server, checking whether encounter already has VL entered to avoid upload errors,Formatted dates to ensure right encounters are returned
RandilaP pushed a commit to RandilaP/openmrs-core that referenced this pull request Jul 31, 2023
Bumps [websocket-extensions](https://github.com/faye/websocket-extensions-node) from 0.1.3 to 0.1.4.
- [Release notes](https://github.com/faye/websocket-extensions-node/releases)
- [Changelog](https://github.com/faye/websocket-extensions-node/blob/master/CHANGELOG.md)
- [Commits](faye/websocket-extensions-node@0.1.3...0.1.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
RandilaP pushed a commit to RandilaP/openmrs-core that referenced this pull request Jul 31, 2023
* Initial commit

* Change name to esm-module-config

* Get config module minimally working per MF-52

* Switch to typescript

* Add travis config

* Tree-shake Ramda

* Install husky

* Format; switch husky to concurrent run

* Reorganize files

* Fix build

* MF-87 Config library should support nested config properties (openmrs#3)

https://issues.openmrs.org/browse/MF-87

* MF-74  Config library should import default config file using import-map (openmrs#2)

* Import config.json from import map working. Jest failing. 404s print to console.

* Fix tests

* Do lookup per Joel's advice -- much better error handling

* Get tests working; put config-file resolution into a function; weird eslint error?

* Fixing build

* Upgrading dependencies

* Fixing license and Travis deployment (openmrs#4)

* Fixing license and Travis deployment

* Self review

* React hooks for MF-74 Config file from import-map (openmrs#5)

* Get started. typescript failing with very verbose react type problems

* Review feedback

* WIP

* Get things kinda-sorta working using config as global variable. useState is causing infinite recursion.

* Feedback

* Feedback

* Link to documentation in the readme

* Setting webpack jsonpFunction (openmrs#9)

* The rest of React hooks for MF-74 Config file from import-map (openmrs#6)

* Get things probably working

* Remove cruft

* Remove cruft; fix undefined check

* Update src/react-hook/react-hook.tsx

Co-Authored-By: Joel Denning <joeldenning@gmail.com>

* Revert test changes back to more comfortable syntax; fix type error

* Use async/await, not then

* 1.1.0

* MF-119: useConfig support for multiple modules (openmrs#10)

* MF-110: useConfig now supports being called from multiple modules

* Self review

* MF-53  Config library should validate String value (openmrs#8)

* Add validators

* Add isBoolean and isString validators

* Simplify validation system

* Revert "Simplify validation system"

This reverts commit 4a93ad45f4eff974e3315b04573a0293a49d8436.

* Simplify validator functions

* MF-102 useConfig goes into infinite loop when invalid config is provided (openmrs#7)

* MF-102 useConfig goes into infinite loop when invalid config is provided

https://issues.openmrs.org/browse/MF-102

* 1.1.1

* Bump handlebars from 4.2.0 to 4.5.3 (openmrs#11)

Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.2.0 to 4.5.3.
- [Release notes](https://github.com/wycats/handlebars.js/releases)
- [Changelog](https://github.com/wycats/handlebars.js/blob/master/release-notes.md)
- [Commits](handlebars-lang/handlebars.js@v4.2.0...v4.5.3)

Signed-off-by: dependabot[bot] <support@github.com>

* Log errors when modules define schemas incorrectly (openmrs#12)

* Throw errors when modules define schemas incorrectly

* Just log error instead of throwing

* Copy

* Minimal array support (openmrs#13)

* Arrays should support element-wise validation (openmrs#14)

* Validating structure of array object elements (openmrs#15)

* Array object validation (openmrs#16)

* 1.2.0

* Clean and refactor; some minor changes to error messages (openmrs#17)

* Security updates (openmrs#20)

* Add function to output to Dev Tools (openmrs#19)

* Fixed bug where multiple configs introduces undefined in the merged configs for a certain module (openmrs#18)

* Fixed bug where imported configs via systemjs contains undefined entries

* Added test-case to reproduce the bug that occurs

* Narrowed down on the issue

* Should be able to interpolate array element objects with defaults (openmrs#21)

* Should be able to interpolate array element objects with defaults

MF-98 Config library should support arrays of config objects

* Tidy

* 1.3.0

* Revert "Should be able to interpolate array element objects with defaults (openmrs#21)" (openmrs#24)

This reverts commit 9746789.

Co-authored-by: Fatma Ali <alifatma2019@gmail.com>

* 1.3.1

* Bump acorn from 5.7.3 to 5.7.4 (openmrs#26)

Bumps [acorn](https://github.com/acornjs/acorn) from 5.7.3 to 5.7.4.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](acornjs/acorn@5.7.3...5.7.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Attempt openmrs#2 at "Should be able to interpolate array element objects with defaults (openmrs#21)" (openmrs#25)

Original was 9746789. Validators were
mishandled. Added validators to the test and fixed.

* Simplify multiple provides test (openmrs#28)

* Verify that entire array objects can be validated (openmrs#27)

* Updates and prettier (openmrs#30)

* Shouldn't crash app on invalid configs (openmrs#29)

* Shouldn't crash app on invalid configs

* Prettier

* Should recognize 'description' key (openmrs#31)

* BREAKING: imported config-file should take priority over provided configs (openmrs#32)

* Update README.md (openmrs#33)

* Update README.md

* Update README.md

* Add npm badge (openmrs#34)

* MF-220 upgrade vulnerable dependencies (openmrs#35)

* Skip validation (openmrs#36)

* Added ability to skip validations

* skips validations for arrays

* fixed prettier issues

* exposing of validation method

* Added ability to support validation of dictionaries (openmrs#37)

* Added ability to support validation of dictionaries

* Fixed prettier issues

* responding to reviews

* Added missing types

* Dictionary skip validations (openmrs#39)

* Added ability to skip validations for dictionary

* mis-spelt skipValidations

* Bump websocket-extensions from 0.1.3 to 0.1.4 (openmrs#40)

Bumps [websocket-extensions](https://github.com/faye/websocket-extensions-node) from 0.1.3 to 0.1.4.
- [Release notes](https://github.com/faye/websocket-extensions-node/releases)
- [Changelog](https://github.com/faye/websocket-extensions-node/blob/master/CHANGELOG.md)
- [Commits](faye/websocket-extensions-node@0.1.3...0.1.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Remove skipValidation, which has no valid use case as of yet (openmrs#41)

* Add isUuid validator (openmrs#42)

* Add isUuid

* Fix CIEL external ID validation

* Add bad CIEL External ID example

* Add support for processConfig (openmrs#43)

* Add typedoc (openmrs#45)

* Get started with typedoc

* Get typedoc working beautifully

* Add husky hook

* Switch to an API embedded directly in the README

* hook test

* Fixup

* Undo JS autoformatting

* Undo JS autoformatting again

* Fix bug where generated API docs keep growing (openmrs#46)

* Add generated TOC to README (openmrs#47)

* MF:249 Fixed error while importing config.js from frontend directory (openmrs#48)

* Update README.md

* Add support for freeform objects (openmrs#49)

* 1.4.0

* 2.0.0

* MF-178: ConfigurableLink in module-config (openmrs#38)

* MF-178 ConfigurableLink in module-config -- part 1, navigate()

* Implement navigate

* Implement ConfigurableLink -- tests not working

* Fix out of date comment

* Fixup

* Finish ConfigurableLink implementation

* Fix API doc links to always refer to master (openmrs#50)

* Fix API doc links to always refer to master

* Pin typedoc version for 'library' mode support

* Add a test, add documentation, actually export navigation components (openmrs#51)

* Expose interpolateString; add validators for URL templates (openmrs#52)

* 2.1.0

* Fix navigate to handle SPA routes correctly (openmrs#53)

* Fix navigate to handle SPA routes correctly

* Fix navigate to handle SPA routes correctly

* 2.1.1

* Introduce isNumber validator (openmrs#55)

* 2.2.0

* Bump lodash from 4.17.15 to 4.17.19 (openmrs#56)

Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](lodash/lodash@4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add devDefault keyword, toggled on window.openmrsConfigUseDevDefaults (openmrs#57)

* Dev toggle should use localStorage, not window (openmrs#58)

* All validators should reject undefined (openmrs#59)

* MF-309 Add support for a temporary config in localStorage (openmrs#60)

* MF-309 Add support for a temporary config in localStorage

* Add more schema validation

* Schema validation should allow arrayElements to have keys without defaults (openmrs#61)

* Adapt esm-config to lerna repo

Co-authored-by: Joel Denning <joeldenning@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nicky Kibor Kimaina <nkimaina@ampath.or.ke>
Co-authored-by: Jonathan Dick <jdick@ampath.or.ke>
Co-authored-by: Fatma Ali <alifatma2019@gmail.com>
Co-authored-by: Ramakrishnan Kandasamy <38713281+rmkanda@users.noreply.github.com>
Co-authored-by: Donald Kibet <chelashawdonald@yahoo.com>
Co-authored-by: Mritunjay Dubey <mddubey409@gmail.com>
RandilaP pushed a commit to RandilaP/openmrs-core that referenced this pull request Jul 31, 2023
RandilaP pushed a commit to RandilaP/openmrs-core that referenced this pull request Jul 31, 2023
This reverts commit 89ae255.

This was causing `openmrs` to fail to compile due to CSS loader
problems.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants