summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2018-08-09Update stroke's junit testsHEADmasterAlex Clayton
Update stroke junit tests so it can cope with the latest version of Junit 4 (4.12) which no requires both Junit and Hamcrest to be on the classpath. This is done using a method similar to how JUNIT is currently set. The make file passes a new HAMCREST enviroment variable to the ant script as HAMCREST_JAR which ant then adds to the tests classpath. So to run the tests with the new JUNIT will need to set JUNIT to point to junit.jar and HAMCREST to the hamcrest jar, then run Make test. Also make use of ant's junitreport task to create a html version of the junit test's results, which makes diagnosing failures easier. Test-information: After setting HAMCREST and JUNIT then running Make Test on OSX and Unix all tests pass and HTML output is generated. If HAMCREST is not set but JUNIT points to latest junit.jar (i.e one that requires hamcrest on class path) tests fail with error about not being able to find hamcrest classes. If HAMCREST not set but JUNIT points to an older junit.jar then tests run correctly. On Windows got the unit tests to run by calling ant directly, again with HAMCREST and JUNIT set tests run correctly. Change-Id: I272b1dbe1bde05593df15f22814b7882a494f2c8
2015-08-19Correct classpath element for icu4j for compile-tests in build.xmlAlan Young
Change-Id: I50c4eb6ab33a8136245c76e5ecf45cc8134372ec
2015-07-20Get make and make test to rebuild all dependent classesAlex Clayton
When 'make' and 'make test' (or 'ant' and 'ant test') were run only the .java files that were directly modifed were compiled. This could cause problems if you changed a method signature (such as changing Request.send()'s return type from void to String). Classes that called that method would not be updated, and have out of date refences to the old method signature, leading to NoSuchMethodError. This patch modifies the build.xml to add depend tasks to the compile and compile-test targets. These run before the javac task is run and delete all classes files who's corresponding java file has been modified or are a class that depends on one of these modified classes. As the class files have now been deleted javac will then compile them giving us the result we want. In the compile-test case all classes are deleted if stroke.jar has been modified. FogBugz: Bug: Release-notes: Manual: Test-information: After applying patch I modified Request.send()'s return type to String and then ran 'make' and 'make test'. All the classes that depend on request were rebuilt and all the tests passed correctly (previously we would get tests failing due to NoSuchMethodError). I then change Request.send() back and ran 'make test' only, in this case it automatically rebuild all the java classes affected by the change and then ran the tests which all passed. Change-Id: I330e7a48b1fc8065091b42068adc6e6624eb2e00 Reviewer:
2015-07-16Fix Build.xml to delete test classes.Alex Clayton
Sometimes when running tests on new patches we were seeing a NoSuchMethodError exception, leading the tests to fail. In short this was because the ant clean task was not deleting the Test class files in the test folder. As such tests could be run with out of date Test files, with may contain out of date refrences to the methods. For example a patch may change the return type of Request.send() from void to String. As the test class files were not deleted when ant clean is run they would not be rebuilt by ant test either, and as such would ty and call a send() with return type void, which would throw an error as no such method would exist in the new Request class. FogBugz: Bug: Release-notes: Manual: Test-information: 1) Running ant clean now correctly deltes the class files in the test folder. 2) Applied Tarun Gupta's 'Adds Disco Features' patch to my existing stroke directory which I had already built in. This includes a change to Request.send() return type from void to String. After applying the patch I ran ant clean and then ran ant test. The GetPrivateStorageRequestTest failed with a NoSuchMethodError whenever the request.send() method was called. After making the changes to build.xml I ran ant clean and ant test again and the tests now passed. Change-Id: I577b587b6555c6c2f122b828bdf8d585774e862d Reviewer:
2015-07-06Add Internationalized Domain Name Features.Tarun Gupta
Adds IDNConverter interface, ICUConverter using ICU for Stringprep. Also updates Makefile and build.xml by adding path to icu4j to compile tests classpath, so that icu4j.jar can be used in the tests. IDNConverter tests need StringPrepParseException from icu4j jar. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Added test for IDNConverter, which passes. Change-Id: I56aacf080a10216a2455cf561de567f5666cd0c9
2013-10-30Re-implement DNS lookup to use dnsjava rather than JNDINick Hudson
There are limitations when using JNDI for DNS lookups, including that it does not properly handle the situation when resolv.conf contains IPv6 addresses (Isode bug #44832) - see e.g. http://java.net/jira/browse/JITSI-295 JNDI is also not readily available on Android, which makes it slightly more awkward to use Stroke on that platform. This patch changes the PlatformDomainName classes so that they use classes from dnsjava rather than JNDI. The patch also updates the build scripts so that dnsjava.jar is fetched (if necessary) and included in the build. Indentation in build.xml has been tidied up Test-information: Ran unit tests - ok Ran MLC - works OK and no longer throws NumberFormatExceptions when resolve.conf contains "nameserver 2001:470:f052::2" Change-Id: Iacf1105c52c281f9e59b60ea6caa011914b588dc
2013-10-29Enable building of jar file without examplesNick Hudson
The example code includes references to Swing, which isn't available for all environments (e.g. Android) and so this change provides an alternate build target to allow stroke.jar to be built without processing the example code. The original "dist" target was incorrect in the way it was creating the jar file, because it was creating a standalone MANIFEST.MF file (which didn't get used for the jar file at all). So that has been corrected (for the dist-with-examples target). So if now do % ant -Dnoexamples=1 Tnen no examples will be built. If you do % ant then the jar file will include examples (as before) and will also have a manifest that specifies "Main-class" properly. Note that this change has already been made to the isode repository and will not need applying there. Test-information: Tested building with/without examples. The jar file appears correct in each case. Prior to this patch, saying "java -jar stroke.jar" did not work, because the manifest wasn't being used properly. After this patch, it does (for the jar file that includes examples). Change-Id: I68eadc4355cb655dd31e6afec48405a6fe2c057e Signed-off-by: Nick Hudson <nick.hudson@isode.com>
2013-10-25Update Stroke's build to use "target=1.6" and "source=1.6" when compilingNick Hudson
This is a change that was made in the isode repository some months ago (as part of some other isode-specific changes) which did not get propagated into the swift repository. If you're on a system with Java7, then by default when you build Stroke you'll get classfiles that only for for Java7 and later (you can't run them under Java6 for example). This causes problems in two specific cases: 1) some unit tests fail with java.lang.VerifyError 2) stroke's jar file will not be compatible with Android The unit tests which fail show errors like this: <error message="Instruction type does not match stack map in method com.isode.stroke.base.ByteArrayTest.byteify([I)[B at offset 31" type="java.lang.VerifyError">java.lang.VerifyError: Instruction type does not match stack map in method com.isode.stroke.base.ByteArrayTest.byteify([I)[B at offset 31 at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:186) </error> this appears to be due to a limitation of Cobertura 1.9, and is supposedly fixed with Cobertura 2.0.3 https://github.com/stevesaliman/gradle-cobertura-plugin/issues/2 However, when I tried using the updated version of cobertura there appear to be other issues, so I think that needs looking at separately. The other problem with 1.7 is that Android doesn't yet support 1.7 format class files, and so you need to build with -target=1.6 if you want to be able to use the resultant stroke.jar on Android. So for these reasons, and because Stroke has no need of any 1.7 features, it seems pragmatic to change the "source" and "target" parameters of the build files to use 1.6. I'll look at the cobertura thing separately. Test-information: Checked out stroke, added this change, did a build/test to make sure things worked ok. Unit tests work ok (before this change, they fail with java.lang.* errors) Change-Id: I8ad3b8e341eebef13ae647d6e66706e4265432ca
2012-10-18Use more PMD rulesKevin Smith
Change-Id: I373469fa7a7ba8d5c639d4a1f2d4e07182eeb953
2012-10-18Include PMD checkingKevin Smith
Change-Id: Ib4717891c591911e68a5b27b7af4e666b6296d48
2012-10-18Add findbugs and cobertura XML results.Kevin Smith
Change-Id: Ic7adcf9790429c23b9493ec22324198bfc474b6f
2012-10-17Allow cobertura coverage generationKevin Smith
Change-Id: I0e333781b140a97788e35d401e054a413af0ab76
2012-10-17Make test results XML for JenkinsKevin Smith
Change-Id: Ia1460c62f0bce645248b2412a60a6ad7420ae849
2012-05-21Use the Aalto XML parser instead of XPPKevin Smith
Also adds a 'make test' target for the Makefile. Set the JUNIT environment variable to point to your jar if it doesn't find it.
2012-03-19Fiddle with pathsKevin Smith
2012-03-16Always use utf-8Kevin Smith
2012-03-07Stringprep JIDs through icu4jKevin Smith
2012-03-07Using JZlib for compression, as features we need aren't in Java until 1.7Kevin Smith
2011-12-16Add "javadoc" target to stroke build.xml fileNick Hudson
This change adds a javadoc target to the build file for stroke, so that you can do % cd build/stroke % ant javadoc I have not updated any of the other build infrastructure (Makefile etc.). Nor have I added any intelligence to the "javadoc" task so that it won't bother creating documentation if the doc is already up to date etc.. Note that I've not used the "linkoffline" directive, which means that if you try to generate doc when the Oracle web pages are offline, things may hang until the connection times out. Test-information: "ant javadoc" works as expected "isodebuild clean -component=stroke" gets rid of any javadoc
2011-07-01Update the ByteArray to not copy excessively on appends.Kevin Smith
Also updates build.xml so the path to the xpp library can be specified, rather than needing the same layout as my build tree.
2011-07-01Initial importKevin Smith