# Path: tmapi/exceptions.py
# class ModelConstraintException (TMAPIRuntimeException):
# 
#     """This exception is used to report Topic Maps - Data Model
#     constraint violations."""
# 
#     def __init__ (self, reporter, message):
#         """Creates a new ModelConstraintException with the specified
#         message.
# 
#         :param reporter: the construct which has thrown this exception
#         :type reporter: `Construct`
#         :param message: the detail message
#         :type message: string
# 
#         """
#         self._reporter = reporter
#         self._message = message
#     
#     def get_reporter (self):
#         """Return the `Construct` which has thrown the exception.
# 
#         :rtype: `Construct`
# 
#         """
#         return self._reporter
# 
# class UnsupportedOperationException (Exception):
# 
#     """Exception to match Java's exception of the same name."""
# 
#     pass


from tmapi.exceptions import ModelConstraintException, \
    UnsupportedOperationException
from tmapi_test_case import TMAPITestCase
        self.assertEqual(0, topic.get_subject_identifiers().count())
        self.assertEqual(1, topic.get_item_identifiers().count())
        self.assertEqual(0, topic.get_subject_locators().count())
        t = self.tm.create_topic_by_subject_identifier(locator)
        self.assertEqual(1, self.tm.get_topics().count())
        self.assertEqual(1, topic.get_subject_identifiers().count())
        self.assertEqual(1, topic.get_item_identifiers().count())
        self.assertEqual(0, topic.get_subject_locators().count())
        self.assertEqual(topic, t)

    def test_get_from_creation_item_identifier (self):
        """Verify that create_topic_by_item_identifier returns
        existing topic where that topic has a subject identifier
        matching the item identifier."""
        locator = self.create_locator('http://www.example.org/')
        self.assertEqual(0, self.tm.get_topics().count())
        topic = self.tm.create_topic_by_subject_identifier(locator)
        self.assertEqual(1, self.tm.get_topics().count())
        self.assertTrue(topic in self.tm.get_topics())
        self.assertEqual(1, topic.get_subject_identifiers().count())
        self.assertEqual(0, topic.get_item_identifiers().count())
        self.assertEqual(0, topic.get_subject_locators().count())
        t = self.tm.create_topic_by_item_identifier(locator)
        self.assertEqual(1, self.tm.get_topics().count())
        self.assertEqual(1, topic.get_subject_identifiers().count())
        self.assertEqual(1, topic.get_item_identifiers().count())
        self.assertEqual(0, topic.get_subject_locators().count())
        self.assertEqual(topic, t)

    def test_get_index (self):

# Path: tmapi/exceptions.py
# class ModelConstraintException (TMAPIRuntimeException):
# 
#     """This exception is used to report Topic Maps - Data Model
#     constraint violations."""
# 
#     def __init__ (self, reporter, message):
#         """Creates a new ModelConstraintException with the specified
#         message.
# 
#         :param reporter: the construct which has thrown this exception
#         :type reporter: `Construct`
#         :param message: the detail message
#         :type message: string
# 
#         """
#         self._reporter = reporter
#         self._message = message
#     
#     def get_reporter (self):
#         """Return the `Construct` which has thrown the exception.
# 
#         :rtype: `Construct`
# 
#         """
#         return self._reporter
# 
# class UnsupportedOperationException (Exception):
# 
#     """Exception to match Java's exception of the same name."""
# 
#     pass


# Path: tmapi/tests/models/test_topic_map.py
from tmapi.exceptions import ModelConstraintException, \
    UnsupportedOperationException
from tmapi_test_case import TMAPITestCase

        self.assertEqual(0, topic.get_subject_identifiers().count())
        self.assertEqual(1, topic.get_item_identifiers().count())
        self.assertEqual(0, topic.get_subject_locators().count())
        t = self.tm.create_topic_by_subject_identifier(locator)
        self.assertEqual(1, self.tm.get_topics().count())
        self.assertEqual(1, topic.get_subject_identifiers().count())
        self.assertEqual(1, topic.get_item_identifiers().count())
        self.assertEqual(0, topic.get_subject_locators().count())
        self.assertEqual(topic, t)

    def test_get_from_creation_item_identifier (self):
        """Verify that create_topic_by_item_identifier returns
        existing topic where that topic has a subject identifier
        matching the item identifier."""
        locator = self.create_locator('http://www.example.org/')
        self.assertEqual(0, self.tm.get_topics().count())
        topic = self.tm.create_topic_by_subject_identifier(locator)
        self.assertEqual(1, self.tm.get_topics().count())
        self.assertTrue(topic in self.tm.get_topics())
        self.assertEqual(1, topic.get_subject_identifiers().count())
        self.assertEqual(0, topic.get_item_identifiers().count())
        self.assertEqual(0, topic.get_subject_locators().count())
        t = self.tm.create_topic_by_item_identifier(locator)
        self.assertEqual(1, self.tm.get_topics().count())
        self.assertEqual(1, topic.get_subject_identifiers().count())
        self.assertEqual(1, topic.get_item_identifiers().count())
        self.assertEqual(0, topic.get_subject_locators().count())
        self.assertEqual(topic, t)

    def test_get_index (self):

        self.assertRaises(UnsupportedOperationException, self.tm.get_index,