diff --git a/Makefile b/Makefile index e815409e..ada7e905 100644 --- a/Makefile +++ b/Makefile @@ -1,18 +1,26 @@ .PHONY: build_ext tests +JAVAC_OPTS=-target 1.6 -source 1.6 +JAVAC=javac $(JAVAC_OPTS) + build_ext: - javac jnius/src/org/jnius/NativeInvocationHandler.java + $(JAVAC) jnius/src/org/jnius/NativeInvocationHandler.java python setup.py build_ext --inplace -f -g +clean: + find . -name "*.class" -exec rm {} \; + rm -rf build + html: $(MAKE) -C docs html tests: build_ext - cd tests && javac org/jnius/HelloWorld.java - cd tests && javac org/jnius/BasicsTest.java - cd tests && javac org/jnius/MultipleMethods.java - cd tests && javac org/jnius/SimpleEnum.java - cd tests && javac org/jnius/InterfaceWithPublicEnum.java - cd tests && javac org/jnius/ClassArgument.java - cd tests && javac org/jnius/MultipleDimensions.java + cd tests && $(JAVAC) org/jnius/HelloWorld.java + cd tests && $(JAVAC) org/jnius/BasicsTest.java + cd tests && $(JAVAC) org/jnius/MultipleMethods.java + cd tests && $(JAVAC) org/jnius/SimpleEnum.java + cd tests && $(JAVAC) org/jnius/InterfaceWithPublicEnum.java + cd tests && $(JAVAC) org/jnius/ClassArgument.java + cd tests && $(JAVAC) org/jnius/MultipleDimensions.java + cp jnius/src/org/jnius/NativeInvocationHandler.class tests/org/jnius cd tests && env PYTHONPATH=..:$(PYTHONPATH) nosetests-2.7 -v diff --git a/tests/test_proxy.py b/tests/test_proxy.py index 7a5d7be4..c7630ce4 100644 --- a/tests/test_proxy.py +++ b/tests/test_proxy.py @@ -1,4 +1,5 @@ from jnius import autoclass, java_method, PythonJavaClass, cast +from nose.tools import * print '1: declare a TestImplem that implement Collection' @@ -104,7 +105,7 @@ def bad_signature(self, *args): pass -print '2: instanciate the class, with some data' +print '2: instantiate the class, with some data' a = TestImplem(*range(10)) print a print dir(a) @@ -150,4 +151,11 @@ def bad_signature(self, *args): #print Collections.shuffle(a2) # test bad signature -TestBadSignature() +threw = False +try: + TestBadSignature() +except Exception: + threw = True + +if not threw: + raise Exception("Failed to throw for bad signature")