From: Xuan B. <med...@us...> - 2007-07-21 22:44:08
|
Update of /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/test In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv11267/src/org/tm4j/topicmap/test Modified Files: ScopeTest.java Log Message: Incorporate test cases from bug.1749949. Thanks to user "kordzik". Index: ScopeTest.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/test/ScopeTest.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** ScopeTest.java 21 Jun 2004 18:42:29 -0000 1.14 --- ScopeTest.java 21 Jul 2007 22:44:00 -0000 1.15 *************** *** 46,49 **** --- 46,88 ---- } + /** + This test case is result of bug report https://sourceforge.net/tracker/?func=detail&atid=391879&aid=1749949&group_id=27895 . + Thanks to user "kordzik" for providing the test case. + + @author Kordzik + */ + public void testScopedName() { + try { + //assumed TopicMap tm is instantianated beforehand + + //creating new user topic + Topic type = tm.createTopic("id0"); + Topic t = tm.createTopic("id1"); + + /* + // creating scope collection + Vector<Topic> scope = new Vector<Topic>(); + scope.add(type); + */ + + // creating name t.createTopicName("name", scope); + t.createName("id3","name", new Topic[] { type } ); + + //removing topic + t.destroy(); + + //creating new one + t = tm.createTopic("id2"); + + //RuntimeException occurs at the following line + t.createName("id4","name", new Topic[] { type } ); + } catch (Exception ex) { + ex.printStackTrace(); + fail("Unexpected exception: " + ex.toString()); + } + + System.gc(); + } + public void testScopedObject() { try { |