/** * Handles all the topics without name. */ private void getNoNameTopics() { //Create a new NoNames object NoNames nn = new NoNames(tm); nn.findNoNameTopics(); //Get the result from the nn object, and just prints out //the number of different topicmap elements without name. Collection nonametopics = nn.getNoNameTopics(); print("\nNumber of Topics with no name: " + nonametopics.size() + "\n"); Iterator it = nonametopics.iterator(); while (it.hasNext()) { TopicIF topic = (TopicIF)it.next(); print(getTopicId(topic) + "\n"); } Collection noChar = nn.getNoCharacteristics(); print("\nTopics with no characteristics: " + noChar.size() +"\n"); it = noChar.iterator(); while (it.hasNext()) { TopicIF topic = (TopicIF)it.next(); print(getTopicId(topic) + "\n"); } Collection noscopes = nn.getNoNameUnconstrained(); print("\nNumber of topics with no name in the unconstrained scope: " + noscopes.size() + "\n"); list(noscopes); }
public void testNoNameTopics() { NoNames test = new NoNames(tm); test.findNoNameTopics(); //Type checking assertTrue("type checking (getNoNameTopics)", test.getNoNameTopics() instanceof Collection); assertTrue("type checking (getNoCharacteristics)", test.getNoCharacteristics() instanceof Collection); assertTrue("type checking (getNoNameUnconstrained)", test.getNoNameUnconstrained() instanceof Collection); assertEquals(2, test.getNoNameTopics().size()); assertEquals(2, test.getNoCharacteristics().size()); //! assertEquals(8, test.getNoNameUnconstrained().size()); }