Re: adding dependencies on h2 and mockito
Sorry this got a bit burried because it was sent under the "h2 and mockito dependencies" topic. I think vsdump is used for .vsd files (old binary format), not for .vsdx files. New newer format is actually a zip-file, so you can open it with a zip-utility and look at the files in there. We have a utility OOXMLPrettyPrint in the POI sources which can reformat the XML files in the .vsdx so that they are easier to read. For useful tests, I think it would be best to focus on the overall reading/writing of data at first, e.g. start with a test for XDGFDocument to ensure the code can properly open and write documents. Then XDGFSheet is the next class which provides basic functionality and the actual contents of the Visio document like cells, sections and stylesheets. Having useful tests for those two would be a good start already! Dominik. On Sun, Jan 28, 2018 at 7:21 PM, leebanga lee wrote: > Hi Dominik, > > From what I can see within the xdgf package there are two tests. I also > observed that mocks are not used within the project. > I was unable to get vsdump program in order to check the structure of the > sample file "test_text_extraction.vsdx". How can get it ? I have been able > to run the tests and they both passed but I am unable to find one of the > text that was used in the assertion. I also want to ask about the scope of > what has been done in order not to write test aimlessly. I think it would > be better to write test for the usecases that has been considered for > development till date. > > Regards, > Lukman. > > > > On Fri, Jan 26, 2018 at 1:06 PM, Murphy, Mark > wrote: > > > Could the functionality be written to use H2 if it exists in the > > classpath, but stick with the current process if it does not? > > > > -Original Message- > > From: Dominik Stadler [mailto:dominik.stad...@gmx.at] > > Sent: Friday, January 26, 2018 5:10 AM > > To: POI Developers List > > Subject: Re: adding dependencies on h2 and mockito > > > > Hi, > > > > Mockito for testing is fine for me, H2 as requirement for everybody > sounds > > a bit heavy, would we still keep it optional unless somebody actually > uses > > this functionality? I.e. if you have Maven/Gradle dependencies it > wouldn't > > be dragged in by default? > > > > Thanks... Dominik. > > > > On Fri, Jan 26, 2018 at 9:03 AM, pj.fanning wrote: > > > > > Are there any objections to me adding dependencies on h2 jar > > > dependency for > > > https://github.com/apache/poi/pull/85 and a test dependency on > mockito? > > > I think mockito would be useful for allowing us to test edge cases. > > > An example is https://svn.apache.org/viewvc? > > > view=revision&revision=1822253 > > > where creating an XSLFTextRun with a null Font Size is not > > straightforward. > > > With mockito, it is very easy to produce such an instance. > > > > > > > > > > > > -- > > > Sent from: > > > http://apache-poi.1045710.n5.nabble.com/POI-Dev-f2312866.html > > > > > > - > > > To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org For additional > > > commands, e-mail: dev-h...@poi.apache.org > > > > > > > > >
Re: adding dependencies on h2 and mockito
Hi Dominik, >From what I can see within the xdgf package there are two tests. I also observed that mocks are not used within the project. I was unable to get vsdump program in order to check the structure of the sample file "test_text_extraction.vsdx". How can get it ? I have been able to run the tests and they both passed but I am unable to find one of the text that was used in the assertion. I also want to ask about the scope of what has been done in order not to write test aimlessly. I think it would be better to write test for the usecases that has been considered for development till date. Regards, Lukman. On Fri, Jan 26, 2018 at 1:06 PM, Murphy, Mark wrote: > Could the functionality be written to use H2 if it exists in the > classpath, but stick with the current process if it does not? > > -Original Message- > From: Dominik Stadler [mailto:dominik.stad...@gmx.at] > Sent: Friday, January 26, 2018 5:10 AM > To: POI Developers List > Subject: Re: adding dependencies on h2 and mockito > > Hi, > > Mockito for testing is fine for me, H2 as requirement for everybody sounds > a bit heavy, would we still keep it optional unless somebody actually uses > this functionality? I.e. if you have Maven/Gradle dependencies it wouldn't > be dragged in by default? > > Thanks... Dominik. > > On Fri, Jan 26, 2018 at 9:03 AM, pj.fanning wrote: > > > Are there any objections to me adding dependencies on h2 jar > > dependency for > > https://github.com/apache/poi/pull/85 and a test dependency on mockito? > > I think mockito would be useful for allowing us to test edge cases. > > An example is https://svn.apache.org/viewvc? > > view=revision&revision=1822253 > > where creating an XSLFTextRun with a null Font Size is not > straightforward. > > With mockito, it is very easy to produce such an instance. > > > > > > > > -- > > Sent from: > > http://apache-poi.1045710.n5.nabble.com/POI-Dev-f2312866.html > > > > - > > To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org For additional > > commands, e-mail: dev-h...@poi.apache.org > > > > >
Re: ***UNCHECKED*** RE: adding dependencies on h2 and mockito
If the goal is to allow for a very large shared strings hashtable, perhaps a lighter weight option like MapDB [1][2] is a better fit? It's JAR is only 700K, and it looks quite reasonably featured (has an implementation of HashMap) and flexible in its configuration for trading memory/performance/scalability, including mmapped files and some level of on-disk encryption [3]. [1] https://jankotek.gitbooks.io/mapdb/content/ [2] https://github.com/jankotek/mapdb/ [3] https://jankotek.gitbooks.io/mapdb/content/format/ On Fri, Jan 26, 2018 at 1:23 PM Dave Fisher wrote: > Hi - > > We need to be really careful not to make OOXML deployments larger. > > Why is H2, a database engine, being considered? > > Regards, > Dave > > Sent from my iPhone > > > On Jan 26, 2018, at 11:55 AM, Alain FAGOT BÉAREZ > wrote: > > > > You might have heard of Hypersonic SQL, some 10 years ago. H2 is the > second version thereof. > > > > Gesendet mit BlueMail > > > > > > Originale Nachricht > > Von: Greg Woolsey > > Gesendet: Fri Jan 26 16:42:44 GMT-03:00 2018 > > An: POI Developers List > > Betreff: Re: ***UNCHECKED*** RE: adding dependencies on h2 and mockito > > > > Total dependency size is important to my deployment, and probably others. > > I don't use SXSSF at all, and would not need/want the dependency (which > > I've never heard of in 20 years of database and Java development, which > is > > strange to me, but irrelevant). My preference is to make it optional, > even > > though it's more work to code. Default would be the current behavior, > > which works for almost everyone, apparently, and an option would be to > > enable this behavior and manage the package availability externally. > > > > I suppose one could manually exclude the package as well, if SXSSF isn't > > used at all, since Java wouldn't try to load the classes unless a class > > referencing them was loaded, but that behavior is always subject to > change > > and should not be relied upon. Plus I wouldn't want to impose that on > > existing users who don't need/want it. > > > >> On Fri, Jan 26, 2018 at 4:47 AM pj.fanning wrote: > >> > >> I could make h2 a `provided` dependency in our poi-ooxml pom. > >> The use of h2 is opt-in in the new code in my PR but I'll need to > refactor > >> the code to allow our code not to throw ClassNotFoundException if the h2 > >> classes are not on the runtime classpath. This is do-able but my > concern is > >> that this is difficult to automate tests for (checking the code works > when > >> the h2 jar is available and when it is not). > >> > >> https://mvnrepository.com/artifact/com.h2database/h2 is very common > >> dependency, so my preference would be to have the explicit dependency > from > >> poi-ooxml on h2 - but I'll go with whatever the consensus is. > >> > >> > >> > >> -- > >> Sent from: > http://apache-poi.1045710.n5.nabble.com/POI-Dev-f2312866.html > >> > >> - > >> To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org > >> For additional commands, e-mail: dev-h...@poi.apache.org > >> > >> > > > - > To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org > For additional commands, e-mail: dev-h...@poi.apache.org > >
Re: ***UNCHECKED*** RE: adding dependencies on h2 and mockito
Hi - We need to be really careful not to make OOXML deployments larger. Why is H2, a database engine, being considered? Regards, Dave Sent from my iPhone > On Jan 26, 2018, at 11:55 AM, Alain FAGOT BÉAREZ wrote: > > You might have heard of Hypersonic SQL, some 10 years ago. H2 is the second > version thereof. > > Gesendet mit BlueMail > > > Originale Nachricht > Von: Greg Woolsey > Gesendet: Fri Jan 26 16:42:44 GMT-03:00 2018 > An: POI Developers List > Betreff: Re: ***UNCHECKED*** RE: adding dependencies on h2 and mockito > > Total dependency size is important to my deployment, and probably others. > I don't use SXSSF at all, and would not need/want the dependency (which > I've never heard of in 20 years of database and Java development, which is > strange to me, but irrelevant). My preference is to make it optional, even > though it's more work to code. Default would be the current behavior, > which works for almost everyone, apparently, and an option would be to > enable this behavior and manage the package availability externally. > > I suppose one could manually exclude the package as well, if SXSSF isn't > used at all, since Java wouldn't try to load the classes unless a class > referencing them was loaded, but that behavior is always subject to change > and should not be relied upon. Plus I wouldn't want to impose that on > existing users who don't need/want it. > >> On Fri, Jan 26, 2018 at 4:47 AM pj.fanning wrote: >> >> I could make h2 a `provided` dependency in our poi-ooxml pom. >> The use of h2 is opt-in in the new code in my PR but I'll need to refactor >> the code to allow our code not to throw ClassNotFoundException if the h2 >> classes are not on the runtime classpath. This is do-able but my concern is >> that this is difficult to automate tests for (checking the code works when >> the h2 jar is available and when it is not). >> >> https://mvnrepository.com/artifact/com.h2database/h2 is very common >> dependency, so my preference would be to have the explicit dependency from >> poi-ooxml on h2 - but I'll go with whatever the consensus is. >> >> >> >> -- >> Sent from: http://apache-poi.1045710.n5.nabble.com/POI-Dev-f2312866.html >> >> - >> To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org >> For additional commands, e-mail: dev-h...@poi.apache.org >> >> - To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org For additional commands, e-mail: dev-h...@poi.apache.org
Re: ***UNCHECKED*** RE: adding dependencies on h2 and mockito
You might have heard of Hypersonic SQL, some 10 years ago. H2 is the second version thereof. Gesendet mit BlueMail Originale Nachricht Von: Greg Woolsey Gesendet: Fri Jan 26 16:42:44 GMT-03:00 2018 An: POI Developers List Betreff: Re: ***UNCHECKED*** RE: adding dependencies on h2 and mockito Total dependency size is important to my deployment, and probably others. I don't use SXSSF at all, and would not need/want the dependency (which I've never heard of in 20 years of database and Java development, which is strange to me, but irrelevant). My preference is to make it optional, even though it's more work to code. Default would be the current behavior, which works for almost everyone, apparently, and an option would be to enable this behavior and manage the package availability externally. I suppose one could manually exclude the package as well, if SXSSF isn't used at all, since Java wouldn't try to load the classes unless a class referencing them was loaded, but that behavior is always subject to change and should not be relied upon. Plus I wouldn't want to impose that on existing users who don't need/want it. On Fri, Jan 26, 2018 at 4:47 AM pj.fanning wrote: > I could make h2 a `provided` dependency in our poi-ooxml pom. > The use of h2 is opt-in in the new code in my PR but I'll need to refactor > the code to allow our code not to throw ClassNotFoundException if the h2 > classes are not on the runtime classpath. This is do-able but my concern is > that this is difficult to automate tests for (checking the code works when > the h2 jar is available and when it is not). > > https://mvnrepository.com/artifact/com.h2database/h2 is very common > dependency, so my preference would be to have the explicit dependency from > poi-ooxml on h2 - but I'll go with whatever the consensus is. > > > > -- > Sent from: http://apache-poi.1045710.n5.nabble.com/POI-Dev-f2312866.html > > - > To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org > For additional commands, e-mail: dev-h...@poi.apache.org > >
Re: ***UNCHECKED*** RE: adding dependencies on h2 and mockito
Total dependency size is important to my deployment, and probably others. I don't use SXSSF at all, and would not need/want the dependency (which I've never heard of in 20 years of database and Java development, which is strange to me, but irrelevant). My preference is to make it optional, even though it's more work to code. Default would be the current behavior, which works for almost everyone, apparently, and an option would be to enable this behavior and manage the package availability externally. I suppose one could manually exclude the package as well, if SXSSF isn't used at all, since Java wouldn't try to load the classes unless a class referencing them was loaded, but that behavior is always subject to change and should not be relied upon. Plus I wouldn't want to impose that on existing users who don't need/want it. On Fri, Jan 26, 2018 at 4:47 AM pj.fanning wrote: > I could make h2 a `provided` dependency in our poi-ooxml pom. > The use of h2 is opt-in in the new code in my PR but I'll need to refactor > the code to allow our code not to throw ClassNotFoundException if the h2 > classes are not on the runtime classpath. This is do-able but my concern is > that this is difficult to automate tests for (checking the code works when > the h2 jar is available and when it is not). > > https://mvnrepository.com/artifact/com.h2database/h2 is very common > dependency, so my preference would be to have the explicit dependency from > poi-ooxml on h2 - but I'll go with whatever the consensus is. > > > > -- > Sent from: http://apache-poi.1045710.n5.nabble.com/POI-Dev-f2312866.html > > - > To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org > For additional commands, e-mail: dev-h...@poi.apache.org > >
***UNCHECKED*** RE: adding dependencies on h2 and mockito
I could make h2 a `provided` dependency in our poi-ooxml pom. The use of h2 is opt-in in the new code in my PR but I'll need to refactor the code to allow our code not to throw ClassNotFoundException if the h2 classes are not on the runtime classpath. This is do-able but my concern is that this is difficult to automate tests for (checking the code works when the h2 jar is available and when it is not). https://mvnrepository.com/artifact/com.h2database/h2 is very common dependency, so my preference would be to have the explicit dependency from poi-ooxml on h2 - but I'll go with whatever the consensus is. -- Sent from: http://apache-poi.1045710.n5.nabble.com/POI-Dev-f2312866.html - To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org For additional commands, e-mail: dev-h...@poi.apache.org
RE: adding dependencies on h2 and mockito
Could the functionality be written to use H2 if it exists in the classpath, but stick with the current process if it does not? -Original Message- From: Dominik Stadler [mailto:dominik.stad...@gmx.at] Sent: Friday, January 26, 2018 5:10 AM To: POI Developers List Subject: Re: adding dependencies on h2 and mockito Hi, Mockito for testing is fine for me, H2 as requirement for everybody sounds a bit heavy, would we still keep it optional unless somebody actually uses this functionality? I.e. if you have Maven/Gradle dependencies it wouldn't be dragged in by default? Thanks... Dominik. On Fri, Jan 26, 2018 at 9:03 AM, pj.fanning wrote: > Are there any objections to me adding dependencies on h2 jar > dependency for > https://github.com/apache/poi/pull/85 and a test dependency on mockito? > I think mockito would be useful for allowing us to test edge cases. > An example is https://svn.apache.org/viewvc? > view=revision&revision=1822253 > where creating an XSLFTextRun with a null Font Size is not straightforward. > With mockito, it is very easy to produce such an instance. > > > > -- > Sent from: > http://apache-poi.1045710.n5.nabble.com/POI-Dev-f2312866.html > > - > To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org For additional > commands, e-mail: dev-h...@poi.apache.org > >
Re: adding dependencies on h2 and mockito
Hi, Mockito for testing is fine for me, H2 as requirement for everybody sounds a bit heavy, would we still keep it optional unless somebody actually uses this functionality? I.e. if you have Maven/Gradle dependencies it wouldn't be dragged in by default? Thanks... Dominik. On Fri, Jan 26, 2018 at 9:03 AM, pj.fanning wrote: > Are there any objections to me adding dependencies on h2 jar dependency for > https://github.com/apache/poi/pull/85 and a test dependency on mockito? > I think mockito would be useful for allowing us to test edge cases. > An example is https://svn.apache.org/viewvc? > view=revision&revision=1822253 > where creating an XSLFTextRun with a null Font Size is not straightforward. > With mockito, it is very easy to produce such an instance. > > > > -- > Sent from: http://apache-poi.1045710.n5.nabble.com/POI-Dev-f2312866.html > > - > To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org > For additional commands, e-mail: dev-h...@poi.apache.org > >