# Path: app/src/main/python/chaquopy/test/pyobjecttest.py
# class DelTrigger(object):
#     TIMEOUT = 1.0
#     triggered = False
# 
#     def __del__(self):
#         DelTrigger.triggered = True
# 
#     @staticmethod
#     def reset():
#         DelTrigger.triggered = False
# 
#     @staticmethod
#     def assertTriggered(test, expected):
#         deadline = time() + DelTrigger.TIMEOUT
#         while time() < deadline:
#             System.gc()
#             System.runFinalization()
#             try:
#                 test.assertEqual(expected, DelTrigger.triggered)
#                 return
#             except AssertionError:
#                 if not expected:
#                     raise
#             sleep(DelTrigger.TIMEOUT / 10)
#         test.fail("Not triggered after {} seconds".format(DelTrigger.TIMEOUT))


from java import constructor, method, static_proxy, jint
from ..pyobjecttest import DelTrigger


class BasicAdder(static_proxy()):
    @constructor([jint])
    def __init__(self, n):
        super().__init__()
        self.n = n

    @method(jint, [jint])
    def add(self, x):
        return self.n + x



# Path: app/src/main/python/chaquopy/test/pyobjecttest.py
# class DelTrigger(object):
#     TIMEOUT = 1.0
#     triggered = False
# 
#     def __del__(self):
#         DelTrigger.triggered = True
# 
#     @staticmethod
#     def reset():
#         DelTrigger.triggered = False
# 
#     @staticmethod
#     def assertTriggered(test, expected):
#         deadline = time() + DelTrigger.TIMEOUT
#         while time() < deadline:
#             System.gc()
#             System.runFinalization()
#             try:
#                 test.assertEqual(expected, DelTrigger.triggered)
#                 return
#             except AssertionError:
#                 if not expected:
#                     raise
#             sleep(DelTrigger.TIMEOUT / 10)
#         test.fail("Not triggered after {} seconds".format(DelTrigger.TIMEOUT))


# Path: app/src/main/python/chaquopy/test/static_proxy/basic.py
from java import constructor, method, static_proxy, jint
from ..pyobjecttest import DelTrigger



class BasicAdder(static_proxy()):
    @constructor([jint])
    def __init__(self, n):
        super().__init__()
        self.n = n

    @method(jint, [jint])
    def add(self, x):
        return self.n + x



class GC(static_proxy()):