| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
import _jpype |
| 19 |
import jpype |
| 20 |
from jpype.types import * |
| 21 |
from jpype import java |
| 22 |
import common |
| 23 |
try: |
| 24 |
import numpy as np |
| 25 |
except ImportError: |
| 26 |
pass |
| 27 |
|
| 28 |
|
| 29 |
class CustomizerTestCase(common.JPypeTestCase): |
| 30 |
def setUp(self): |
| 31 |
common.JPypeTestCase.setUp(self) |
| 32 |
self.fixture = JClass('jpype.common.Fixture')() |
| 33 |
|
| 34 |
def testSticky(self): |
| 35 |
@jpype.JImplementationFor("jpype.override.A") |
| 36 |
class _A: |
| 37 |
@jpype.JOverride(sticky=True, rename="remove_") |
| 38 |
def remove(self, obj): |
| 39 |
pass |
| 40 |
|
| 41 |
A = jpype.JClass("jpype.override.A") |
| 42 |
B = jpype.JClass("jpype.override.B") |
| 43 |
self.assertEqual(A.remove, _A.remove) |
| 44 |
self.assertEqual(B.remove, _A.remove) |
| 45 |
self.assertEqual(str(A.remove_), "jpype.override.A.remove") |
| 46 |
self.assertEqual(str(B.remove_), "jpype.override.B.remove") |