1. Deployment projects
  2. Deploy Trunk Nightly
  3. Releases

Release: openmrs-trunk-1910

INCOMPLETE
Deploys nightly Demo and publishes nightly to sourceforge

Commits

Comparison is available only for releases created from the same branch as this release.

This release
Author Commit Message Commit date
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> 3a8da742cef130c997e1f430a8638d35f20192fb Show ModuleFileParser allows empty conditionalResource elements
the ModuleFileParser currently allows

<conditionalResource>
</conditionalResource>

which leads to a ModuleConditionalResource which has no path and no
version. This also shows that the ModuleConditionalResource is flawed
since it only has a default constructor which leads to a state that
should not be allowed
Ivo Ulrich <teleivo@users.noreply.github.com> Ivo Ulrich <teleivo@users.noreply.github.com> f773bb911f806f9667ba3b7071796a096a09ee8f Merge pull request #2644 from teleivo/TRUNK-5385
TRUNK-5385 Use try-with-resource and remove duplication in ModuleFileParser
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> fcf28d56d0a9484bf57f78b381744994aea39660 TRUNK-5385 Fix ModuleFileParser test parsing GP without description
it does not get ignored
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> d0822eb753009531d181ada9166ff9962f522a83 TRUNK-5385 Harmonize method parameter order
put Element first in extractModulesWithVersionAttribute as all other
methods which take more than one parameter with on of them of type Element
have it first
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> 2683d61b35c8f43441b6e67ff01ba9739b5e01a0 TRUNK-5385 Harmonize extractConditionalResource tests
move tests for extractConditionalResource into ModuleFileParserTest to
use same style of tests against the public methods instead of package
private one to prepare making it private

after refactorings where dependencies of ModuleFileParser will be put
into its constructor ModuleFileParser(MessageSourceService), the tests
can be written as BaseContextMockTests without use of a database
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> 9cf26f9713f85cf83fc1694c87bc0941ade268c8 TRUNK-5385 Move extractConditionalResources in call order
since its called after extractMandatory move it below it
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> b9cdc8aac0354cd0690a125ed111e2565d98fe4e TRUNK-5385 Rename rootNode to configRoot
to signal that the root is the root element of the module config which
might be obvious but its still easier to read and no need to always make
the mental connection
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> 26be20d520a603ffec8078166c90cf62dd253ff9 TRUNK-5385 Debug log global property with format string
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> 32ccdb01e0a78549eaa403760e93ba9234f1d2d8 TRUNK-5385 Refactor extracting advice
using the same pattern
* reduce nesting with a guard clause
* rely on getElementsByTag which returns actual Element
we are looking for
* use helper getElementTrimmed to hide getting element, defaulting to
empty string if not present, trimming it
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> 412aff620af27b2c718671381bc75c5f17490428 TRUNK-5385 Rely on Element in getModuleToVersionMap
when using getElementsByTagName we know we get Element's and can thus
cast and simplify code because we know we only get 'modules' or 'module'
Element's

reduce nesting with a guard clause at the beginning of the method
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> 52c2c4fbc90cc694e2a20206d351a1f5dee4ba46 TRUNK-5385 Extract constants for module file extension
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> c7f7c640e6e1e6980c3a6585d215c806ca69d2ad TRUNK-5385 Extract createGlobalPropertyWithDatatype
to hide details of how the GP is created when datatypeClassname is not
empty
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> 5552fb757d787c922e9fdb7678446caeb56b4558 TRUNK-5385 Harmonize method names extracting from xml
to be called extractGlobalProperties, extractConditionalResources
and group them together in createModule
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> ee9d65eb57ba76dc172651a8c56269526da8b3ec TRUNK-5385 Refactor extracting extension and privilege
using the same pattern
* reduce nesting with a guard clause
* rely on getElementsByTag which returns actual Element
we are looking for
* use helper getElementTrimmed to hide getting element, defaulting to
empty string if not present, trimming it
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> c31a88b0e3ed09dbdd18ed25f5b8e5916afba9e1 TRUNK-5385 Use junit ExpectedException in ModuleFileParserUnitTest
expecting on the substring of the exception messages links the test more
to its particular case. Since all 3 tests expect the same Exception it
would not surface if they test the same case, which already happened in
another class.
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> 907e5c939acbfa7cda2bc6253f37665d86967fda TRUNK-5385 Remove nesting when reading globalProperties
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> 3c380e37c5ac4823d6317062a0201a922449bd97 TRUNK-5385 Use Element when extracting globalProperty
getElementsByTagName returns type Node but they are all Element's
since we look for <globalProperty>, thus cast to Element

this enables us to only get child Element's we need without the need to
loop through all Node's
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> 18ae159d7f5b5cca0274ca578922d8bd06f48b8c TRUNK-5385 Extract removeTabsAndTrim
so we can simply wrap the string returned from getElementTrimmed and
clean it from tabs. The returned string from getElementTrimmed is never
null so no need to check. also added test to assert we can handle it.
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> 2157ed7290f965249b209a8d912de33305495cdf TRUNK-5385 Make guard clause for empty property
this makes it easier to read that we exit if <globalProperty> doesnt
have a <property> child with a value
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> 2dc4fef47acd113d5f1276436bd49ccb3618a710 TRUNK-5385 Extract extractGlobalProperty
for readability and further refactoring
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> 02eee464483404ccd24d055b366b56f7b64b9d87 TRUNK-5385 Test that globalProperty text nodes are ignored
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> 176d80a33d49a0879dda378db1b0b387d4f7d37c TRUNK-5385 Debug log globalProperty using format strings
no need to do string concatenation
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> 32078b52337af9521071c9f8b56c5cb48e001969 TRUNK-5385 Rename getGlobalProperties
to extractGlobalProperties to separate it from a normal getter
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> 3dce1b6be819e4b3753b4df8e29e676ecb92c3de TRUNK-5385 Extract method for creating GlobalProperty
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> 30850f4ee5d2bdc57865cd5de5022c240e4af10e TRUNK-5385 Use try-with-resource in ModuleFileParser(InputStream)
to auto close the OutputStream where the InputStream is written to
and extract private methods to improve readability
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> 01447bea4e6419822ab5fe3a62b920c9a990c1ef TRUNK-5385 Extract ensureNonEmptyId/Package
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> 57bef02a04c8adbfcfae3cdfa9f2c45b2333f38c TRUNK-5385 Extract validateConfigVersion method
to increase readability of method, we do not need to read the details of
it when just looking at the creation of an instance of Module
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> c01de3763eadb8eb88e3be85fe312de82ab64a0b TRUNK-5385 Add test parsing invalid module config.xml
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> 602ec1c998d99abb24a1f1b69939bc4397d0acb9 TRUNK-5385 Rename config variable
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> 8a52e4caf5674db9e9be66c2eed89e612677c34b TRUNK-5385 Use try-with-resource on config xml InputStream
move getting the inputstream of the config jarentry into a
try-with-resource block since the InputStream is autocloseable the
stream will be closed for us and the closing logic in the finally can be
removed
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> ca69a25e3d2139e7127997f2beda7d5795fb3fc3 TRUNK-5385 Use try-with-resource on JarFile
since its Autoclosable we can remove our finally closing logic and let
the try-with-resource do it
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> 0ffad4d32b4803de3a88991ec372e72dca5dfe2c TRUNK-5385 fix formatting in ModuleFileParserTest
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> 883dbca33d01c705843a5d4b43f6f109e23c1aff TRUNK-5385 Extract creation of module from document
method is concerned with creating an instance of Module
with values from the config xml Document
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> 85ebfed8a89bc046fca9293526b6ed894b5189b6 TRUNK-5385 Declare module when created
declare the variable when its used
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> bff76ca17879db934f92e89cbaea602f6a86c5fc TRUNK-5385 Remove unused parameters from ModuleFileParser's private methods
configVersion and jarFile were often not used in private methods
thus now removed
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> d5ce10de6ac0b6f5fd412fa9e129703de42b171d TRUNK-5385 Rearrange ModuleFileParser fields
and remove unnecessary set to null
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> c415bc53bd4bbea3da51221345137f8df76eb07b TRUNK-5385 Remove duplication in getting an element or fail
extract duplicate code into method
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> 2b18ed7d586215fc1588b150de242a0394b1a3dd TRUNK-5385 Extract method getElementTrimmed
since its often done
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> 45bfb42e398bb566250b58269567147a0bafd1cc TRUNK-5385 Group getElement helpers together
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> 30563c00b1ad385cb1c28d2fd95134ad981d549e TRUNK-5385 Extract newDocumentBuilder
to keep level of abstraction in parseConfigXmlStream
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> 30d2061035af09a9f5bb4d5eb2ea9cfc0db2f399 TRUNK-5385 Extract duplicate code which splits TagContentByWhitespace
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> 55a6c06ba5335dff4993889481d7e324829f06d3 TRUNK-5385 Use try-with-resource on ByteArrayOutputStream
to remove finally close() logic
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> a64d6f172c56656a579b58b34f6d3f0cb9792e68 TRUNK-5385 Rename configDoc to config
we know its a Document from its type
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> f9e69f6468b3d669d221bb7520a3a2b2923a8f75 TRUNK-5385 Move creation of Module outside of config jar/stream logic
getting the jarfile, jarentry for config.xml and parsing the config
stream into an xml document is separate from creating the module from
the xml document thus move the creation below it
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> 907a8d303ec68433a0be14744b34570055e6ecfd TRUNK-5385 Test ModuleFileParser(InputStream)
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> 8f27752402c29b9a61c298969e6273531281f9ce TRUNK-5385 Extract ensureValidConfigVersion
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> ff81902c6797b298b9e358b37428e32f82a7a30a TRUNK-5385 Extract getting the xml config document into helper
and rearrange private methods in call order for readability
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> 2800a1ca15090cc66bcd22f159a85537aecda8e1 TRUNK-5385 Extract constant for module config.xml filename
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> f512bcdd964e64ef4c8159e1880baea5c042f29b TRUNK-5385 Extract parsing of stream to xml document
to reduce the method size and move the same level of abstraction into a
method, also a step to prepare the use of try-with-resource
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> 75c0970e867987aebf388b8dfe1d8aefe77f453d TRUNK-5385 Extract ensureNonEmptyName
so createModule simply reads as getXXXElementsContent and module.setXXX
if ones concerned with details, dig deeper into helper methods
teleivo <mrteleivo@gmail.com> teleivo <mrteleivo@gmail.com> 0a091ddceb91fa2086ad8c4b0958d6daef6f8a73 TRUNK-5385 Extract getting zip entry and stream of config.xml