# Path: app/src/main/python/chaquopy/test/test_utils.py
# API_LEVEL = None
# 
# class FilterWarningsCase(TestCase):
# 
#     def setUp(self):
#         super().setUp()
#         self.cw = catch_warnings()
#         self.cw.__enter__()
#         filterwarnings("error")
# 
#     def tearDown(self):
#         self.cw.__exit__(None, None, None)
#         super().tearDown()


import copy
import pickle
from java import cast, jarray, jclass
from unittest import skipIf
from .test_utils import API_LEVEL, FilterWarningsCase
from com.chaquo.python import TestReflect as TR
from java.lang import Boolean, Object, String, System
    from .test_utils import assertDir
        from .test_utils import Object_names
        from com.chaquo.python import TestReflectKt as TRK
            a1b1()
        self.assertEqual("A1B.a", cast(CI.IA1, a1b1)())
        self.assertEqual("A1B.b", cast(CI.IB, a1b1)())

        # Multiple functional interfaces with the same method name but different signatures.
        a1aint = CI.A1Aint()
        with self.multi_fi(CI.IA1, CI.IAint):
            a1aint()
        self.assertEqual("A1Aint.a", cast(CI.IA1, a1aint)())
        self.assertEqual("A1Aint.a 42", cast(CI.IAint, a1aint)(42))

        # Both functional and non-functional interfaces.
        self.assertEqual("A1TwoMethods.a", CI.A1TwoMethods()())

        # An abstract class which would be functional if it was an interface.
        with self.no_fi():
            CI.C()()

        # Public Object methods don't stop an interface from being functional, but protected
        # Object methods do.
        self.assertEqual("PublicObjectMethod.a", CI.PublicObjectMethod()())
        with self.no_fi():
            CI.ProtectedObjectMethod()()

        # If an interface declares one method, and a sub-interface adds a second one, then
        # the sub-interface is not functional.
        ab = CI.AB()
        self.assertEqual("AB.a", ab())
        self.assertEqual("AB.a", cast(CI.IAB, ab)())


# Path: app/src/main/python/chaquopy/test/test_utils.py
# API_LEVEL = None
# 
# class FilterWarningsCase(TestCase):
# 
#     def setUp(self):
#         super().setUp()
#         self.cw = catch_warnings()
#         self.cw.__enter__()
#         filterwarnings("error")
# 
#     def tearDown(self):
#         self.cw.__exit__(None, None, None)
#         super().tearDown()


# Path: app/src/main/python/chaquopy/test/test_reflect.py
import copy
import pickle
from java import cast, jarray, jclass
from unittest import skipIf
from .test_utils import API_LEVEL, FilterWarningsCase
from com.chaquo.python import TestReflect as TR
from java.lang import Boolean, Object, String, System
    from .test_utils import assertDir
        from .test_utils import Object_names
        from com.chaquo.python import TestReflectKt as TRK

            a1b1()
        self.assertEqual("A1B.a", cast(CI.IA1, a1b1)())
        self.assertEqual("A1B.b", cast(CI.IB, a1b1)())

        # Multiple functional interfaces with the same method name but different signatures.
        a1aint = CI.A1Aint()
        with self.multi_fi(CI.IA1, CI.IAint):
            a1aint()
        self.assertEqual("A1Aint.a", cast(CI.IA1, a1aint)())
        self.assertEqual("A1Aint.a 42", cast(CI.IAint, a1aint)(42))

        # Both functional and non-functional interfaces.
        self.assertEqual("A1TwoMethods.a", CI.A1TwoMethods()())

        # An abstract class which would be functional if it was an interface.
        with self.no_fi():
            CI.C()()

        # Public Object methods don't stop an interface from being functional, but protected
        # Object methods do.
        self.assertEqual("PublicObjectMethod.a", CI.PublicObjectMethod()())
        with self.no_fi():
            CI.ProtectedObjectMethod()()

        # If an interface declares one method, and a sub-interface adds a second one, then
        # the sub-interface is not functional.
        ab = CI.AB()
        self.assertEqual("AB.a", ab())
        self.assertEqual("AB.a", cast(CI.IAB, ab)())


    @skipIf(API_LEVEL, "on Android, default methods require minSdkVersion >= 24")  # TODO #5262