From: Xuan B. <med...@us...> - 2007-07-21 22:44:08
|
Update of /cvsroot/tm4j/tm4j/src/org/tm4j/tmapi/test In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv11267/src/org/tm4j/tmapi/test Modified Files: BaseNameTest.java Log Message: Incorporate test cases from bug.1749949. Thanks to user "kordzik". Index: BaseNameTest.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/tmapi/test/BaseNameTest.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** BaseNameTest.java 21 Jun 2004 18:42:27 -0000 1.11 --- BaseNameTest.java 21 Jul 2007 22:44:00 -0000 1.12 *************** *** 8,11 **** --- 8,13 ---- package org.tm4j.tmapi.test; + import java.util.Vector; + import org.tmapi.core.TopicName; import org.tmapi.core.ScopedObject; *************** *** 44,47 **** --- 46,82 ---- } + /** + 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 { + + //creating new user topic + Topic type = m_topicMap.createTopic(); + Topic t = m_topicMap.createTopic(); + + // creating scope collection + Vector<Topic> scope = new Vector<Topic>(); + scope.add(type); + + // creating name t.createTopicName("name", scope); + t.createTopicName("name", scope); + + //removing topic + t.remove(); + + //creating new one + t = m_topicMap.createTopic(); + + //RuntimeException occurs at the following line + t.createTopicName("name", scope); + } catch (TMAPIException ex) { + fail("Unexpected exception: " + ex.toString()); + } + } + public void testData() { Topic t = m_topicMap.createTopic(); |