|
From: <lh...@us...> - 2010-08-31 17:59:28
|
Revision: 408
http://tinytim.svn.sourceforge.net/tinytim/?rev=408&view=rev
Author: lheuer
Date: 2010-08-31 17:59:20 +0000 (Tue, 31 Aug 2010)
Log Message:
-----------
Removed unused tests, added TopicMap.clear
Modified Paths:
--------------
tinytim/trunk/src/main/java/org/tinytim/core/ConstructImpl.java
tinytim/trunk/src/main/java/org/tinytim/core/IdentityManager.java
tinytim/trunk/src/main/java/org/tinytim/core/MemoryTopicMap.java
tinytim/trunk/src/main/java/org/tinytim/index/IndexManager.java
Removed Paths:
-------------
tinytim/trunk/src/test/java/org/tinytim/core/AllTests.java
tinytim/trunk/src/test/java/org/tinytim/core/TestTMAPICore.java
tinytim/trunk/src/test/java/org/tinytim/core/TestTMAPIIndex.java
Modified: tinytim/trunk/src/main/java/org/tinytim/core/ConstructImpl.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/core/ConstructImpl.java 2010-08-31 17:04:46 UTC (rev 407)
+++ tinytim/trunk/src/main/java/org/tinytim/core/ConstructImpl.java 2010-08-31 17:59:20 UTC (rev 408)
@@ -40,7 +40,7 @@
protected String _id;
protected ITopicMap _tm;
protected Construct _parent;
- private Set<Locator> _iids;
+ protected Set<Locator> _iids;
protected ConstructImpl(ITopicMap topicMap) {
_tm = topicMap;
Modified: tinytim/trunk/src/main/java/org/tinytim/core/IdentityManager.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/core/IdentityManager.java 2010-08-31 17:04:46 UTC (rev 407)
+++ tinytim/trunk/src/main/java/org/tinytim/core/IdentityManager.java 2010-08-31 17:59:20 UTC (rev 408)
@@ -163,13 +163,17 @@
return _iid2Construct.get(iid);
}
- public void close() {
+ public void clear() {
_id2Construct.clear();
_iid2Construct.clear();
_sid2Topic.clear();
_slo2Topic.clear();
}
+ public void close() {
+ clear();
+ }
+
private class TopicMapsConstructAddHandler implements IEventHandler {
public void handleEvent(Event evt, IConstruct sender, Object oldValue,
Object newValue) {
@@ -294,4 +298,5 @@
}
}
}
+
}
Modified: tinytim/trunk/src/main/java/org/tinytim/core/MemoryTopicMap.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/core/MemoryTopicMap.java 2010-08-31 17:04:46 UTC (rev 407)
+++ tinytim/trunk/src/main/java/org/tinytim/core/MemoryTopicMap.java 2010-08-31 17:59:20 UTC (rev 408)
@@ -388,6 +388,17 @@
return true;
}
+ public void clear() {
+ if (_iids != null) {
+ _iids.clear();
+ }
+ _reifier = null;
+ _topics.clear();
+ _assocs.clear();
+ ((IndexManager)_indexManager).clear();
+ ((IdentityManager) _identityManager).clear();
+ }
+
/* (non-Javadoc)
* @see org.tmapi.core.TopicMap#remove()
*/
@@ -395,8 +406,7 @@
public void remove() {
_sys.removeTopicMap(this);
_sys = null;
- _topics.clear();
- _assocs.clear();
+ clear();
_indexManager.close();
_identityManager.close();
_eventMultiplier = null;
Modified: tinytim/trunk/src/main/java/org/tinytim/index/IndexManager.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/index/IndexManager.java 2010-08-31 17:04:46 UTC (rev 407)
+++ tinytim/trunk/src/main/java/org/tinytim/index/IndexManager.java 2010-08-31 17:59:20 UTC (rev 408)
@@ -84,6 +84,10 @@
* @see org.tinytim.internal.api.IIndexManager#close()
*/
public void close() {
+ clear();
+ }
+
+ public void clear() {
_typeInstanceIndex.clear();
_scopedIndex.clear();
_literalIndex.clear();
Deleted: tinytim/trunk/src/test/java/org/tinytim/core/AllTests.java
===================================================================
--- tinytim/trunk/src/test/java/org/tinytim/core/AllTests.java 2010-08-31 17:04:46 UTC (rev 407)
+++ tinytim/trunk/src/test/java/org/tinytim/core/AllTests.java 2010-08-31 17:59:20 UTC (rev 408)
@@ -1,59 +0,0 @@
-/*
- * Copyright 2008 Lars Heuer (heuer[at]semagia.com)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.tinytim.core;
-
-import org.tinytim.core.value.TestLiteral;
-import org.tinytim.core.value.TestLiteralNormalizer;
-import org.tinytim.core.value.TestLocatorImpl;
-import org.tinytim.internal.utils.TestSignatureGenerator;
-//import org.tinytim.mio.TestTinyTimMapInputHandler;
-import org.tinytim.utils.TestDuplicateRemovalUtils;
-import org.tinytim.utils.TestTopicUtils;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Runs all tests.
- *
- * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a>
- * @version $Rev$ - $Date$
- */
-public class AllTests extends TestSuite {
-
- public static void main(String[] args) {
- junit.textui.TestRunner.run(suite());
- }
-
- public static Test suite() {
- TestSuite suite = new TestSuite();
- suite.addTestSuite(TestDuplicateRemovalUtils.class);
- suite.addTestSuite(TestLocatorImpl.class);
- suite.addTestSuite(TestIConstruct.class);
- suite.addTestSuite(TestScope.class);
- suite.addTestSuite(TestLiteral.class);
-//TODO: Add me
-// suite.addTestSuite(TestTinyTimMapInputHandler.class);
- suite.addTestSuite(TestLiteralNormalizer.class);
- suite.addTestSuite(TestSignatureGenerator.class);
- suite.addTest(TestTMAPICore.suite());
- suite.addTest(TestTMAPIIndex.suite());
- suite.addTestSuite(TestTopicMapSystemFactoryImpl.class);
- suite.addTestSuite(TestTopicUtils.class);
- return suite;
- }
-
-}
Deleted: tinytim/trunk/src/test/java/org/tinytim/core/TestTMAPICore.java
===================================================================
--- tinytim/trunk/src/test/java/org/tinytim/core/TestTMAPICore.java 2010-08-31 17:04:46 UTC (rev 407)
+++ tinytim/trunk/src/test/java/org/tinytim/core/TestTMAPICore.java 2010-08-31 17:59:20 UTC (rev 408)
@@ -1,37 +0,0 @@
-/*
- * Copyright 2008 Lars Heuer (heuer[at]semagia.com)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.tinytim.core;
-
-import org.tmapi.core.AllCoreTests;
-
-import junit.framework.Test;
-
-/**
- * Runs the TMAPI core test suite against tinyTiM.
- *
- * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a>
- * @version $Rev$ - $Date$
- */
-public class TestTMAPICore extends AbstractTMAPITestSuite {
-
- public static void main(String[] args) {
- junit.textui.TestRunner.run(suite());
- }
-
- public static Test suite() {
- return AllCoreTests.suite();
- }
-}
Deleted: tinytim/trunk/src/test/java/org/tinytim/core/TestTMAPIIndex.java
===================================================================
--- tinytim/trunk/src/test/java/org/tinytim/core/TestTMAPIIndex.java 2010-08-31 17:04:46 UTC (rev 407)
+++ tinytim/trunk/src/test/java/org/tinytim/core/TestTMAPIIndex.java 2010-08-31 17:59:20 UTC (rev 408)
@@ -1,37 +0,0 @@
-/*
- * Copyright 2008 Lars Heuer (heuer[at]semagia.com)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.tinytim.core;
-
-import org.tmapi.index.AllIndexTests;
-
-import junit.framework.Test;
-
-/**
- * Runs the TMAPI index test suite against tinyTiM.
- *
- * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a>
- * @version $Rev$ - $Date$
- */
-public class TestTMAPIIndex extends AbstractTMAPITestSuite {
-
- public static void main(String[] args) {
- junit.textui.TestRunner.run(suite());
- }
-
- public static Test suite() {
- return AllIndexTests.suite();
- }
-}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|