You can subscribe to this list here.
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(29) |
Sep
(4) |
Oct
|
Nov
(12) |
Dec
(1) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2009 |
Jan
(1) |
Feb
(4) |
Mar
(4) |
Apr
|
May
(2) |
Jun
(4) |
Jul
(9) |
Aug
(2) |
Sep
|
Oct
(10) |
Nov
|
Dec
|
| 2010 |
Jan
(12) |
Feb
(20) |
Mar
(17) |
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
(1) |
Sep
(7) |
Oct
|
Nov
|
Dec
|
|
From: <jos...@us...> - 2008-11-25 20:16:49
|
Revision: 91
http://tmapi.svn.sourceforge.net/tmapi/?rev=91&view=rev
Author: joschmidt
Date: 2008-11-25 20:16:45 +0000 (Tue, 25 Nov 2008)
Log Message:
-----------
Updated docs section regarding NULL handling in resolve()
Modified Paths:
--------------
trunk/src/main/java/org/tmapi/core/Locator.java
Modified: trunk/src/main/java/org/tmapi/core/Locator.java
===================================================================
--- trunk/src/main/java/org/tmapi/core/Locator.java 2008-11-25 20:15:03 UTC (rev 90)
+++ trunk/src/main/java/org/tmapi/core/Locator.java 2008-11-25 20:16:45 UTC (rev 91)
@@ -45,6 +45,7 @@
*
* @param reference The reference which should be resolved against this locator.
* @return A locator representing an absolute IRI.
+ * @throws IllegalArgumentException If <tt>reference</tt> is <tt>null</tt>.
*/
public Locator resolve(String reference);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jos...@us...> - 2008-11-25 20:15:06
|
Revision: 90
http://tmapi.svn.sourceforge.net/tmapi/?rev=90&view=rev
Author: joschmidt
Date: 2008-11-25 20:15:03 +0000 (Tue, 25 Nov 2008)
Log Message:
-----------
Updated docs section regarding NULL handling in addItemIdentifier() and removeItemIdentifier()
Modified Paths:
--------------
trunk/src/main/java/org/tmapi/core/Construct.java
Modified: trunk/src/main/java/org/tmapi/core/Construct.java
===================================================================
--- trunk/src/main/java/org/tmapi/core/Construct.java 2008-11-13 18:44:41 UTC (rev 89)
+++ trunk/src/main/java/org/tmapi/core/Construct.java 2008-11-25 20:15:03 UTC (rev 90)
@@ -80,13 +80,15 @@
* @param itemIdentifier The item identifier to be added; must not be <tt>null</tt>.
* @throws IdentityConstraintException If another construct has an item
* identifier which is equal to <tt>itemIdentifier</tt>.
+ * @throws ModelConstraintException If the item identifier is <tt>null</tt>.
*/
public void addItemIdentifier(Locator itemIdentifier);
/**
* Removes an item identifier.
*
- * @param itemIdentifier The item identifier to be removed.
+ * @param itemIdentifier The item identifier to be removed from this construct,
+ * if present (<tt>null</tt> is ignored).
*/
public void removeItemIdentifier(Locator itemIdentifier);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lh...@us...> - 2008-11-13 18:44:48
|
Revision: 89
http://tmapi.svn.sourceforge.net/tmapi/?rev=89&view=rev
Author: lheuer
Date: 2008-11-13 18:44:41 +0000 (Thu, 13 Nov 2008)
Log Message:
-----------
- Illegal occurrence creation catches the ModelConstraintException instead of general Exception
Detected by Stefan Kesberg, thanks
Modified Paths:
--------------
trunk/src/test/java/org/tmapi/core/TestTopic.java
Modified: trunk/src/test/java/org/tmapi/core/TestTopic.java
===================================================================
--- trunk/src/test/java/org/tmapi/core/TestTopic.java 2008-11-12 13:28:22 UTC (rev 88)
+++ trunk/src/test/java/org/tmapi/core/TestTopic.java 2008-11-13 18:44:41 UTC (rev 89)
@@ -483,7 +483,7 @@
topic.createOccurrence(createTopic(), (String)null);
fail("createOccurrence(topic, (String)null) is illegal");
}
- catch (Exception ex) {
+ catch (ModelConstraintException ex) {
// noop.
}
}
@@ -494,7 +494,7 @@
topic.createOccurrence(createTopic(), (Locator)null);
fail("createOccurrence(topic, (Locator)null) is illegal");
}
- catch (Exception ex) {
+ catch (ModelConstraintException ex) {
// noop.
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lh...@us...> - 2008-11-12 13:28:24
|
Revision: 88
http://tmapi.svn.sourceforge.net/tmapi/?rev=88&view=rev
Author: lheuer
Date: 2008-11-12 13:28:22 +0000 (Wed, 12 Nov 2008)
Log Message:
-----------
Added newline at the EOF
Modified Paths:
--------------
trunk/src/test/java/org/tmapi/core/TopicMapSystemFactoryTestBase.java
Modified: trunk/src/test/java/org/tmapi/core/TopicMapSystemFactoryTestBase.java
===================================================================
--- trunk/src/test/java/org/tmapi/core/TopicMapSystemFactoryTestBase.java 2008-11-12 13:15:50 UTC (rev 87)
+++ trunk/src/test/java/org/tmapi/core/TopicMapSystemFactoryTestBase.java 2008-11-12 13:28:22 UTC (rev 88)
@@ -68,4 +68,4 @@
}
-}
\ No newline at end of file
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
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.
|
|
From: <jos...@us...> - 2008-11-04 20:33:55
|
Revision: 86
http://tmapi.svn.sourceforge.net/tmapi/?rev=86&view=rev
Author: joschmidt
Date: 2008-11-04 20:33:48 +0000 (Tue, 04 Nov 2008)
Log Message:
-----------
mergeIn(): Extended the comment section regarding the case this.equals(other)
Modified Paths:
--------------
trunk/src/main/java/org/tmapi/core/Topic.java
trunk/src/main/java/org/tmapi/core/TopicMap.java
Modified: trunk/src/main/java/org/tmapi/core/Topic.java
===================================================================
--- trunk/src/main/java/org/tmapi/core/Topic.java 2008-11-03 15:04:55 UTC (rev 85)
+++ trunk/src/main/java/org/tmapi/core/Topic.java 2008-11-04 20:33:48 UTC (rev 86)
@@ -479,6 +479,9 @@
* the {@link TopicMap}.
* </p>
* <p>
+ * If <tt>this.equals(other)</tt> no changes are made to the topic.
+ * </p>
+ * <p>
* NOTE: The other topic MUST belong to the same {@link TopicMap} instance
* as this topic!
* </p>
Modified: trunk/src/main/java/org/tmapi/core/TopicMap.java
===================================================================
--- trunk/src/main/java/org/tmapi/core/TopicMap.java 2008-11-03 15:04:55 UTC (rev 85)
+++ trunk/src/main/java/org/tmapi/core/TopicMap.java 2008-11-04 20:33:48 UTC (rev 86)
@@ -222,7 +222,7 @@
public void close();
/**
- * Merges the topic map <code>other</code> into this topic map.
+ * Merges the topic map <tt>other</tt> into this topic map.
* <p>
* All {@link Topic}s and {@link Association}s and all of their contents in
* <tt>other</tt> will be added to this topic map.
@@ -232,7 +232,12 @@
* topic map as defined by the
* <a href="http://www.isotopicmaps.org/sam/sam-model/#d0e1862">Topic Maps - Data Model (TMDM) merging rules</a>.
* </p>
+ * <p>
* The merge process will not modify <tt>other</tt> in any way.
+ * </p>
+ * <p>
+ * If <tt>this.equals(other)</tt> no changes are made to the topic map.
+ * </p>
*
* @param other The topic map to be merged with this topic map instance.
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lh...@us...> - 2008-11-03 15:04:58
|
Revision: 85
http://tmapi.svn.sourceforge.net/tmapi/?rev=85&view=rev
Author: lheuer
Date: 2008-11-03 15:04:55 +0000 (Mon, 03 Nov 2008)
Log Message:
-----------
Fixed bug #2219122 ("Better description for Construct.getId()")
Modified Paths:
--------------
trunk/src/main/java/org/tmapi/core/Construct.java
Modified: trunk/src/main/java/org/tmapi/core/Construct.java
===================================================================
--- trunk/src/main/java/org/tmapi/core/Construct.java 2008-11-01 16:38:35 UTC (rev 84)
+++ trunk/src/main/java/org/tmapi/core/Construct.java 2008-11-03 15:04:55 UTC (rev 85)
@@ -47,7 +47,11 @@
/**
* Returns the identifier of this construct.
*
- * This property has no representation in the Topic Maps - Data Model.
+ * This property has no representation in the Topic Maps - Data Model.
+ * <p>
+ * The ID can be anything, so long as no other {@link Construct} in the
+ * same topic map has the same ID.
+ * </p>
*
* @return An identifier which identifies this construct uniquely within
* a topic map.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lh...@us...> - 2008-11-01 16:38:44
|
Revision: 84
http://tmapi.svn.sourceforge.net/tmapi/?rev=84&view=rev
Author: lheuer
Date: 2008-11-01 16:38:35 +0000 (Sat, 01 Nov 2008)
Log Message:
-----------
Changed parameter naming:
iid -> itemIdentifier
sid -> subjectIdentifier
slo -> subjectLocator
(suggested by Marcel Hoyer)
Modified Paths:
--------------
trunk/src/main/java/org/tmapi/core/Construct.java
trunk/src/main/java/org/tmapi/core/Topic.java
trunk/src/main/java/org/tmapi/core/TopicMap.java
Modified: trunk/src/main/java/org/tmapi/core/Construct.java
===================================================================
--- trunk/src/main/java/org/tmapi/core/Construct.java 2008-11-01 16:33:16 UTC (rev 83)
+++ trunk/src/main/java/org/tmapi/core/Construct.java 2008-11-01 16:38:35 UTC (rev 84)
@@ -73,18 +73,18 @@
* If at least one of the two objects is not a {@link Topic}, an
* {@link IdentityConstraintException} must be reported.
*
- * @param iid The item identifier to be added; must not be <tt>null</tt>.
+ * @param itemIdentifier The item identifier to be added; must not be <tt>null</tt>.
* @throws IdentityConstraintException If another construct has an item
- * identifier which is equal to <tt>iid</tt>.
+ * identifier which is equal to <tt>itemIdentifier</tt>.
*/
- public void addItemIdentifier(Locator iid);
+ public void addItemIdentifier(Locator itemIdentifier);
/**
* Removes an item identifier.
*
- * @param iid The item identifier to be removed.
+ * @param itemIdentifier The item identifier to be removed.
*/
- public void removeItemIdentifier(Locator iid);
+ public void removeItemIdentifier(Locator itemIdentifier);
/**
* Deletes this construct from its parent container.
Modified: trunk/src/main/java/org/tmapi/core/Topic.java
===================================================================
--- trunk/src/main/java/org/tmapi/core/Topic.java 2008-11-01 16:33:16 UTC (rev 83)
+++ trunk/src/main/java/org/tmapi/core/Topic.java 2008-11-01 16:38:35 UTC (rev 84)
@@ -45,7 +45,7 @@
*
* @see org.tmapi.core.Construct#addItemIdentifier(org.tmapi.core.Locator)
*/
- public void addItemIdentifier(Locator iid);
+ public void addItemIdentifier(Locator itemIdentifier);
/**
* Returns the subject identifiers assigned to this topic.
@@ -66,19 +66,19 @@
* an {@link IdentityConstraintException} is thrown.
* </p>
*
- * @param sid The subject identifier to be added; must not be <tt>null</tt>.
+ * @param subjectIdentifier The subject identifier to be added; must not be <tt>null</tt>.
* @throws IdentityConstraintException If the feature "automerge" is
* disabled and adding the subject identifier would make this
* topic represent the same subject as another topic.
*/
- public void addSubjectIdentifier(Locator sid);
+ public void addSubjectIdentifier(Locator subjectIdentifier);
/**
* Removes a subject identifier from this topic.
*
- * @param sid The subject identifier to be removed.
+ * @param subjectIdentifier The subject identifier to be removed.
*/
- public void removeSubjectIdentifier(Locator sid);
+ public void removeSubjectIdentifier(Locator subjectIdentifier);
/**
* Returns the subject locators assigned to this topic.
@@ -99,19 +99,19 @@
* an {@link IdentityConstraintException} is thrown.
* </p>
*
- * @param slo The subject locator to be added; must not be <tt>null</tt>.
+ * @param subjectLocator The subject locator to be added; must not be <tt>null</tt>.
* @throws IdentityConstraintException If the feature "automerge" is
* disabled and adding the subject locator would make this
* topic represent the same subject as another topic.
*/
- public void addSubjectLocator(Locator slo);
+ public void addSubjectLocator(Locator subjectLocator);
/**
* Removes a subject locator from this topic.
*
- * @param slo The subject locator to be removed.
+ * @param subjectLocator The subject locator to be removed.
*/
- public void removeSubjectLocator(Locator slo);
+ public void removeSubjectLocator(Locator subjectLocator);
/**
* Returns the names of this topic.
Modified: trunk/src/main/java/org/tmapi/core/TopicMap.java
===================================================================
--- trunk/src/main/java/org/tmapi/core/TopicMap.java 2008-11-01 16:33:16 UTC (rev 83)
+++ trunk/src/main/java/org/tmapi/core/TopicMap.java 2008-11-01 16:38:35 UTC (rev 84)
@@ -59,11 +59,11 @@
* returns <tt>null</tt>.
* </p>
*
- * @param sid The subject identifier of the topic to be returned.
+ * @param subjectIdentifier The subject identifier of the topic to be returned.
* @return A topic with the specified subject identifier or <tt>null</tt>
* if no such topic exists in the topic map.
*/
- public Topic getTopicBySubjectIdentifier(Locator sid);
+ public Topic getTopicBySubjectIdentifier(Locator subjectIdentifier);
/**
* Returns a topic by its subject locator.
@@ -72,20 +72,20 @@
* returns <tt>null</tt>.
* </p>
*
- * @param slo The subject locator of the topic to be returned.
+ * @param subjectLocator The subject locator of the topic to be returned.
* @return A topic with the specified subject locator or <tt>null</tt>
* if no such topic exists in the topic map.
*/
- public Topic getTopicBySubjectLocator(Locator slo);
+ public Topic getTopicBySubjectLocator(Locator subjectLocator);
/**
* Returns a {@link Construct} by its item identifier.
*
- * @param iid The item identifier of the construct to be returned.
+ * @param itemIdentifier The item identifier of the construct to be returned.
* @return A construct with the specified item identifier or <tt>null</tt>
* if no such construct exists in the topic map.
*/
- public Construct getConstructByItemIdentifier(Locator iid);
+ public Construct getConstructByItemIdentifier(Locator itemIdentifier);
/**
* Returns a {@link Construct} by its (system specific) identifier.
@@ -123,11 +123,11 @@
* the subject identifier is created.
* </p>
*
- * @param sid The subject identifier the topic should contain.
+ * @param subjectIdentifier The subject identifier the topic should contain.
* @return A {@link Topic} instance with the specified subject identifier.
- * @throws ModelConstraintException If the subject identifier <tt>sid</tt> is <tt>null</tt>.
+ * @throws ModelConstraintException If the subject identifier <tt>subjectIdentifier</tt> is <tt>null</tt>.
*/
- public Topic createTopicBySubjectIdentifier(Locator sid);
+ public Topic createTopicBySubjectIdentifier(Locator subjectIdentifier);
/**
* Returns a {@link Topic} instance with the specified subject locator.
@@ -136,11 +136,11 @@
* {@link Topic} instance with the specified subject locator.
* </p>
*
- * @param slo The subject locator the topic should contain.
+ * @param subjectLocator The subject locator the topic should contain.
* @return A {@link Topic} instance with the specified subject locator.
- * @throws ModelConstraintException If the subject locator <tt>slo</tt> is <tt>null</tt>.
+ * @throws ModelConstraintException If the subject locator <tt>subjectLocator</tt> is <tt>null</tt>.
*/
- public Topic createTopicBySubjectLocator(Locator slo);
+ public Topic createTopicBySubjectLocator(Locator subjectLocator);
/**
* Returns a {@link Topic} instance with the specified item identifier.
@@ -158,13 +158,13 @@
* the item identifier is created.
* </p>
*
- * @param iid The item identifier the topic should contain.
+ * @param itemIdentifier The item identifier the topic should contain.
* @return A {@link Topic} instance with the specified item identifier.
- * @throws ModelConstraintException If the item identifier <tt>iid</tt> is <tt>null</tt>.
+ * @throws ModelConstraintException If the item identifier <tt>itemIdentifier</tt> is <tt>null</tt>.
* @throws IdentityConstraintException If an other {@link Construct} with the
* specified item identifier exists which is not a {@link Topic}.
*/
- public Topic createTopicByItemIdentifier(Locator iid);
+ public Topic createTopicByItemIdentifier(Locator itemIdentifier);
/**
* Returns a {@link Topic} instance with an automatically generated item
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lh...@us...> - 2008-11-01 16:33:45
|
Revision: 83
http://tmapi.svn.sourceforge.net/tmapi/?rev=83&view=rev
Author: lheuer
Date: 2008-11-01 16:33:16 +0000 (Sat, 01 Nov 2008)
Log Message:
-----------
Added comment for application/x-www-form-urlencoded test case
Modified Paths:
--------------
trunk/src/test/java/org/tmapi/core/TestLocator.java
Modified: trunk/src/test/java/org/tmapi/core/TestLocator.java
===================================================================
--- trunk/src/test/java/org/tmapi/core/TestLocator.java 2008-09-28 16:50:56 UTC (rev 82)
+++ trunk/src/test/java/org/tmapi/core/TestLocator.java 2008-11-01 16:33:16 UTC (rev 83)
@@ -27,6 +27,8 @@
}
public void testNormalization() {
+ // Reference using "application/x-www-form-urlencoded"
+ // C.f. <http://en.wikipedia.org/wiki/Percent-encoding#The_application.2Fx-www-form-urlencoded_type>
final Locator loc = _tm.createLocator("http://www.example.org/test+me/");
assertEquals("http://www.example.org/test me/", loc.getReference());
assertEquals("http://www.example.org/test%20me/", loc.toExternalForm());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jos...@us...> - 2008-09-28 16:51:07
|
Revision: 82
http://tmapi.svn.sourceforge.net/tmapi/?rev=82&view=rev
Author: joschmidt
Date: 2008-09-28 16:50:56 +0000 (Sun, 28 Sep 2008)
Log Message:
-----------
prologue: changed "futher" to "further"
Modified Paths:
--------------
trunk/src/main/java/org/tmapi/index/TypeInstanceIndex.java
Modified: trunk/src/main/java/org/tmapi/index/TypeInstanceIndex.java
===================================================================
--- trunk/src/main/java/org/tmapi/index/TypeInstanceIndex.java 2008-09-16 12:32:45 UTC (rev 81)
+++ trunk/src/main/java/org/tmapi/index/TypeInstanceIndex.java 2008-09-28 16:50:56 UTC (rev 82)
@@ -28,7 +28,7 @@
* This index provides access to {@link Topic}s used in
* <a href="http://www.isotopicmaps.org/sam/sam-model/#sect-types">type-instance</a>
* relationships or as type of a {@link org.tmapi.core.Typed} construct.
- * Futher, the retrieval of {@link Association}s, {@link Role}s,
+ * Further, the retrieval of {@link Association}s, {@link Role}s,
* {@link Occurrence}s, and {@link Name}s by their <tt>type</tt> property is
* supported.
* </p>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lh...@us...> - 2008-09-16 12:32:35
|
Revision: 81
http://tmapi.svn.sourceforge.net/tmapi/?rev=81&view=rev
Author: lheuer
Date: 2008-09-16 12:32:45 +0000 (Tue, 16 Sep 2008)
Log Message:
-----------
Fixed JavaDocs
Modified Paths:
--------------
trunk/src/main/java/org/tmapi/core/Name.java
Modified: trunk/src/main/java/org/tmapi/core/Name.java
===================================================================
--- trunk/src/main/java/org/tmapi/core/Name.java 2008-09-04 13:15:35 UTC (rev 80)
+++ trunk/src/main/java/org/tmapi/core/Name.java 2008-09-16 12:32:45 UTC (rev 81)
@@ -145,7 +145,7 @@
public Variant createVariant(Locator value, Collection<Topic> scope);
/**
- * Creates a {@link Variant} of this topic name with the specified IRI
+ * Creates a {@link Variant} of this topic name with the specified
* <tt>value</tt>, <tt>datatype</tt>, and <tt>scope</tt>.
* <p>
* The newly created {@link Variant} will have the datatype specified by
@@ -167,7 +167,7 @@
public Variant createVariant(String value, Locator datatype, Topic... scope);
/**
- * Creates a {@link Variant} of this topic name with the specified IRI
+ * Creates a {@link Variant} of this topic name with the specified
* <tt>value</tt>, <tt>datatype</tt>, and <tt>scope</tt>.
* <p>
* The newly created {@link Variant} will have the datatype specified by
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lh...@us...> - 2008-09-04 13:15:26
|
Revision: 80
http://tmapi.svn.sourceforge.net/tmapi/?rev=80&view=rev
Author: lheuer
Date: 2008-09-04 13:15:35 +0000 (Thu, 04 Sep 2008)
Log Message:
-----------
Updated JUnit from 4.4 to 4.5
Added Paths:
-----------
trunk/lib/junit-4.5.jar
Removed Paths:
-------------
trunk/lib/junit-4.4.jar
Property changes on: trunk/lib/junit-4.5.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lh...@us...> - 2008-09-04 13:13:32
|
Revision: 79
http://tmapi.svn.sourceforge.net/tmapi/?rev=79&view=rev
Author: lheuer
Date: 2008-09-04 13:13:39 +0000 (Thu, 04 Sep 2008)
Log Message:
-----------
Fixed DatatypeAware test: Canonical representation of decimal values is accepted
Modified Paths:
--------------
trunk/src/test/java/org/tmapi/core/AbstractTestDatatypeAware.java
Modified: trunk/src/test/java/org/tmapi/core/AbstractTestDatatypeAware.java
===================================================================
--- trunk/src/test/java/org/tmapi/core/AbstractTestDatatypeAware.java 2008-08-26 16:58:54 UTC (rev 78)
+++ trunk/src/test/java/org/tmapi/core/AbstractTestDatatypeAware.java 2008-09-04 13:13:39 UTC (rev 79)
@@ -154,7 +154,10 @@
final BigDecimal value = BigDecimal.TEN;
final DatatypeAware dt = getDatatypeAware();
dt.setValue(value);
- assertEquals(value.toString(), dt.getValue());
+ final String val = dt.getValue();
+ if (!"10".equals(val) && !"10.0".equals(val)) {
+ fail("Expected either '10' or the canonical representation '10.0'");
+ }
assertEquals(_xsdDecimal, dt.getDatatype());
assertEquals(value, dt.decimalValue());
assertEquals(BigInteger.TEN, dt.integerValue());
@@ -167,7 +170,10 @@
final BigDecimal value = BigDecimal.TEN;
final DatatypeAware dt = getDatatypeAware();
dt.setValue(value.toString(), _xsdDecimal);
- assertEquals(value.toString(), dt.getValue());
+ final String val = dt.getValue();
+ if (!"10".equals(val) && !"10.0".equals(val)) {
+ fail("Expected either '10' or the canonical representation '10.0'");
+ }
assertEquals(_xsdDecimal, dt.getDatatype());
assertEquals(value, dt.decimalValue());
assertEquals(BigInteger.TEN, dt.integerValue());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lh...@us...> - 2008-08-26 16:58:46
|
Revision: 78
http://tmapi.svn.sourceforge.net/tmapi/?rev=78&view=rev
Author: lheuer
Date: 2008-08-26 16:58:54 +0000 (Tue, 26 Aug 2008)
Log Message:
-----------
Tagged release 2.0a1
Added Paths:
-----------
tags/release-2_0_a1/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lh...@us...> - 2008-08-26 13:41:45
|
Revision: 77
http://tmapi.svn.sourceforge.net/tmapi/?rev=77&view=rev
Author: lheuer
Date: 2008-08-26 13:41:52 +0000 (Tue, 26 Aug 2008)
Log Message:
-----------
Updated changes to correct date
Modified Paths:
--------------
trunk/CHANGES.txt
Modified: trunk/CHANGES.txt
===================================================================
--- trunk/CHANGES.txt 2008-08-25 21:12:42 UTC (rev 76)
+++ trunk/CHANGES.txt 2008-08-26 13:41:52 UTC (rev 77)
@@ -2,7 +2,7 @@
TMAPI Changes
=============
-TMAPI 2.0 alpha1 - 2008.08.xx
+TMAPI 2.0 alpha1 - 2008-08-26
-----------------------------
* Initial release with the new code base
* Aligned to Topic Maps - Data Model (TMDM)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jos...@us...> - 2008-08-25 21:32:54
|
Revision: 76
http://tmapi.svn.sourceforge.net/tmapi/?rev=76&view=rev
Author: joschmidt
Date: 2008-08-25 21:12:42 +0000 (Mon, 25 Aug 2008)
Log Message:
-----------
Added the themes expl. paragraph to the comment section for each createVariant() method.
Modified Paths:
--------------
trunk/src/main/java/org/tmapi/core/Name.java
Modified: trunk/src/main/java/org/tmapi/core/Name.java
===================================================================
--- trunk/src/main/java/org/tmapi/core/Name.java 2008-08-24 13:28:06 UTC (rev 75)
+++ trunk/src/main/java/org/tmapi/core/Name.java 2008-08-25 21:12:42 UTC (rev 76)
@@ -67,10 +67,14 @@
* The newly created {@link Variant} will have the datatype
* <a href="http://www.w3.org/TR/xmlschema-2/#string">xsd:string</a>.
* </p>
+ * <p>
+ * The newly created {@link Variant} will contain all themes from the parent name
+ * and the themes specified in <tt>scope</tt>.
+ * </p>
*
* @param value The string value.
* @param scope An array (length >= 1) of themes.
- * @return The newly created {@link Variant}
+ * @return The newly created {@link Variant}.
* @throws ModelConstraintException If the <tt>value</tt> is <tt>null</tt>,
* or the scope of the variant would not be a true superset of the
* name's scope.
@@ -84,10 +88,14 @@
* The newly created {@link Variant} will have the datatype
* <a href="http://www.w3.org/TR/xmlschema-2/#string">xsd:string</a>.
* </p>
+ * <p>
+ * The newly created {@link Variant} will contain all themes from the parent name
+ * and the themes specified in <tt>scope</tt>.
+ * </p>
*
* @param value The string value.
* @param scope A collection (size >= 1) of themes.
- * @return The newly created {@link Variant}
+ * @return The newly created {@link Variant}.
* @throws ModelConstraintException If the <tt>value</tt> is <tt>null</tt>,
* or the scope of the variant would not be a true superset of the
* name's scope.
@@ -101,10 +109,14 @@
* The newly created {@link Variant} will have the datatype
* <a href="http://www.w3.org/TR/xmlschema-2/#anyURI">xsd:anyURI</a>.
* </p>
+ * <p>
+ * The newly created {@link Variant} will contain all themes from the parent name
+ * and the themes specified in <tt>scope</tt>.
+ * </p>
*
* @param value A locator which represents an IRI.
* @param scope An array (length >= 1) of themes.
- * @return The newly created {@link Variant}
+ * @return The newly created {@link Variant}.
* @throws ModelConstraintException If the <tt>value</tt> is <tt>null</tt>,
* or the scope of the variant would not be a true superset of the
* name's scope.
@@ -118,10 +130,14 @@
* The newly created {@link Variant} will have the datatype
* <a href="http://www.w3.org/TR/xmlschema-2/#anyURI">xsd:anyURI</a>.
* </p>
+ * <p>
+ * The newly created {@link Variant} will contain all themes from the parent name
+ * and the themes specified in <tt>scope</tt>.
+ * </p>
*
* @param value A locator which represents an IRI.
* @param scope A collection (size >= 1) of themes.
- * @return The newly created {@link Variant}
+ * @return The newly created {@link Variant}.
* @throws ModelConstraintException If the <tt>value</tt> is <tt>null</tt>,
* or the scope of the variant would not be a true superset of the
* name's scope.
@@ -135,11 +151,15 @@
* The newly created {@link Variant} will have the datatype specified by
* <tt>datatype</tt>.
* </p>
+ * <p>
+ * The newly created {@link Variant} will contain all themes from the parent name
+ * and the themes specified in <tt>scope</tt>.
+ * </p>
*
* @param value A lexical string representation of the value.
* @param datatype A locator indicating the datatype of the <tt>value</tt>.
* @param scope An array (length >= 1) of themes.
- * @return The newly created {@link Variant}
+ * @return The newly created {@link Variant}.
* @throws ModelConstraintException If the <tt>value</tt> or <tt>datatype</tt>
* is <tt>null</tt>, or the scope of the variant would not be a
* true superset of the name's scope.
@@ -153,11 +173,15 @@
* The newly created {@link Variant} will have the datatype specified by
* <tt>datatype</tt>.
* </p>
+ * <p>
+ * The newly created {@link Variant} will contain all themes from the parent name
+ * and the themes specified in <tt>scope</tt>.
+ * </p>
*
* @param value A lexical string representation of the value.
* @param datatype A locator indicating the datatype of the <tt>value</tt>.
* @param scope A collection (size >= 1) of themes.
- * @return The newly created {@link Variant}
+ * @return The newly created {@link Variant}.
* @throws ModelConstraintException If the <tt>value</tt> or <tt>datatype</tt>
* is <tt>null</tt>, or the scope of the variant would not be a
* true superset of the name's scope.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jos...@us...> - 2008-08-24 13:27:58
|
Revision: 75
http://tmapi.svn.sourceforge.net/tmapi/?rev=75&view=rev
Author: joschmidt
Date: 2008-08-24 13:28:06 +0000 (Sun, 24 Aug 2008)
Log Message:
-----------
Typos and punctuation
Modified Paths:
--------------
trunk/src/main/java/org/tmapi/core/Topic.java
trunk/src/main/java/org/tmapi/core/TopicMap.java
trunk/src/main/java/org/tmapi/core/TopicMapSystem.java
Modified: trunk/src/main/java/org/tmapi/core/Topic.java
===================================================================
--- trunk/src/main/java/org/tmapi/core/Topic.java 2008-08-22 16:45:35 UTC (rev 74)
+++ trunk/src/main/java/org/tmapi/core/Topic.java 2008-08-24 13:28:06 UTC (rev 75)
@@ -155,7 +155,7 @@
* @param scope An optional array of themes, must not be <tt>null</tt>. If
* the array's length is <tt>0</tt>, the name will be
* in the unconstrained scope.
- * @return The newly created {@link Name}
+ * @return The newly created {@link Name}.
* @throws ModelConstraintException If either the <tt>type</tt>, the
* <tt>value</tt>, or <tt>scope</tt> is <tt>null</tt>.
*/
@@ -169,7 +169,7 @@
* @param value The string value of the name; MUST NOT be <tt>null</tt>.
* @param scope A collection of themes or <tt>null</tt> if the name should
* be in the unconstrained scope.
- * @return The newly created {@link Name}
+ * @return The newly created {@link Name}.
* @throws ModelConstraintException If either the <tt>type</tt>, the
* <tt>value</tt>, or <tt>scope</tt> is <tt>null</tt>.
*/
@@ -188,7 +188,7 @@
* @param scope An optional array of themes, must not be <tt>null</tt>. If
* the array's length is <tt>0</tt>, the name will be
* in the unconstrained scope.
- * @return The newly created {@link Name}
+ * @return The newly created {@link Name}.
* @throws ModelConstraintException If either the <tt>value</tt>, or
* <tt>scope</tt> is <tt>null</tt>.
*/
@@ -206,7 +206,7 @@
* @param value The string value of the name; MUST NOT be <tt>null</tt>.
* @param scope A collection of themes or <tt>null</tt> if the name should
* be in the unconstrained scope.
- * @return The newly created {@link Name}
+ * @return The newly created {@link Name}.
* @throws ModelConstraintException If either the <tt>value</tt>, or
* <tt>scope</tt> is <tt>null</tt>.
*/
Modified: trunk/src/main/java/org/tmapi/core/TopicMap.java
===================================================================
--- trunk/src/main/java/org/tmapi/core/TopicMap.java 2008-08-22 16:45:35 UTC (rev 74)
+++ trunk/src/main/java/org/tmapi/core/TopicMap.java 2008-08-24 13:28:06 UTC (rev 75)
@@ -188,7 +188,7 @@
* @param scope An optional array of themes, must not be <tt>null</tt>. If
* the array's length is <tt>0</tt>, the association will be
* in the unconstrained scope.
- * @return The newly created {@link Association}
+ * @return The newly created {@link Association}.
* @throws ModelConstraintException If either the <tt>type</tt> or
* <tt>scope</tt> is <tt>null</tt>.
*/
@@ -201,7 +201,7 @@
* @param type The association type, MUST NOT be <tt>null</tt>.
* @param scope A collection of themes or <tt>null</tt> if the association
* should be in the unconstrained scope.
- * @return The newly created {@link Association}
+ * @return The newly created {@link Association}.
* @throws ModelConstraintException If either the <tt>type</tt> or
* <tt>scope</tt> is <tt>null</tt>.
*/
Modified: trunk/src/main/java/org/tmapi/core/TopicMapSystem.java
===================================================================
--- trunk/src/main/java/org/tmapi/core/TopicMapSystem.java 2008-08-22 16:45:35 UTC (rev 74)
+++ trunk/src/main/java/org/tmapi/core/TopicMapSystem.java 2008-08-24 13:28:06 UTC (rev 75)
@@ -131,12 +131,12 @@
* subsequently.
* </p>
*
- * @param featureName The name of the feature to check
- * @return <tt>true</tt> if the named feature is enabled this TopicMapSystem
+ * @param featureName The name of the feature to check.
+ * @return <tt>true</tt> if the named feature is enabled for this TopicMapSystem
* instance; <tt>false</tt> if the named feature is disabled for
* this instance.
* @throws FeatureNotRecognizedException If the underlying implementation
- * does not recongnize the named feature.
+ * does not recognize the named feature.
*/
public boolean getFeature(String featureName)
throws FeatureNotRecognizedException;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jos...@us...> - 2008-08-22 16:45:25
|
Revision: 74
http://tmapi.svn.sourceforge.net/tmapi/?rev=74&view=rev
Author: joschmidt
Date: 2008-08-22 16:45:35 +0000 (Fri, 22 Aug 2008)
Log Message:
-----------
Fixed undisplayable character in class comment.
Modified Paths:
--------------
trunk/src/main/java/org/tmapi/core/ModelConstraintException.java
Modified: trunk/src/main/java/org/tmapi/core/ModelConstraintException.java
===================================================================
--- trunk/src/main/java/org/tmapi/core/ModelConstraintException.java 2008-08-22 16:44:08 UTC (rev 73)
+++ trunk/src/main/java/org/tmapi/core/ModelConstraintException.java 2008-08-22 16:45:35 UTC (rev 74)
@@ -15,7 +15,7 @@
/**
* This exception is used to report
- * <a href="http://www.isotopicmaps.org/sam/sam-model/">Topic Maps \x97 Data Model</a>
+ * <a href="http://www.isotopicmaps.org/sam/sam-model/">Topic Maps - Data Model</a>
* constraint violations.
*
* @author <a href="http://tmapi.org/">The TMAPI Project</a>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jos...@us...> - 2008-08-22 16:44:00
|
Revision: 73
http://tmapi.svn.sourceforge.net/tmapi/?rev=73&view=rev
Author: joschmidt
Date: 2008-08-22 16:44:08 +0000 (Fri, 22 Aug 2008)
Log Message:
-----------
Fixed typos in equals()
Modified Paths:
--------------
trunk/src/main/java/org/tmapi/core/Construct.java
Modified: trunk/src/main/java/org/tmapi/core/Construct.java
===================================================================
--- trunk/src/main/java/org/tmapi/core/Construct.java 2008-08-22 13:04:58 UTC (rev 72)
+++ trunk/src/main/java/org/tmapi/core/Construct.java 2008-08-22 16:44:08 UTC (rev 73)
@@ -98,7 +98,7 @@
* If <tt>other</tt> is not an instance of {@link Construct}, the return
* value is <tt>false</tt>.
*
- * Note: This equalitiy test does not reflect any equalitiy rule according
+ * Note: This equality test does not reflect any equality rule according
* to the <a href="http://www.isotopicmaps.org/sam/sam-model/">Topic Maps - Data Model (TMDM)</a>
* by intention.
*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lh...@us...> - 2008-08-22 13:04:49
|
Revision: 72
http://tmapi.svn.sourceforge.net/tmapi/?rev=72&view=rev
Author: lheuer
Date: 2008-08-22 13:04:58 +0000 (Fri, 22 Aug 2008)
Log Message:
-----------
Fixed build.xml
Modified Paths:
--------------
trunk/build.xml
Modified: trunk/build.xml
===================================================================
--- trunk/build.xml 2008-08-21 12:17:40 UTC (rev 71)
+++ trunk/build.xml 2008-08-22 13:04:58 UTC (rev 72)
@@ -95,12 +95,12 @@
<target name="internal.tests" depends="test">
<mkdir dir="tmp/META-INF/services"/>
<copy todir="tmp/META-INF/services">
- <fileset dir="${dir.test}">
+ <fileset dir="${dir.test}/org/tmapi/core">
<include name="org.tmapi.core.TopicMapSystemFactory"/>
</fileset>
</copy>
<jar jarfile="tmapi-test.jar" basedir="tmp"/>
- <junit
+ <junit
printsummary="true" showoutput="false"
errorProperty="test.failed" failureProperty="test.failed">
<classpath>
@@ -141,11 +141,11 @@
additionalparam="-author -version"
windowtitle="TMAPI v${dist.version}"
doctitle="TMAPI v${dist.version}">
- <!--
+<!--
<doclet name="net.gleamynode.apiviz.APIviz"
path="${dir.lib}/apiviz-1.1.3.jar">
</doclet>
- -->
+-->
<fileset dir="${dir.src}">
</fileset>
</javadoc>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lh...@us...> - 2008-08-21 12:17:31
|
Revision: 71
http://tmapi.svn.sourceforge.net/tmapi/?rev=71&view=rev
Author: lheuer
Date: 2008-08-21 12:17:40 +0000 (Thu, 21 Aug 2008)
Log Message:
-----------
Fixed malformed tag </tt --> </tt>
Modified Paths:
--------------
trunk/src/main/java/org/tmapi/core/Construct.java
Modified: trunk/src/main/java/org/tmapi/core/Construct.java
===================================================================
--- trunk/src/main/java/org/tmapi/core/Construct.java 2008-08-20 18:41:50 UTC (rev 70)
+++ trunk/src/main/java/org/tmapi/core/Construct.java 2008-08-21 12:17:40 UTC (rev 71)
@@ -75,7 +75,7 @@
*
* @param iid The item identifier to be added; must not be <tt>null</tt>.
* @throws IdentityConstraintException If another construct has an item
- * identifier which is equal to <tt>iid</tt.
+ * identifier which is equal to <tt>iid</tt>.
*/
public void addItemIdentifier(Locator iid);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lh...@us...> - 2008-08-20 18:41:55
|
Revision: 70
http://tmapi.svn.sourceforge.net/tmapi/?rev=70&view=rev
Author: lheuer
Date: 2008-08-20 18:41:50 +0000 (Wed, 20 Aug 2008)
Log Message:
-----------
Build files for TMAPI 2.0 a1
Added Paths:
-----------
trunk/build.properties
trunk/build.xml
Added: trunk/build.properties
===================================================================
--- trunk/build.properties (rev 0)
+++ trunk/build.properties 2008-08-20 18:41:50 UTC (rev 70)
@@ -0,0 +1,5 @@
+version=2.0
+version_suffix=a1
+debug=off
+optimize=on
+
Added: trunk/build.xml
===================================================================
--- trunk/build.xml (rev 0)
+++ trunk/build.xml 2008-08-20 18:41:50 UTC (rev 70)
@@ -0,0 +1,224 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ====================================================================
+ 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.
+ ====================================================================
+
+ $Rev:$ - $Date:$
+-->
+<project name="TMAPI" default="jar" basedir=".">
+ <property file="build.properties"/>
+
+ <property name="dir.src" value="${basedir}/src/main/java"/>
+ <property name="dir.test" value="${basedir}/src/test/java"/>
+ <property name="dir.lib" value="${basedir}/lib"/>
+
+ <property name="lib.junit" value="${dir.lib}/junit-4.4.jar"/>
+
+ <target name="help">
+ <echo message="--------------------"/>
+ <echo message="TMAPI - Build file"/>
+ <echo message="--------------------"/>
+ <echo message=""/>
+ <echo message="Available targets:"/>
+ <echo message=""/>
+ <echo message=" jar Creates the jar (.index and .core)"/>
+ <echo message=" test.jar Creates the test suite jar (.index and .core)"/>
+ <echo message=" doc Creates the API documentation"/>
+ <echo message=" release Creates the jar and a distributable file"/>
+ </target>
+
+ <target name="init">
+ <property name="dist.version" value="${version}${version_suffix}"/>
+ <property name="dist.name" value="tmapi-${dist.version}"/>
+
+ <property name="tmapi.jar" value="${dist.name}.jar"/>
+ <property name="tmapi-tests.jar" value="${dist.name}-tests.jar"/>
+ <property name="tmapi.tar" value="${dist.name}.tar"/>
+ <property name="tmapi.tar.gz" value="${tmapi.tar}.gz"/>
+ <property name="tmapi.zip" value="${dist.name}.zip"/>
+
+ <property name="dir.build" value="${basedir}/build"/>
+ <property name="dir.dist.root" value="${dir.build}/dist"/>
+ <property name="dir.dist" value="${dir.dist.root}/${dist.name}"/>
+ <property name="dir.build.classes" value="${dir.build}/classes"/>
+ <property name="dir.build.tests" value="${dir.build}/tests"/>
+ <property name="dir.javadocs" value="${dir.dist}/docs/api"/>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Clean targets -->
+ <!-- =================================================================== -->
+ <target name="clean" depends="init">
+ <delete dir="${dir.build}"/>
+ <delete dir="${dir.javadocs}"/>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Prepares the build directory -->
+ <!-- =================================================================== -->
+ <target name="prepare" depends="init">
+ <mkdir dir="${dir.build}"/>
+ <mkdir dir="${dir.build.classes}"/>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Tests -->
+ <!-- =================================================================== -->
+ <target name="test" depends="compile">
+ <mkdir dir="${dir.build.tests}"/>
+ <javac destdir="${dir.build.tests}"
+ debug="${debug}"
+ optimize="${optimize}"
+ target="1.5">
+ <classpath>
+ <pathelement location="${dir.build.classes}"/>
+ <pathelement location="${lib.junit}"/>
+ </classpath>
+ <src path="${dir.test}"/>
+ </javac>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Internal Tests -->
+ <!-- =================================================================== -->
+ <target name="internal.tests" depends="test">
+ <mkdir dir="tmp/META-INF/services"/>
+ <copy todir="tmp/META-INF/services">
+ <fileset dir="${dir.test}">
+ <include name="org.tmapi.core.TopicMapSystemFactory"/>
+ </fileset>
+ </copy>
+ <jar jarfile="tmapi-test.jar" basedir="tmp"/>
+ <junit
+ printsummary="true" showoutput="false"
+ errorProperty="test.failed" failureProperty="test.failed">
+ <classpath>
+ <pathelement location="tmapi-test.jar"/>
+ <pathelement location="${dir.build.classes}"/>
+ <pathelement location="${dir.build.tests}"/>
+ </classpath>
+ <formatter type="plain"/>
+ <test name="org.tmapi.core.TestTopicMapSystemFactory"/>
+ </junit>
+ <fail message="Tests failed. Check test output." if="test.failed"/>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Compile source files -->
+ <!-- =================================================================== -->
+ <target name="compile" depends="clean, prepare">
+ <javac destdir="${dir.build.classes}"
+ debug="${debug}"
+ target="1.5">
+ <src path="${dir.src}"/>
+ </javac>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Creates the Java Docs -->
+ <!-- =================================================================== -->
+ <target name="doc" depends="init">
+ <mkdir dir="${dir.javadocs}"/>
+ <javadoc destdir="${dir.javadocs}"
+ packagenames="org.tmapi.*"
+ author="true"
+ version="true"
+ use="true"
+ splitindex="true"
+ noindex="false"
+ failonerror="true"
+ additionalparam="-author -version"
+ windowtitle="TMAPI v${dist.version}"
+ doctitle="TMAPI v${dist.version}">
+ <!--
+ <doclet name="net.gleamynode.apiviz.APIviz"
+ path="${dir.lib}/apiviz-1.1.3.jar">
+ </doclet>
+ -->
+ <fileset dir="${dir.src}">
+ </fileset>
+ </javadoc>
+
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Creates the jar -->
+ <!-- =================================================================== -->
+ <target name="jar" depends="compile">
+ <jar destfile="${dir.build}/${tmapi.jar}">
+ <fileset dir="${dir.build.classes}">
+ <include name="**/*.*"/>
+ </fileset>
+ <manifest>
+ <attribute name="Implementation-Title" value="TMAPI"/>
+ <attribute name="Implementation-Version" value="${dist.version}"/>
+ <attribute name="Implementation-URL" value="http://www.tmapi.org/"/>
+ </manifest>
+ </jar>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Creates the test jar -->
+ <!-- =================================================================== -->
+ <target name="test.jar" depends="test">
+ <jar destfile="${dir.build}/${tmapi-tests.jar}">
+ <fileset dir="${dir.build.tests}">
+ <include name="**/*.*"/>
+ </fileset>
+ <manifest>
+ <attribute name="Implementation-Title" value="TMAPI Tests"/>
+ <attribute name="Implementation-Version" value="${dist.version}"/>
+ <attribute name="Implementation-URL" value="http://www.tmapi.org/"/>
+ </manifest>
+ </jar>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Prepares a distribution -->
+ <!-- =================================================================== -->
+ <target name="dist" depends="jar, test.jar, doc">
+ <mkdir dir="${dir.dist}"/>
+
+ <copy todir="${dir.dist}" file="${dir.build}/${tmapi.jar}"/>
+ <copy todir="${dir.dist}" file="${dir.build}/${tmapi-tests.jar}"/>
+
+ <copy todir="${dir.dist}/src">
+ <fileset dir="${dir.src}"/>
+ </copy>
+ <copy todir="${dir.dist}/test">
+ <fileset dir="${dir.test}"/>
+ </copy>
+ <copy todir="${dir.dist}/lib" file="${lib.junit}"/>
+ <copy todir="${dir.dist}/lib" file="${dir.lib}/LICENSE.junit.html"/>
+
+ <copy todir="${dir.dist}" file="CHANGES.txt"/>
+ <copy todir="${dir.dist}" file="LICENSE.txt"/>
+ <copy todir="${dir.dist}" file="README.txt"/>
+ <copy todir="${dir.dist}" file="TMAPI-1.0_MIGRATION.txt"/>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Creates the distribution files (.zip and .tar.gz) -->
+ <!-- -->
+ <!-- Won't create the distribution files if a test fails -->
+ <!-- =================================================================== -->
+ <target name="release" depends="internal.tests, dist">
+ <tar destfile="${dir.dist.root}/${tmapi.tar}"
+ basedir="${dir.dist.root}"/>
+ <gzip src="${dir.dist.root}/${tmapi.tar}"
+ destfile="${dir.build}/${tmapi.tar.gz}" />
+ <delete file="${dir.dist.root}/${tmapi.tar}" />
+ <zip destfile="${dir.build}/${tmapi.zip}" basedir="${dir.dist.root}"/>
+ </target>
+</project>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lh...@us...> - 2008-08-20 15:15:06
|
Revision: 69
http://tmapi.svn.sourceforge.net/tmapi/?rev=69&view=rev
Author: lheuer
Date: 2008-08-20 15:15:15 +0000 (Wed, 20 Aug 2008)
Log Message:
-----------
Added initial CHANGES.txt
Added Paths:
-----------
trunk/CHANGES.txt
Added: trunk/CHANGES.txt
===================================================================
--- trunk/CHANGES.txt (rev 0)
+++ trunk/CHANGES.txt 2008-08-20 15:15:15 UTC (rev 69)
@@ -0,0 +1,8 @@
+=============
+TMAPI Changes
+=============
+
+TMAPI 2.0 alpha1 - 2008.08.xx
+-----------------------------
+* Initial release with the new code base
+* Aligned to Topic Maps - Data Model (TMDM)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lh...@us...> - 2008-08-20 15:09:15
|
Revision: 68
http://tmapi.svn.sourceforge.net/tmapi/?rev=68&view=rev
Author: lheuer
Date: 2008-08-20 15:09:23 +0000 (Wed, 20 Aug 2008)
Log Message:
-----------
Added TMAPI 1.0 -> 2.0 changes doc
Added Paths:
-----------
trunk/TMAPI-1.0_MIGRATION.txt
Added: trunk/TMAPI-1.0_MIGRATION.txt
===================================================================
--- trunk/TMAPI-1.0_MIGRATION.txt (rev 0)
+++ trunk/TMAPI-1.0_MIGRATION.txt 2008-08-20 15:09:23 UTC (rev 68)
@@ -0,0 +1,104 @@
+===================
+TMAPI 1.0 Migration
+===================
+
+This document enumerates some important changes between TMAPI 1.0 and 2.0.
+
+
+Changes in core
+---------------
+
+TMAPI 2.0 introduces several generalized interfaces like ``Reifiable``,
+``Typed``, ``Scoped``, and ``DatatypeAware``. These interfaces avoid redundant
+method declaration (i.e. ``setType()`` / ``getType()``, ``setValue()`` /
+``getValue()``, et al.).
+
+Additionally, the ``ConfigurableHelperObject`` was eliminated since it was only
+utilized by the ``Index`` interface. The indices are now available by simply
+calling ``TopicMap.getIndex(Class<I> indexInterface)``. As one objective of
+TMAPI 2.0 is to enforce TMDM constraints, it is more restrictive than its
+predecessor concerning model constraints (i.e. disallows
+``Role.setPlayer(null)``). The naming in TMAPI 2.0 is simplified for
+convenience:
+
+ * TopicName is called Name
+ * AssociationRole is called Role
+ * TopicMapsConstruct is called Construct (TMAPI 1.0's equivalent is
+ TopicMapObject)
+
+
+Changes in index
+----------------
+
+The main changing covers the reduction to only three indices:
+
+ * TypeInstanceIndex
+ * ScopedIndex
+ * LiteralIndex
+
+This approach distances from a single construct view to a generalized view on a
+topic map ("literal view", "typed view", and "scoped view"). From these views
+specific constructs can be accessed (i.e. return all associations in scope x).
+
+Topic Maps constructs are available in multiple indices, i.e. ``Occurrence`` in
+``TypeInstanceIndex``, ``ScopedIndex``, and ``LiteralIndex``. The reduction to
+three indices makes reindexing and / or syncronization more expensive: I.e. a
+Type- InstanceIndex.reindex() operation has to resync the information about
+topics, associations, roles, occurrences, and names, while a TMAPI 1.0
+``AssociationsIndex.reindex()`` would only update the information about
+associations. However the project members believe that ``Index`` implementations
+will rather realize constant syncronization. The ``IndexFlags`` interface was
+abolished. Its only method ``isAutoUpdated()`` is now available in the ``Index``
+interface.
+
+
+Specific Changes (constructs level)
+-----------------------------------
+* DatatypeAware
+ Is the superinterface for Occurrence and Variant. Therefore it provides
+ several methods for value assignments. It requires the Topic Maps processor to
+ set the datatype implicitly to xsd:string in setValue(String value) and to
+ xsd:anyURI in setValue(Locator value). For convenience, it offers several
+ other methods to set and read values where the datatype is implicitly assigned
+ and introduces setValue(String value, Locator datatype) in order to be
+ consistent with TMDM's concept of datatypes; getDatatype() returns the Locator
+ identifying the datatype of the value.
+
+* Topic
+ Provides filter methods ``getRolesPlayed(Topic type)``, ``getNames(Topic
+ type)``, ``getOccurrences(Topic type)`` which return only those constructs
+ which have the specified type. Further, various factory methods for ``Name``
+ and ``Occurrence`` are provided, inter alia a method for creating names with
+ the default name type (a Topic with subject identifier
+ <http://psi.topicmaps.org/iso13250/model/topic-name>).
+
+* Variant
+ Returns the union of its own scope and the parent's (Name) scope in getScope()
+ (this has also to be considered in ``ScopedIndex.getVariants(Topic[] themes, boolean matchAll)``).
+
+* Association
+ Does not allow ``null`` for role player and type assignments Further,
+ ``getRoleTypes()`` and a method ``getRoles(Topic type)`` to filter the
+ association roles is provided.
+
+* Role
+ Does not allow to set the role player and type to ``null``.
+
+* TopicMap
+ Provides ``getTopicBySubjectIdentifier(Locator)`` and
+ ``getTopicBySubjectLocator(Locator)`` (moved from the TMAPI 1.0 TopicIndex
+ package). Even more importantly, the TopicMap interface does not allow to
+ create topics without any identity, such as an item identifier, a subject
+ identifier, or subject locator (non-transparent ``createTopic()`` enforces the
+ Topic Maps system to assign an item identifier internally).
+
+* TopicMapSystemFactory
+ Does no more provide ``setProperties(Properties props)``; properties are set
+ by calling ``setProperty(String propertyName, Object value)``.
+
+* Locator
+ Introduces IRI notation (TMAPI 1.0's Locator used URI notation).
+
+* Exceptions
+ Methods where ``null`` is not a valid argument throw
+ ``ModelConstraintException`` in core, ``IllegalArgumentException`` in index.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lh...@us...> - 2008-08-20 11:30:11
|
Revision: 67
http://tmapi.svn.sourceforge.net/tmapi/?rev=67&view=rev
Author: lheuer
Date: 2008-08-20 11:30:19 +0000 (Wed, 20 Aug 2008)
Log Message:
-----------
TestDatatypeAware.java -> AbstractTestDatatypeAware
Removed Paths:
-------------
trunk/src/test/java/org/tmapi/core/TestDatatypeAware.java
Deleted: trunk/src/test/java/org/tmapi/core/TestDatatypeAware.java
===================================================================
--- trunk/src/test/java/org/tmapi/core/TestDatatypeAware.java 2008-08-20 11:26:30 UTC (rev 66)
+++ trunk/src/test/java/org/tmapi/core/TestDatatypeAware.java 2008-08-20 11:30:19 UTC (rev 67)
@@ -1,360 +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 java.math.BigDecimal;
-import java.math.BigInteger;
-
-/**
- * Abstract test against the {@link DatatypeAware} 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 abstract class TestDatatypeAware extends TMAPITestCase {
-
- protected static final String _XSD = "http://www.w3.org/2001/XMLSchema#";
- protected static final String _XSD_STRING = _XSD + "string";
- protected static final String _XSD_INTEGER = _XSD + "integer";
- protected static final String _XSD_INT = _XSD + "int";
- protected static final String _XSD_FLOAT = _XSD + "float";
- protected static final String _XSD_DECIMAL = _XSD + "decimal";
- protected static final String _XSD_LONG = _XSD + "long";
- protected static final String _XSD_ANY_URI = _XSD + "anyURI";
-
- protected Locator _xsdString;
- protected Locator _xsdInteger;
- protected Locator _xsdInt;
- protected Locator _xsdFloat;
- protected Locator _xsdDecimal;
- protected Locator _xsdLong;
- protected Locator _xsdAnyURI;
-
- public TestDatatypeAware(String name) {
- super(name);
- }
-
- /**
- * Returns a {@link DatatypeAware} instance to run the tests against.
- *
- * @return A {@link DatatypeAware} instance.
- */
- protected abstract DatatypeAware getDatatypeAware();
-
- /* (non-Javadoc)
- * @see org.tmapi.core.TMAPITestCase#setUp()
- */
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- _xsdString = createLocator(_XSD_STRING);
- _xsdInteger = createLocator(_XSD_INTEGER);
- _xsdInt = createLocator(_XSD_INT);
- _xsdFloat = createLocator(_XSD_FLOAT);
- _xsdDecimal = createLocator(_XSD_DECIMAL);
- _xsdLong = createLocator(_XSD_LONG);
- _xsdAnyURI = createLocator(_XSD_ANY_URI);
- }
-
- public void testString() {
- final DatatypeAware dt = getDatatypeAware();
- final String value = "a string";
- dt.setValue(value);
- assertEquals(value, dt.getValue());
- assertEquals(_xsdString, dt.getDatatype());
- assertFailInteger(dt);
- assertFailInt(dt);
- assertFailFloat(dt);
- assertFailLong(dt);
- assertFailDecimal(dt);
- }
-
- public void testStringExplicit() {
- final DatatypeAware dt = getDatatypeAware();
- final String value = "a string";
- dt.setValue(value, _xsdString);
- assertEquals(value, dt.getValue());
- assertEquals(_xsdString, dt.getDatatype());
- assertFailInteger(dt);
- assertFailInt(dt);
- assertFailFloat(dt);
- assertFailLong(dt);
- assertFailDecimal(dt);
- }
-
- public void testURI() {
- final DatatypeAware dt = getDatatypeAware();
- final String iri = "http://www.example.org/";
- final Locator value = createLocator(iri);
- dt.setValue(value);
- assertEquals(iri, dt.getValue());
- assertEquals(_xsdAnyURI, dt.getDatatype());
- assertEquals(value, dt.locatorValue());
- assertFailInteger(dt);
- assertFailInt(dt);
- assertFailFloat(dt);
- assertFailLong(dt);
- assertFailDecimal(dt);
- }
-
- public void testURIExplicit() {
- final DatatypeAware dt = getDatatypeAware();
- final String iri = "http://www.example.org/";
- final Locator value = createLocator(iri);
- dt.setValue(iri, _xsdAnyURI);
- assertEquals(iri, dt.getValue());
- assertEquals(_xsdAnyURI, dt.getDatatype());
- assertEquals(value, dt.locatorValue());
- assertFailInteger(dt);
- assertFailInt(dt);
- assertFailFloat(dt);
- assertFailLong(dt);
- assertFailDecimal(dt);
- }
-
- public void testInteger() {
- final BigInteger value = BigInteger.TEN;
- final DatatypeAware dt = getDatatypeAware();
- dt.setValue(value);
- assertEquals(value.toString(), dt.getValue());
- assertEquals(_xsdInteger, dt.getDatatype());
- assertEquals(value, dt.integerValue());
- assertEquals(BigDecimal.TEN, dt.decimalValue());
- assertEquals(10L, dt.longValue());
- assertEquals(10, dt.intValue());
- assertEquals(10.0F, dt.floatValue());
- }
-
- public void testIntegerExplicit() {
- final BigInteger value = BigInteger.TEN;
- final DatatypeAware dt = getDatatypeAware();
- dt.setValue(value.toString(), _xsdInteger);
- assertEquals(value.toString(), dt.getValue());
- assertEquals(_xsdInteger, dt.getDatatype());
- assertEquals(value, dt.integerValue());
- assertEquals(BigDecimal.TEN, dt.decimalValue());
- assertEquals(10L, dt.longValue());
- assertEquals(10, dt.intValue());
- assertEquals(10.0F, dt.floatValue());
- }
-
- public void testDecimal() {
- final BigDecimal value = BigDecimal.TEN;
- final DatatypeAware dt = getDatatypeAware();
- dt.setValue(value);
- assertEquals(value.toString(), dt.getValue());
- assertEquals(_xsdDecimal, dt.getDatatype());
- assertEquals(value, dt.decimalValue());
- assertEquals(BigInteger.TEN, dt.integerValue());
- assertEquals(10L, dt.longValue());
- assertEquals(10, dt.intValue());
- assertEquals(10.0F, dt.floatValue());
- }
-
- public void testDecimalExplicit() {
- final BigDecimal value = BigDecimal.TEN;
- final DatatypeAware dt = getDatatypeAware();
- dt.setValue(value.toString(), _xsdDecimal);
- assertEquals(value.toString(), dt.getValue());
- assertEquals(_xsdDecimal, dt.getDatatype());
- assertEquals(value, dt.decimalValue());
- assertEquals(BigInteger.TEN, dt.integerValue());
- assertEquals(10L, dt.longValue());
- assertEquals(10, dt.intValue());
- assertEquals(10.0F, dt.floatValue());
- }
-
- public void testInt() {
- final int value = 1976;
- final String strValue = "1976";
- final DatatypeAware dt = getDatatypeAware();
- dt.setValue(value);
- assertEquals(strValue, dt.getValue());
- assertEquals(_xsdInt, dt.getDatatype());
- assertEquals(new BigDecimal(value), dt.decimalValue());
- assertEquals(new BigInteger(strValue), dt.integerValue());
- assertEquals(1976L, dt.longValue());
- assertEquals(1976, dt.intValue());
- assertEquals(1976.0F, dt.floatValue());
- }
-
- public void testLong() {
- final long value = 1976L;
- final String strValue = "1976";
- final DatatypeAware dt = getDatatypeAware();
- dt.setValue(value);
- assertEquals(strValue, dt.getValue());
- assertEquals(_xsdLong, dt.getDatatype());
- assertEquals(new BigDecimal(value), dt.decimalValue());
- assertEquals(new BigInteger(strValue), dt.integerValue());
- assertEquals(value, dt.longValue());
- assertEquals(1976, dt.intValue());
- assertEquals(1976.0F, dt.floatValue());
- }
-
- public void testFloat() {
- final float value = 1976.0F;
- final String strValue = "1976.0";
- final DatatypeAware dt = getDatatypeAware();
- dt.setValue(value);
- assertEquals(strValue, dt.getValue());
- assertEquals(_xsdFloat, dt.getDatatype());
- assertEquals(new BigDecimal(strValue), dt.decimalValue());
- assertFailInteger(dt);
- assertFailLong(dt);
- assertFailInt(dt);
- assertEquals(value, dt.floatValue());
- }
-
- public void testUserDatatype() {
- final Locator datatype = createLocator("http://www.example.org/datatype");
- final DatatypeAware dt = getDatatypeAware();
- final String value = "Value";
- dt.setValue(value, datatype);
- assertEquals(datatype, dt.getDatatype());
- assertEquals(value, dt.getValue());
- assertFailInteger(dt);
- assertFailInt(dt);
- assertFailFloat(dt);
- assertFailLong(dt);
- assertFailDecimal(dt);
- }
-
- public void testIllegalDatatype() {
- final DatatypeAware dt = getDatatypeAware();
- try {
- dt.setValue("value", null);
- fail("datatypeAware.setValue(\"value\", null) is illegal");
- }
- catch (ModelConstraintException ex) {
- // noop.
- }
- }
-
- public void testIllegalStringValue() {
- final DatatypeAware dt = getDatatypeAware();
- try {
- dt.setValue((String)null);
- fail("datatypeAware.setValue((String)null) is illegal");
- }
- catch (ModelConstraintException ex) {
- // noop.
- }
- }
-
- public void testIllegalStringValueExplicit() {
- final DatatypeAware dt = getDatatypeAware();
- try {
- dt.setValue(null, _xsdString);
- fail("datatypeAware.setValue(null, datatype) is illegal");
- }
- catch (ModelConstraintException ex) {
- // noop.
- }
- }
-
- public void testIllegalLocatorValue() {
- final DatatypeAware dt = getDatatypeAware();
- try {
- dt.setValue((Locator)null);
- fail("datatypeAware.setValue((Locator)null) is illegal");
- }
- catch (ModelConstraintException ex) {
- // noop.
- }
- }
-
- public void testIllegalIntegerValue() {
- final DatatypeAware dt = getDatatypeAware();
- try {
- dt.setValue((BigInteger)null);
- fail("datatypeAware.setValue((BigInteger)null) is illegal");
- }
- catch (ModelConstraintException ex) {
- // noop.
- }
- }
-
- public void testIllegalDecimalValue() {
- final DatatypeAware dt = getDatatypeAware();
- try {
- dt.setValue((BigDecimal)null);
- fail("datatypeAware.setValue((BigDecimal)null) is illegal");
- }
- catch (ModelConstraintException ex) {
- // noop.
- }
- }
-
- protected void assertFailInteger(final DatatypeAware dt) {
- try {
- dt.integerValue();
- fail("Expected a failure for converting the value to 'BigInteger'");
- }
- catch (NumberFormatException ex) {
- // noop.
- }
- }
-
- protected void assertFailInt(final DatatypeAware dt) {
- try {
- dt.intValue();
- fail("Expected a failure for converting the value to 'int'");
- }
- catch (NumberFormatException ex) {
- // noop.
- }
- }
-
- protected void assertFailFloat(final DatatypeAware dt) {
- try {
- dt.floatValue();
- fail("Expected a failure for converting the value to 'float'");
- }
- catch (NumberFormatException ex) {
- // noop.
- }
- }
-
- protected void assertFailDecimal(final DatatypeAware dt) {
- try {
- dt.decimalValue();
- fail("Expected a failure for converting the value to 'BigDecimal'");
- }
- catch (NumberFormatException ex) {
- // noop.
- }
- }
-
- protected void assertFailLong(final DatatypeAware dt) {
- try {
- dt.longValue();
- fail("Expected a failure for converting the value to 'long'");
- }
- catch (NumberFormatException ex) {
- // noop.
- }
- }
-
- protected void assertFailLocator(final DatatypeAware dt) {
- try {
- dt.locatorValue();
- fail("Expected a failure for converting the value to 'Locator'");
- }
- catch (IllegalArgumentException ex) {
- // noop.
- }
- }
-}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|