| 1 |
import unittest |
| 2 |
|
| 3 |
import jpyutil |
| 4 |
|
| 5 |
|
| 6 |
jpyutil.init_jvm(jvm_maxmem='32M', jvm_classpath=['target/test-classes']) |
| 7 |
import jpy |
| 8 |
|
| 9 |
|
| 10 |
class TestJavaArrays(unittest.TestCase): |
| 11 |
def setUp(self): |
| 12 |
self.Fixture = jpy.get_type('org.jpy.fixtures.ConstructionTestFixture') |
| 13 |
self.assertIsNotNone(self.Fixture) |
| 14 |
|
| 15 |
def test_large_obj_by_constructor_alloc(self): |
| 16 |
|
| 17 |
for _ in range(100): |
| 18 |
fixture = self.Fixture(1000000) |
| 19 |
|
| 20 |
def test_large_obj_by_static_alloc(self): |
| 21 |
|
| 22 |
for _ in range(100): |
| 23 |
fixture = self.Fixture.viaStatic(1000000) |
| 24 |
|
| 25 |
if __name__ == '__main__': |
| 26 |
print('\nRunning ' + __file__) |
| 27 |
unittest.main() |