From: <lh...@us...> - 2008-11-12 13:16:02
|
Revision: 87 http://tmapi.svn.sourceforge.net/tmapi/?rev=87&view=rev Author: lheuer Date: 2008-11-12 13:15:50 +0000 (Wed, 12 Nov 2008) Log Message: ----------- - Fixed bug #2262985 -- More Topic.remove() tests - Fixed bug #2216581 -- Add test case for a.mergeIn(a) / JavaDocs - Fixed bug #2157374 -- Rename TopicMapSystenFactoryTestBase - Fixed bug #2065081 -- Test for iid constraint - Renamed some MergeIn Tests - Added MergeIn Tests - AbstractTestDatatypeAware accepts normalized decimals Modified Paths: -------------- trunk/src/test/java/org/tmapi/core/AbstractTestDatatypeAware.java trunk/src/test/java/org/tmapi/core/AllCoreTests.java trunk/src/test/java/org/tmapi/core/TestTopic.java trunk/src/test/java/org/tmapi/core/TestTopicMapMerge.java trunk/src/test/java/org/tmapi/core/TestTopicMapSystemFactory.java trunk/src/test/java/org/tmapi/core/TestTopicMerge.java trunk/src/test/java/org/tmapi/core/TestTopicMergeDetectionAutomergeDisabled.java trunk/src/test/java/org/tmapi/core/TestTopicMergeDetectionAutomergeEnabled.java trunk/src/test/java/org/tmapi/core/TopicMapSystemFactoryA.java trunk/src/test/java/org/tmapi/core/TopicMapSystemFactoryB.java trunk/src/test/java/org/tmapi/core/TopicMapSystemFactoryC.java Added Paths: ----------- trunk/src/test/java/org/tmapi/core/TestItemIdentifierConstraint.java trunk/src/test/java/org/tmapi/core/TestReifiable.java trunk/src/test/java/org/tmapi/core/TestTopicRemovableConstraint.java trunk/src/test/java/org/tmapi/core/TopicMapSystemFactoryTestBase.java Removed Paths: ------------- trunk/src/test/java/org/tmapi/core/TestReified.java trunk/src/test/java/org/tmapi/core/TopicMapSystenFactoryTestBase.java Modified: trunk/src/test/java/org/tmapi/core/AbstractTestDatatypeAware.java =================================================================== --- trunk/src/test/java/org/tmapi/core/AbstractTestDatatypeAware.java 2008-11-04 20:33:48 UTC (rev 86) +++ trunk/src/test/java/org/tmapi/core/AbstractTestDatatypeAware.java 2008-11-12 13:15:50 UTC (rev 87) @@ -175,7 +175,10 @@ fail("Expected either '10' or the canonical representation '10.0'"); } assertEquals(_xsdDecimal, dt.getDatatype()); - assertEquals(value, dt.decimalValue()); + if (!value.equals(dt.decimalValue()) && + !new BigDecimal("10.0").equals(dt.decimalValue())) { + fail("Expected either '10' or '10.0' as return value of 'decimalValue()'"); + } assertEquals(BigInteger.TEN, dt.integerValue()); assertEquals(10L, dt.longValue()); assertEquals(10, dt.intValue()); Modified: trunk/src/test/java/org/tmapi/core/AllCoreTests.java =================================================================== --- trunk/src/test/java/org/tmapi/core/AllCoreTests.java 2008-11-04 20:33:48 UTC (rev 86) +++ trunk/src/test/java/org/tmapi/core/AllCoreTests.java 2008-11-12 13:15:50 UTC (rev 87) @@ -31,7 +31,7 @@ public static Test suite() { TestSuite suite = new TestSuite(); - suite.addTestSuite(TestReified.class); + suite.addTestSuite(TestReifiable.class); suite.addTestSuite(TestScoped.class); suite.addTestSuite(TestTyped.class); suite.addTestSuite(TestLocator.class); @@ -39,6 +39,8 @@ suite.addTestSuite(TestTopicMapMerge.class); suite.addTestSuite(TestTopicMergeDetectionAutomergeEnabled.class); suite.addTestSuite(TestTopicMergeDetectionAutomergeDisabled.class); + suite.addTestSuite(TestTopicRemovableConstraint.class); + suite.addTestSuite(TestItemIdentifierConstraint.class); suite.addTestSuite(TestTopicMapSystem.class); suite.addTestSuite(TestConstruct.class); Added: trunk/src/test/java/org/tmapi/core/TestItemIdentifierConstraint.java =================================================================== --- trunk/src/test/java/org/tmapi/core/TestItemIdentifierConstraint.java (rev 0) +++ trunk/src/test/java/org/tmapi/core/TestItemIdentifierConstraint.java 2008-11-12 13:15:50 UTC (rev 87) @@ -0,0 +1,140 @@ +/* + * The Topic Maps API (TMAPI) was created collectively by + * the membership of the tmapi-discuss mailing list + * <http://lists.sourceforge.net/mailman/listinfo/tmapi-discuss>, + * is hereby released into the public domain; and comes with + * NO WARRANTY. + * + * No one owns TMAPI: you may use it freely in both commercial and + * non-commercial applications, bundle it with your software + * distribution, include it on a CD-ROM, list the source code in a + * book, mirror the documentation at your own web site, or use it in + * any other way you see fit. + */ +package org.tmapi.core; + +import org.tmapi.core.Association; +import org.tmapi.core.Construct; +import org.tmapi.core.IdentityConstraintException; +import org.tmapi.core.Locator; +import org.tmapi.core.Topic; +import org.tmapi.core.TopicMap; + +/** + * Tests if the TMDM item identifier constraint is respected. + * + * @author <a href="http://tmapi.org/">The TMAPI Project</a> + * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> + * @version $Rev:$ - $Date:$ + */ +public class TestItemIdentifierConstraint extends TMAPITestCase { + + public TestItemIdentifierConstraint(String name) { + super(name); + } + + /** + * The item identifier constraint test. + * + * @param tmo The Topic Maps construct to test. + */ + private void _testConstraint(final Construct tmo) { + assertTrue(tmo.getItemIdentifiers().isEmpty()); + final Locator iid = createLocator("http://sf.net/projects/tinytim"); + final Locator iid2 = createLocator("http://sf.net/projects/tinytim2"); + final Association assoc = createAssociation(); + assoc.addItemIdentifier(iid); + assertFalse(tmo.getItemIdentifiers().contains(iid)); + try { + tmo.addItemIdentifier(iid); + fail("Topic Maps constructs with the same item identifier are not allowed"); + } + catch (IdentityConstraintException ex) { + // noop + } + tmo.addItemIdentifier(iid2); + assertTrue(tmo.getItemIdentifiers().contains(iid2)); + tmo.removeItemIdentifier(iid2); + assoc.removeItemIdentifier(iid); + assertFalse(assoc.getItemIdentifiers().contains(iid)); + tmo.addItemIdentifier(iid); + assertTrue(tmo.getItemIdentifiers().contains(iid)); + if (!(tmo instanceof TopicMap)) { + // Removal should 'free' the item identifier + tmo.remove(); + assoc.addItemIdentifier(iid); + assertTrue(assoc.getItemIdentifiers().contains(iid)); + } + } + + /** + * Tests against a topic map. + */ + public void testTopicMap() { + _testConstraint(_tm); + } + + /** + * Tests againts a topic. + */ + public void testTopic() { + Topic topic = createTopic(); + Locator iid = createLocator("http://sf.net/projects/tinytim"); + topic.addItemIdentifier(iid); + assertTrue(topic.getItemIdentifiers().contains(iid)); + Topic topic2 = createTopic(); + try { + topic2.addItemIdentifier(iid); + } + catch (IdentityConstraintException ex) { + // noop. + } + topic.removeItemIdentifier(iid); + assertFalse(topic.getItemIdentifiers().contains(iid)); + topic2.addItemIdentifier(iid); + assertTrue(topic2.getItemIdentifiers().contains(iid)); + topic2.removeItemIdentifier(iid); + topic.addItemIdentifier(iid); + assertTrue(topic.getItemIdentifiers().contains(iid)); + assertFalse(topic2.getItemIdentifiers().contains(iid)); + topic.remove(); + topic2.addItemIdentifier(iid); + assertTrue(topic2.getItemIdentifiers().contains(iid)); + } + + /** + * Tests against an association. + */ + public void testAssociation() { + _testConstraint(createAssociation()); + } + + /** + * Tests against a role. + */ + public void testRole() { + _testConstraint(createRole()); + } + + /** + * Tests against an occurrence. + */ + public void testOccurrence() { + _testConstraint(createOccurrence()); + } + + /** + * Tests against a name. + */ + public void testName() { + _testConstraint(createName()); + } + + /** + * Tests against a variant. + */ + public void testVariant() { + _testConstraint(createVariant()); + } + +} Property changes on: trunk/src/test/java/org/tmapi/core/TestItemIdentifierConstraint.java ___________________________________________________________________ Added: svn:keywords + Rev Date Id Added: svn:eol-style + native Added: trunk/src/test/java/org/tmapi/core/TestReifiable.java =================================================================== --- trunk/src/test/java/org/tmapi/core/TestReifiable.java (rev 0) +++ trunk/src/test/java/org/tmapi/core/TestReifiable.java 2008-11-12 13:15:50 UTC (rev 87) @@ -0,0 +1,133 @@ +/* + * The Topic Maps API (TMAPI) was created collectively by + * the membership of the tmapi-discuss mailing list + * <http://lists.sourceforge.net/mailman/listinfo/tmapi-discuss>, + * is hereby released into the public domain; and comes with + * NO WARRANTY. + * + * No one owns TMAPI: you may use it freely in both commercial and + * non-commercial applications, bundle it with your software + * distribution, include it on a CD-ROM, list the source code in a + * book, mirror the documentation at your own web site, or use it in + * any other way you see fit. + */ +package org.tmapi.core; + +/** + * Tests against the {@link Reifiable} interface. + * + * @author <a href="http://tmapi.org/">The TMAPI Project</a> + * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> + * @version $Rev$ - $Date$ + */ +public class TestReifiable extends TMAPITestCase { + + public TestReifiable(String name) { + super(name); + } + + /** + * Tests setting / getting the reifier for the <tt>reifiable</tt>. + * + * @param reifiable The reifiable to run the tests against. + */ + protected void _testReification(final Reifiable reifiable) { + assertNull("Unexpected reifier property", reifiable.getReifier()); + final Topic reifier = createTopic(); + assertNull(reifier.getReified()); + reifiable.setReifier(reifier); + assertEquals("Unexpected reifier property", reifier, reifiable.getReifier()); + assertEquals("Unexpected reified property", reifiable, reifier.getReified()); + reifiable.setReifier(null); + assertNull("Reifier should be null", reifiable.getReifier()); + assertNull("Reified should be null", reifier.getReified()); + reifiable.setReifier(reifier); + assertEquals("Unexpected reifier property", reifier, reifiable.getReifier()); + assertEquals("Unexpected reified property", reifiable, reifier.getReified()); + try { + // Assigning the *same* reifier is allowed, the TM processor MUST NOT + // raise an exception + reifiable.setReifier(reifier); + } + catch (ModelConstraintException ex) { + fail("Unexpected exception while setting the reifier to the same value"); + } + } + + /** + * Tests if a reifier collision (the reifier is alredy assigned to another + * construct) is detected. + * + * @param reifiable The reifiable to run the tests against. + */ + protected void _testReificationCollision(final Reifiable reifiable) { + assertNull("Unexpected reifier property", reifiable.getReifier()); + final Topic reifier = createTopic(); + assertNull(reifier.getReified()); + final Reifiable otherReifiable = createAssociation(); + otherReifiable.setReifier(reifier); + assertEquals("Expected a reifier property", reifier, otherReifiable.getReifier()); + assertEquals("Unexpected reified property", otherReifiable, reifier.getReified()); + try { + reifiable.setReifier(reifier); + fail("The reifier reifies already another construct"); + } + catch (ModelConstraintException ex) { + assertEquals(reifiable, ex.getSender()); + } + otherReifiable.setReifier(null); + assertNull("Reifier property should be null", otherReifiable.getReifier()); + assertNull("Reified property should be null", reifier.getReified()); + reifiable.setReifier(reifier); + assertEquals("Reifier property should have been changed", reifier, reifiable.getReifier()); + assertEquals("Reified property should have been changed", reifiable, reifier.getReified()); + } + + public void testTopicMap() { + _testReification(_tm); + } + + public void testTopicMapReifierCollision() { + _testReificationCollision(_tm); + } + + public void testAssociation() { + _testReification(createAssociation()); + } + + public void testAssociationReifierCollision() { + _testReificationCollision(createAssociation()); + } + + public void testRole() { + _testReification(createRole()); + } + + public void testRoleReifierCollision() { + _testReificationCollision(createRole()); + } + + public void testOccurrence() { + _testReification(createOccurrence()); + } + + public void testOccurrenceReifierCollision() { + _testReificationCollision(createOccurrence()); + } + + public void testName() { + _testReification(createName()); + } + + public void testNameReifierCollision() { + _testReificationCollision(createName()); + } + + public void testVariant() { + _testReification(createVariant()); + } + + public void testVariantReifierCollision() { + _testReificationCollision(createVariant()); + } +} Property changes on: trunk/src/test/java/org/tmapi/core/TestReifiable.java ___________________________________________________________________ Added: svn:keywords + Rev Date Id Added: svn:eol-style + native Deleted: trunk/src/test/java/org/tmapi/core/TestReified.java =================================================================== --- trunk/src/test/java/org/tmapi/core/TestReified.java 2008-11-04 20:33:48 UTC (rev 86) +++ trunk/src/test/java/org/tmapi/core/TestReified.java 2008-11-12 13:15:50 UTC (rev 87) @@ -1,133 +0,0 @@ -/* - * The Topic Maps API (TMAPI) was created collectively by - * the membership of the tmapi-discuss mailing list - * <http://lists.sourceforge.net/mailman/listinfo/tmapi-discuss>, - * is hereby released into the public domain; and comes with - * NO WARRANTY. - * - * No one owns TMAPI: you may use it freely in both commercial and - * non-commercial applications, bundle it with your software - * distribution, include it on a CD-ROM, list the source code in a - * book, mirror the documentation at your own web site, or use it in - * any other way you see fit. - */ -package org.tmapi.core; - -/** - * Tests against the {@link Reified} interface. - * - * @author <a href="http://tmapi.org/">The TMAPI Project</a> - * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> - * @version $Rev$ - $Date$ - */ -public class TestReified extends TMAPITestCase { - - public TestReified(String name) { - super(name); - } - - /** - * Tests setting / getting the reifier for the <tt>reifiable</tt>. - * - * @param reifiable The reifiable to run the tests against. - */ - protected void _testReification(final Reifiable reifiable) { - assertNull("Unexpected reifier property", reifiable.getReifier()); - final Topic reifier = createTopic(); - assertNull(reifier.getReified()); - reifiable.setReifier(reifier); - assertEquals("Unexpected reifier property", reifier, reifiable.getReifier()); - assertEquals("Unexpected reified property", reifiable, reifier.getReified()); - reifiable.setReifier(null); - assertNull("Reifier should be null", reifiable.getReifier()); - assertNull("Reified should be null", reifier.getReified()); - reifiable.setReifier(reifier); - assertEquals("Unexpected reifier property", reifier, reifiable.getReifier()); - assertEquals("Unexpected reified property", reifiable, reifier.getReified()); - try { - // Assigning the *same* reifier is allowed, the TM processor MUST NOT - // raise an exception - reifiable.setReifier(reifier); - } - catch (ModelConstraintException ex) { - fail("Unexpected exception while setting the reifier to the same value"); - } - } - - /** - * Tests if a reifier collision (the reifier is alredy assigned to another - * construct) is detected. - * - * @param reifiable The reifiable to run the tests against. - */ - protected void _testReificationCollision(final Reifiable reifiable) { - assertNull("Unexpected reifier property", reifiable.getReifier()); - final Topic reifier = createTopic(); - assertNull(reifier.getReified()); - final Reifiable otherReifiable = createAssociation(); - otherReifiable.setReifier(reifier); - assertEquals("Expected a reifier property", reifier, otherReifiable.getReifier()); - assertEquals("Unexpected reified property", otherReifiable, reifier.getReified()); - try { - reifiable.setReifier(reifier); - fail("The reifier reifies already another construct"); - } - catch (ModelConstraintException ex) { - assertEquals(reifiable, ex.getSender()); - } - otherReifiable.setReifier(null); - assertNull("Reifier property should be null", otherReifiable.getReifier()); - assertNull("Reified property should be null", reifier.getReified()); - reifiable.setReifier(reifier); - assertEquals("Reifier property should have been changed", reifier, reifiable.getReifier()); - assertEquals("Reified property should have been changed", reifiable, reifier.getReified()); - } - - public void testTopicMap() { - _testReification(_tm); - } - - public void testTopicMapReifierCollision() { - _testReificationCollision(_tm); - } - - public void testAssociation() { - _testReification(createAssociation()); - } - - public void testAssociationReifierCollision() { - _testReificationCollision(createAssociation()); - } - - public void testRole() { - _testReification(createRole()); - } - - public void testRoleReifierCollision() { - _testReificationCollision(createRole()); - } - - public void testOccurrence() { - _testReification(createOccurrence()); - } - - public void testOccurrenceReifierCollision() { - _testReificationCollision(createOccurrence()); - } - - public void testName() { - _testReification(createName()); - } - - public void testNameReifierCollision() { - _testReificationCollision(createName()); - } - - public void testVariant() { - _testReification(createVariant()); - } - - public void testVariantReifierCollision() { - _testReificationCollision(createVariant()); - } -} Modified: trunk/src/test/java/org/tmapi/core/TestTopic.java =================================================================== --- trunk/src/test/java/org/tmapi/core/TestTopic.java 2008-11-04 20:33:48 UTC (rev 86) +++ trunk/src/test/java/org/tmapi/core/TestTopic.java 2008-11-12 13:15:50 UTC (rev 87) @@ -711,91 +711,4 @@ } } - public void testTopicRemovableUsedAsType() { - Topic topic = createTopic(); - assertEquals(1, _tm.getTopics().size()); - topic.remove(); - assertEquals(0, _tm.getTopics().size()); - topic = createTopic(); - assertEquals(1, _tm.getTopics().size()); - Association assoc = _tm.createAssociation(topic); - try { - topic.remove(); - fail("The topic is used as type"); - } - catch (TopicInUseException ex) { - assertEquals(topic, ex.getSender()); - } - assoc.setType(createTopic()); - assertEquals(2, _tm.getTopics().size()); - topic.remove(); - assertEquals(1, _tm.getTopics().size()); - } - - public void testTopicRemovableUsedAsPlayer() { - Topic topic = createTopic(); - assertEquals(1, _tm.getTopics().size()); - topic.remove(); - assertEquals(0, _tm.getTopics().size()); - topic = createTopic(); - assertEquals(1, _tm.getTopics().size()); - Association assoc = createAssociation(); - assertEquals(2, _tm.getTopics().size()); - Role role = assoc.createRole(_tm.createTopic(), topic); - assertEquals(3, _tm.getTopics().size()); - try { - topic.remove(); - fail("The topic is used as player"); - } - catch (TopicInUseException ex) { - assertEquals(topic, ex.getSender()); - } - role.setPlayer(createTopic()); - assertEquals(4, _tm.getTopics().size()); - topic.remove(); - assertEquals(3, _tm.getTopics().size()); - } - - public void testRemovableUsedAsTheme() { - Topic topic = createTopic(); - assertEquals(1, _tm.getTopics().size()); - topic.remove(); - assertEquals(0, _tm.getTopics().size()); - topic = createTopic(); - assertEquals(1, _tm.getTopics().size()); - Association assoc = _tm.createAssociation(createTopic(), topic); - assertEquals(2, _tm.getTopics().size()); - try { - topic.remove(); - fail("The topic is used as theme"); - } - catch (TopicInUseException ex) { - assertEquals(topic, ex.getSender()); - } - assoc.removeTheme(topic); - topic.remove(); - assertEquals(1, _tm.getTopics().size()); - } - - public void testRemovableUsedAsReifier() { - Topic topic = createTopic(); - assertEquals(1, _tm.getTopics().size()); - topic.remove(); - assertEquals(0, _tm.getTopics().size()); - topic = createTopic(); - assertEquals(1, _tm.getTopics().size()); - Association assoc = createAssociation(); - assertEquals(2, _tm.getTopics().size()); - assoc.setReifier(topic); - try { - topic.remove(); - fail("The topic is used as reifier"); - } - catch (TopicInUseException ex) { - assertEquals(topic, ex.getSender()); - } - assoc.setReifier(null); - topic.remove(); - assertEquals(1, _tm.getTopics().size()); - } } Modified: trunk/src/test/java/org/tmapi/core/TestTopicMapMerge.java =================================================================== --- trunk/src/test/java/org/tmapi/core/TestTopicMapMerge.java 2008-11-04 20:33:48 UTC (rev 86) +++ trunk/src/test/java/org/tmapi/core/TestTopicMapMerge.java 2008-11-12 13:15:50 UTC (rev 87) @@ -53,103 +53,209 @@ } /** + * Tests if no exception a.mergeIn(a) is accepted. + * Must have no side effects. + * + * @throws Exception In case of an error. + */ + public void testTopicMergeNoop() throws Exception { + Locator loc = createLocator("http://www.tmapi.org/test/tm-merge-noop"); + TopicMap tm = _sys.createTopicMap(loc); + assertEquals(tm, _sys.getTopicMap(loc)); + tm.mergeIn(_sys.getTopicMap(loc)); + assertEquals(tm, _sys.getTopicMap(loc)); + } + + /** * Tests merging of topics by equal item identifiers. */ - public void testMergeSimple1() { + public void testMergeByItemIdentifier() { final String ref = "http://sf.net/projects/tinytim/loc"; - Topic topicA = _tm.createTopic(); Locator iidA = _tm.createLocator(ref); - topicA.addItemIdentifier(iidA); - Topic topicB = _tm2.createTopic(); + Topic topicA = _tm.createTopicByItemIdentifier(iidA); Locator iidB = _tm2.createLocator(ref); - topicB.addItemIdentifier(iidB); + Topic topicB = _tm2.createTopicByItemIdentifier(iidB); assertEquals(1, _tm.getTopics().size()); assertEquals(1, _tm2.getTopics().size()); _tm.mergeIn(_tm2); assertEquals(1, _tm.getTopics().size()); assertEquals(topicA, _tm.getConstructByItemIdentifier(iidA)); + assertEquals(1, topicA.getItemIdentifiers().size()); + assertEquals(iidA, topicA.getItemIdentifiers().iterator().next()); + assertEquals(0, topicA.getSubjectIdentifiers().size()); + assertEquals(0, topicA.getSubjectLocators().size()); + + // MergeIn must not have any side effects on tm2 + assertEquals(1, _tm2.getTopics().size()); + assertEquals(topicB, _tm2.getConstructByItemIdentifier(iidB)); + assertEquals(1, topicB.getItemIdentifiers().size()); + assertEquals(iidB, topicB.getItemIdentifiers().iterator().next()); + assertEquals(0, topicB.getSubjectIdentifiers().size()); + assertEquals(0, topicB.getSubjectLocators().size()); } /** * Tests merging of topics by equal subject identifiers. */ - public void testMergeSimple2() { + public void testMergeBySubjectIdentifier() { final String ref = "http://sf.net/projects/tinytim/loc"; - Topic topicA = _tm.createTopic(); Locator sidA = _tm.createLocator(ref); - topicA.addSubjectIdentifier(sidA); - Topic topicB = _tm2.createTopic(); + Topic topicA = _tm.createTopicBySubjectIdentifier(sidA); Locator sidB = _tm2.createLocator(ref); - topicB.addSubjectIdentifier(sidB); + Topic topicB = _tm2.createTopicBySubjectIdentifier(sidB); assertEquals(1, _tm.getTopics().size()); assertEquals(1, _tm2.getTopics().size()); _tm.mergeIn(_tm2); assertEquals(1, _tm.getTopics().size()); assertEquals(topicA, _tm.getTopicBySubjectIdentifier(sidA)); + assertEquals(1, topicA.getSubjectIdentifiers().size()); + assertEquals(sidA, topicA.getSubjectIdentifiers().iterator().next()); + assertEquals(0, topicA.getItemIdentifiers().size()); + assertEquals(0, topicA.getSubjectLocators().size()); + + // MergeIn must not have any side effects on tm2 + assertEquals(1, _tm2.getTopics().size()); + assertEquals(topicB, _tm2.getTopicBySubjectIdentifier(sidB)); + assertEquals(1, topicB.getSubjectIdentifiers().size()); + assertEquals(sidB, topicB.getSubjectIdentifiers().iterator().next()); + assertEquals(0, topicB.getItemIdentifiers().size()); + assertEquals(0, topicB.getSubjectLocators().size()); } /** * Tests merging of topics by equal subject locators. */ - public void testMergeSimple3() { + public void testMergeBySubjectLocator() { final String ref = "http://sf.net/projects/tinytim/loc"; - Topic topicA = _tm.createTopic(); Locator sloA = _tm.createLocator(ref); - topicA.addSubjectLocator(sloA); - Topic topicB = _tm2.createTopic(); + Topic topicA = _tm.createTopicBySubjectLocator(sloA); Locator sloB = _tm2.createLocator(ref); - topicB.addSubjectLocator(sloB); + Topic topicB = _tm2.createTopicBySubjectLocator(sloB); assertEquals(1, _tm.getTopics().size()); assertEquals(1, _tm2.getTopics().size()); _tm.mergeIn(_tm2); assertEquals(1, _tm.getTopics().size()); assertEquals(topicA, _tm.getTopicBySubjectLocator(sloA)); + assertEquals(1, topicA.getSubjectLocators().size()); + assertEquals(sloA, topicA.getSubjectLocators().iterator().next()); + assertEquals(0, topicA.getItemIdentifiers().size()); + assertEquals(0, topicA.getSubjectIdentifiers().size()); + + // MergeIn must not have any side effects on tm2 + assertEquals(1, _tm2.getTopics().size()); + assertEquals(topicB, _tm2.getTopicBySubjectLocator(sloB)); + assertEquals(1, topicB.getSubjectLocators().size()); + assertEquals(sloB, topicB.getSubjectLocators().iterator().next()); + assertEquals(0, topicB.getItemIdentifiers().size()); + assertEquals(0, topicB.getSubjectIdentifiers().size()); } /** * Tests merging of topics by existing topic with item identifier equals * to a topic's subject identifier from the other map. */ - public void testMergeSimple4() { + public void testMergeItemIdentifierEqSubjectIdentifier() { final String ref = "http://sf.net/projects/tinytim/loc"; - Topic topicA = _tm.createTopic(); - Locator loc = _tm.createLocator(ref); - topicA.addItemIdentifier(loc); - Topic topicB = _tm2.createTopic(); + Locator locA = _tm.createLocator(ref); + Topic topicA = _tm.createTopicByItemIdentifier(locA); Locator locB = _tm2.createLocator(ref); - topicB.addSubjectIdentifier(locB); + Topic topicB = _tm2.createTopicBySubjectIdentifier(locB); assertEquals(1, _tm.getTopics().size()); assertEquals(1, _tm2.getTopics().size()); - assertEquals(topicA, _tm.getConstructByItemIdentifier(loc)); - assertNull(_tm.getTopicBySubjectIdentifier(loc)); + assertEquals(topicA, _tm.getConstructByItemIdentifier(locA)); + assertNull(_tm.getTopicBySubjectIdentifier(locA)); + _tm.mergeIn(_tm2); assertEquals(1, _tm.getTopics().size()); - assertEquals(topicA, _tm.getConstructByItemIdentifier(loc)); - assertEquals(topicA, _tm.getTopicBySubjectIdentifier(loc)); + assertEquals(topicA, _tm.getConstructByItemIdentifier(locA)); + assertEquals(topicA, _tm.getTopicBySubjectIdentifier(locA)); + assertEquals(1, topicA.getSubjectIdentifiers().size()); + assertEquals(locA, topicA.getSubjectIdentifiers().iterator().next()); + assertEquals(1, topicA.getItemIdentifiers().size()); + assertEquals(locA, topicA.getItemIdentifiers().iterator().next()); + assertEquals(0, topicA.getSubjectLocators().size()); + + // No side effects on tm2 + assertEquals(1, _tm2.getTopics().size()); + assertNull(_tm2.getConstructByItemIdentifier(locB)); + assertEquals(topicB, _tm2.getTopicBySubjectIdentifier(locB)); + assertEquals(1, topicB.getSubjectIdentifiers().size()); + assertEquals(locB, topicB.getSubjectIdentifiers().iterator().next()); + assertEquals(0, topicB.getItemIdentifiers().size()); + assertEquals(0, topicA.getSubjectLocators().size()); } /** * Tests merging of topics by existing topic with subject identifier equals * to a topic's item identifier from the other map. */ - public void testMergeSimple5() { + public void testMergeSubjectIdentifierEqItemIdentifier() { final String ref = "http://sf.net/projects/tinytim/loc"; - Topic topicA = _tm.createTopic(); - Locator loc = _tm.createLocator(ref); - topicA.addSubjectIdentifier(loc); - Topic topicB = _tm2.createTopic(); + Locator locA = _tm.createLocator(ref); + Topic topicA = _tm.createTopicBySubjectIdentifier(locA); Locator locB = _tm2.createLocator(ref); - topicB.addItemIdentifier(locB); + Topic topicB = _tm2.createTopicByItemIdentifier(locB); assertEquals(1, _tm.getTopics().size()); assertEquals(1, _tm2.getTopics().size()); - assertNull(_tm.getConstructByItemIdentifier(loc)); - assertEquals(topicA, _tm.getTopicBySubjectIdentifier(loc)); + assertNull(_tm.getConstructByItemIdentifier(locA)); + assertEquals(topicA, _tm.getTopicBySubjectIdentifier(locA)); + _tm.mergeIn(_tm2); assertEquals(1, _tm.getTopics().size()); - assertEquals(topicA, _tm.getConstructByItemIdentifier(loc)); - assertEquals(topicA, _tm.getTopicBySubjectIdentifier(loc)); + assertEquals(topicA, _tm.getConstructByItemIdentifier(locA)); + assertEquals(topicA, _tm.getTopicBySubjectIdentifier(locA)); + assertEquals(1, topicA.getSubjectIdentifiers().size()); + assertEquals(locA, topicA.getSubjectIdentifiers().iterator().next()); + assertEquals(1, topicA.getItemIdentifiers().size()); + assertEquals(locA, topicA.getItemIdentifiers().iterator().next()); + assertEquals(0, topicA.getSubjectLocators().size()); + + // No side effects on tm2 + assertEquals(1, _tm2.getTopics().size()); + assertNull(_tm2.getTopicBySubjectIdentifier(locB)); + assertEquals(topicB, _tm2.getConstructByItemIdentifier(locB)); + assertEquals(1, topicB.getItemIdentifiers().size()); + assertEquals(locB, topicB.getItemIdentifiers().iterator().next()); + assertEquals(0, topicB.getSubjectIdentifiers().size()); + assertEquals(0, topicA.getSubjectLocators().size()); } + + /** + * Tests if topics are added to a topic map from another topic map. + */ + public void testAddTopicsFromOtherMap() { + final String refA = "http://www.tmapi.org/#iid-A"; + final String refB = "http://www.tmapi.org/#iid-B"; + final Locator locA = _tm.createLocator(refA); + final Topic topicA = _tm.createTopicByItemIdentifier(locA); + final Locator locB = _tm2.createLocator(refB); + final Topic topicB = _tm2.createTopicByItemIdentifier(locB); + // Check tm + assertEquals(1, _tm.getTopics().size()); + assertEquals(topicA, _tm.getConstructByItemIdentifier(locA)); + assertNull(_tm.getConstructByItemIdentifier(locB)); + // Check tm2 + assertEquals(1, _tm2.getTopics().size()); + assertEquals(topicB, _tm2.getConstructByItemIdentifier(locB)); + assertNull(_tm2.getConstructByItemIdentifier(locA)); + _tm.mergeIn(_tm2); + assertEquals(2, _tm.getTopics().size()); + // Check if topicA is unchanged + assertEquals(topicA, _tm.getConstructByItemIdentifier(locA)); + assertEquals(1, topicA.getItemIdentifiers().size()); + assertEquals(locA, topicA.getItemIdentifiers().iterator().next()); + assertEquals(0, topicA.getSubjectIdentifiers().size()); + assertEquals(0, topicA.getSubjectLocators().size()); + // Check the new topic (which is topicB in tm2) + final Topic newTopic = (Topic) _tm.getConstructByItemIdentifier(locB); + assertNotNull(newTopic); + assertEquals(1, newTopic.getItemIdentifiers().size()); + assertEquals(locB, newTopic.getItemIdentifiers().iterator().next()); + assertEquals(0, newTopic.getSubjectIdentifiers().size()); + assertEquals(0, newTopic.getSubjectLocators().size()); + } + } Modified: trunk/src/test/java/org/tmapi/core/TestTopicMapSystemFactory.java =================================================================== --- trunk/src/test/java/org/tmapi/core/TestTopicMapSystemFactory.java 2008-11-04 20:33:48 UTC (rev 86) +++ trunk/src/test/java/org/tmapi/core/TestTopicMapSystemFactory.java 2008-11-12 13:15:50 UTC (rev 87) @@ -26,7 +26,7 @@ * * @author <a href="http://tmapi.org/">The TMAPI Project</a> * @author Kal Ahmed - * @version $Rev:$ - $Date:$ + * @version $Rev$ - $Date$ */ public class TestTopicMapSystemFactory extends TestCase { Modified: trunk/src/test/java/org/tmapi/core/TestTopicMerge.java =================================================================== --- trunk/src/test/java/org/tmapi/core/TestTopicMerge.java 2008-11-04 20:33:48 UTC (rev 86) +++ trunk/src/test/java/org/tmapi/core/TestTopicMerge.java 2008-11-12 13:15:50 UTC (rev 87) @@ -27,6 +27,20 @@ } /** + * Tests if no exception a.mergeIn(a) is accepted. + * Must have no side effects. + */ + public void testTopicMergeNoop() { + Locator sid = createLocator("http://www.tmapi.org/test/me"); + Topic topic = _tm.createTopicBySubjectIdentifier(sid); + assertEquals(1, _tm.getTopics().size()); + assertEquals(topic, _tm.getTopicBySubjectIdentifier(sid)); + topic.mergeIn(topic); + assertEquals(1, _tm.getTopics().size()); + assertEquals(topic, _tm.getTopicBySubjectIdentifier(sid)); + } + + /** *Tests if the types are merged too */ public void testTypesMerged() { @@ -34,7 +48,8 @@ Topic t2 = createTopic(); Topic t3 = createTopic(); t2.addType(t3); - + assertTrue(t2.getTypes().contains(t3)); + assertTrue(t1.getTypes().isEmpty()); t1.mergeIn(t2); assertTrue("topic must have a type now", t1.getTypes().contains(t3)); } Modified: trunk/src/test/java/org/tmapi/core/TestTopicMergeDetectionAutomergeDisabled.java =================================================================== --- trunk/src/test/java/org/tmapi/core/TestTopicMergeDetectionAutomergeDisabled.java 2008-11-04 20:33:48 UTC (rev 86) +++ trunk/src/test/java/org/tmapi/core/TestTopicMergeDetectionAutomergeDisabled.java 2008-11-12 13:15:50 UTC (rev 87) @@ -18,7 +18,7 @@ * * @author <a href="http://tmapi.org/">The TMAPI Project</a> * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> - * @version $Rev:$ - $Date:$ + * @version $Rev$ - $Date$ */ public class TestTopicMergeDetectionAutomergeDisabled extends AbstractTestTopicMergeDetection { Modified: trunk/src/test/java/org/tmapi/core/TestTopicMergeDetectionAutomergeEnabled.java =================================================================== --- trunk/src/test/java/org/tmapi/core/TestTopicMergeDetectionAutomergeEnabled.java 2008-11-04 20:33:48 UTC (rev 86) +++ trunk/src/test/java/org/tmapi/core/TestTopicMergeDetectionAutomergeEnabled.java 2008-11-12 13:15:50 UTC (rev 87) @@ -18,7 +18,7 @@ * * @author <a href="http://tmapi.org/">The TMAPI Project</a> * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> - * @version $Rev:$ - $Date:$ + * @version $Rev$ - $Date$ */ public class TestTopicMergeDetectionAutomergeEnabled extends AbstractTestTopicMergeDetection { Added: trunk/src/test/java/org/tmapi/core/TestTopicRemovableConstraint.java =================================================================== --- trunk/src/test/java/org/tmapi/core/TestTopicRemovableConstraint.java (rev 0) +++ trunk/src/test/java/org/tmapi/core/TestTopicRemovableConstraint.java 2008-11-12 13:15:50 UTC (rev 87) @@ -0,0 +1,253 @@ +/* + * The Topic Maps API (TMAPI) was created collectively by + * the membership of the tmapi-discuss mailing list + * <http://lists.sourceforge.net/mailman/listinfo/tmapi-discuss>, + * is hereby released into the public domain; and comes with + * NO WARRANTY. + * + * No one owns TMAPI: you may use it freely in both commercial and + * non-commercial applications, bundle it with your software + * distribution, include it on a CD-ROM, list the source code in a + * book, mirror the documentation at your own web site, or use it in + * any other way you see fit. + */ +package org.tmapi.core; + + +/** + * Tests if the engine respects the constraint if a {@link Topic} is removable + * or not. + * + * @author <a href="http://tmapi.org/">The TMAPI Project</a> + * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> + * @version $Rev$ - $Date$ + */ +public class TestTopicRemovableConstraint extends TMAPITestCase { + + public TestTopicRemovableConstraint(String name) { + super(name); + } + + /** + * Tests if the topic removable constraint is respected if a topic + * is used as type. + * + * @param typed A typed construct. + */ + private void _testTyped(Typed typed) { + final int topicCount = _tm.getTopics().size(); + final Topic oldType = typed.getType(); + final Topic topic = createTopic(); + assertEquals(topicCount+1, _tm.getTopics().size()); + typed.setType(topic); + try { + topic.remove(); + fail("The topic is used as type"); + } + catch (TopicInUseException ex) { + assertEquals(topic, ex.getSender()); + } + assertEquals(topicCount+1, _tm.getTopics().size()); + typed.setType(oldType); + topic.remove(); + assertEquals(topicCount, _tm.getTopics().size()); + } + + /** + * Tests if the topic removable constraint is respected if a topic + * is used as theme. + * + * @param scoped A scoped construct. + */ + private void _testScoped(Scoped scoped) { + final int topicCount = _tm.getTopics().size(); + final Topic topic = createTopic(); + assertEquals(topicCount+1, _tm.getTopics().size()); + scoped.addTheme(topic); + try { + topic.remove(); + fail("The topic is used as theme"); + } + catch (TopicInUseException ex) { + assertEquals(topic, ex.getSender()); + } + assertEquals(topicCount+1, _tm.getTopics().size()); + scoped.removeTheme(topic); + topic.remove(); + assertEquals(topicCount, _tm.getTopics().size()); + } + + /** + * Tests if the topic removable constraint is respected if a topic + * is used as reifier. + * + * @param reifiable A {@link Reifiable} that is not reified. + */ + private void _testReifiable(Reifiable reifiable) { + assertNull(reifiable.getReifier()); + final int topicCount = _tm.getTopics().size(); + final Topic topic = createTopic(); + assertEquals(topicCount+1, _tm.getTopics().size()); + reifiable.setReifier(topic); + try { + topic.remove(); + fail("The topic is used as reifier"); + } + catch (TopicInUseException ex) { + assertEquals(topic, ex.getSender()); + } + assertEquals(topicCount+1, _tm.getTopics().size()); + reifiable.setReifier(null); + topic.remove(); + assertEquals(topicCount, _tm.getTopics().size()); + } + + /** + * Topic map reifier test. + */ + public void testUsedAsTopicMapReifier() { + _testReifiable(_tm); + } + + /** + * Association type test. + */ + public void testUsedAsAssociationType() { + _testTyped(createAssociation()); + } + + /** + * Association theme test. + */ + public void testUsedAsAssociationTheme() { + _testScoped(createAssociation()); + } + + /** + * Association reifier test. + */ + public void testUsedAsAssociationReifier() { + _testReifiable(createAssociation()); + } + + /** + * Role type test. + */ + public void testUsedAsRoleType() { + _testTyped(createRole()); + } + + /** + * Role reifier test. + */ + public void testUsedAsRoleReifier() { + _testReifiable(createRole()); + } + + /** + * Occurrence type test. + */ + public void testUsedAsOccurrenceType() { + _testTyped(createOccurrence()); + } + + /** + * Occurrence theme test. + */ + public void testUsedAsOccurrenceTheme() { + _testScoped(createOccurrence()); + } + + /** + * Occurrence reifier test. + */ + public void testUsedAsOccurrenceReifier() { + _testReifiable(createOccurrence()); + } + + /** + * Name type test. + */ + public void testUsedAsNameType() { + _testTyped(createName()); + } + + /** + * Name theme test. + */ + public void testUsedAsNameTheme() { + _testScoped(createName()); + } + + /** + * Name reifier test. + */ + public void testUsedAsNameReifier() { + _testReifiable(createName()); + } + + /** + * Variant theme test. + */ + public void testUsedAsVariantTheme() { + _testScoped(createVariant()); + } + + /** + * Variant reifier test. + */ + public void testUsedAsVariantReifier() { + _testReifiable(createVariant()); + } + + /** + * Tests if the removable constraint is respected if a topic is + * used as topic type. + */ + public void testUsedAsTopicType() { + Topic topic = createTopic(); + Topic topic2 = createTopic(); + assertEquals(2, _tm.getTopics().size()); + topic2.addType(topic); + try { + topic.remove(); + fail("The topic is used as topic type"); + } + catch (TopicInUseException ex) { + assertEquals(topic, ex.getSender()); + } + assertEquals(2, _tm.getTopics().size()); + topic2.removeType(topic); + topic.remove(); + assertEquals(1, _tm.getTopics().size()); + } + + /** + * Tests if the removable constraint is respected if a topic is + * used as player. + */ + public void testUsedAsPlayer() { + Topic topic = createTopic(); + assertEquals(1, _tm.getTopics().size()); + topic.remove(); + assertEquals(0, _tm.getTopics().size()); + topic = createTopic(); + assertEquals(1, _tm.getTopics().size()); + Association assoc = createAssociation(); + assertEquals(2, _tm.getTopics().size()); + Role role = assoc.createRole(_tm.createTopic(), topic); + assertEquals(3, _tm.getTopics().size()); + try { + topic.remove(); + fail("The topic is used as player"); + } + catch (TopicInUseException ex) { + assertEquals(topic, ex.getSender()); + } + role.setPlayer(createTopic()); + assertEquals(4, _tm.getTopics().size()); + topic.remove(); + assertEquals(3, _tm.getTopics().size()); + } + +} Property changes on: trunk/src/test/java/org/tmapi/core/TestTopicRemovableConstraint.java ___________________________________________________________________ Added: svn:keywords + Rev Date Id Added: svn:eol-style + native Modified: trunk/src/test/java/org/tmapi/core/TopicMapSystemFactoryA.java =================================================================== --- trunk/src/test/java/org/tmapi/core/TopicMapSystemFactoryA.java 2008-11-04 20:33:48 UTC (rev 86) +++ trunk/src/test/java/org/tmapi/core/TopicMapSystemFactoryA.java 2008-11-12 13:15:50 UTC (rev 87) @@ -18,9 +18,9 @@ * * @author TMAPI <a href="http://www.tmapi.org">tmapi.org</a> * @author Kal Ahmed - * @version $Rev:$ - $Date:$ + * @version $Rev$ - $Date$ */ -public class TopicMapSystemFactoryA extends TopicMapSystenFactoryTestBase { +public class TopicMapSystemFactoryA extends TopicMapSystemFactoryTestBase { public TopicMapSystemFactoryA() { } Modified: trunk/src/test/java/org/tmapi/core/TopicMapSystemFactoryB.java =================================================================== --- trunk/src/test/java/org/tmapi/core/TopicMapSystemFactoryB.java 2008-11-04 20:33:48 UTC (rev 86) +++ trunk/src/test/java/org/tmapi/core/TopicMapSystemFactoryB.java 2008-11-12 13:15:50 UTC (rev 87) @@ -18,9 +18,9 @@ * * @author TMAPI <a href="http://www.tmapi.org">tmapi.org</a> * @author Kal Ahmed - * @version $Rev:$ - $Date:$ + * @version $Rev$ - $Date$ */ -public class TopicMapSystemFactoryB extends TopicMapSystenFactoryTestBase { +public class TopicMapSystemFactoryB extends TopicMapSystemFactoryTestBase { public TopicMapSystemFactoryB() { } Modified: trunk/src/test/java/org/tmapi/core/TopicMapSystemFactoryC.java =================================================================== --- trunk/src/test/java/org/tmapi/core/TopicMapSystemFactoryC.java 2008-11-04 20:33:48 UTC (rev 86) +++ trunk/src/test/java/org/tmapi/core/TopicMapSystemFactoryC.java 2008-11-12 13:15:50 UTC (rev 87) @@ -18,9 +18,9 @@ * * @author TMAPI <a href="http://www.tmapi.org">tmapi.org</a> * @author Kal Ahmed - * @version $Rev:$ - $Date:$ + * @version $Rev$ - $Date$ */ -public class TopicMapSystemFactoryC extends TopicMapSystenFactoryTestBase { +public class TopicMapSystemFactoryC extends TopicMapSystemFactoryTestBase { /** * @param TopicMapSystemFactoryTest */ Added: trunk/src/test/java/org/tmapi/core/TopicMapSystemFactoryTestBase.java =================================================================== --- trunk/src/test/java/org/tmapi/core/TopicMapSystemFactoryTestBase.java (rev 0) +++ trunk/src/test/java/org/tmapi/core/TopicMapSystemFactoryTestBase.java 2008-11-12 13:15:50 UTC (rev 87) @@ -0,0 +1,71 @@ +/* + * The Topic Maps API (TMAPI) was created collectively by + * the membership of the tmapi-discuss mailing list + * <http://lists.sourceforge.net/mailman/listinfo/tmapi-discuss>, + * is hereby released into the public domain; and comes with + * NO WARRANTY. + * + * No one owns TMAPI: you may use it freely in both commercial and + * non-commercial applications, bundle it with your software + * distribution, include it on a CD-ROM, list the source code in a + * book, mirror the documentation at your own web site, or use it in + * any other way you see fit. + */ +package org.tmapi.core; + +import org.tmapi.core.TMAPIException; +import org.tmapi.core.TopicMapSystem; +import org.tmapi.core.TopicMapSystemFactory; + +/** + * Base class for all test factories. + * + * @author TMAPI <a href="http://www.tmapi.org">tmapi.org</a> + * @author Kal Ahmed + * @version $Rev$ - $Date$ + */ +public class TopicMapSystemFactoryTestBase extends TopicMapSystemFactory { + + TopicMapSystemFactoryTestBase() { + // TODO Auto-generated constructor stub + } + + @Override + public boolean getFeature(String featureName) + throws FeatureNotRecognizedException { + // TODO Auto-generated method stub + return false; + } + + @Override + public Object getProperty(String propertyName) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean hasFeature(String featureName) { + // TODO Auto-generated method stub + return false; + } + + @Override + public TopicMapSystem newTopicMapSystem() throws TMAPIException { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setFeature(String featureName, boolean enable) + throws FeatureNotSupportedException, FeatureNotRecognizedException { + // TODO Auto-generated method stub + + } + + @Override + public void setProperty(String propertyName, Object value) { + // TODO Auto-generated method stub + + } + +} \ No newline at end of file Property changes on: trunk/src/test/java/org/tmapi/core/TopicMapSystemFactoryTestBase.java ___________________________________________________________________ Added: svn:keywords + Rev Date Id Added: svn:eol-style + native Deleted: trunk/src/test/java/org/tmapi/core/TopicMapSystenFactoryTestBase.java =================================================================== --- trunk/src/test/java/org/tmapi/core/TopicMapSystenFactoryTestBase.java 2008-11-04 20:33:48 UTC (rev 86) +++ trunk/src/test/java/org/tmapi/core/TopicMapSystenFactoryTestBase.java 2008-11-12 13:15:50 UTC (rev 87) @@ -1,71 +0,0 @@ -/* - * The Topic Maps API (TMAPI) was created collectively by - * the membership of the tmapi-discuss mailing list - * <http://lists.sourceforge.net/mailman/listinfo/tmapi-discuss>, - * is hereby released into the public domain; and comes with - * NO WARRANTY. - * - * No one owns TMAPI: you may use it freely in both commercial and - * non-commercial applications, bundle it with your software - * distribution, include it on a CD-ROM, list the source code in a - * book, mirror the documentation at your own web site, or use it in - * any other way you see fit. - */ -package org.tmapi.core; - -import org.tmapi.core.TMAPIException; -import org.tmapi.core.TopicMapSystem; -import org.tmapi.core.TopicMapSystemFactory; - -/** - * Base class for all test factories. - * - * @author TMAPI <a href="http://www.tmapi.org">tmapi.org</a> - * @author Kal Ahmed - * @version $Rev:$ - $Date:$ - */ -public class TopicMapSystenFactoryTestBase extends TopicMapSystemFactory { - - TopicMapSystenFactoryTestBase() { - // TODO Auto-generated constructor stub - } - - @Override - public boolean getFeature(String featureName) - throws FeatureNotRecognizedException { - // TODO Auto-generated method stub - return false; - } - - @Override - public Object getProperty(String propertyName) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean hasFeature(String featureName) { - // TODO Auto-generated method stub - return false; - } - - @Override - public TopicMapSystem newTopicMapSystem() throws TMAPIException { - // TODO Auto-generated method stub - return null; - } - - @Override - public void setFeature(String featureName, boolean enable) - throws FeatureNotSupportedException, FeatureNotRecognizedException { - // TODO Auto-generated method stub - - } - - @Override - public void setProperty(String propertyName, Object value) { - // TODO Auto-generated method stub - - } - -} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |