Author: rwesten
Date: Tue Jul 24 10:57:40 2012
New Revision: 1364974
URL: http://svn.apache.org/viewvc?rev=1364974&view=rev
Log:
STANBOL-471: added generics to tests; Improved initialisation of the
LdPathSemanticIndexTest
Modified:
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/index/ldpath/LDPathSemanticIndexTest.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/store/file/FileRevisionManagerTest.java
Modified:
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/index/ldpath/LDPathSemanticIndexTest.java
URL:
http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/index/ldpath/LDPathSemanticIndexTest.java?rev=1364974&r1=1364973&r2=1364974&view=diff
==============================================================================
---
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/index/ldpath/LDPathSemanticIndexTest.java
(original)
+++
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/index/ldpath/LDPathSemanticIndexTest.java
Tue Jul 24 10:57:40 2012
@@ -83,14 +83,18 @@ public class LDPathSemanticIndexTest {
if (counter == 0) {
String program = "@prefix dbp-ont :
<http://dbpedia.org/ontology/>; city = dbp-ont:city / rdfs:label :: xsd:string;
country = dbp-ont:country / rdfs:label :: xsd:string; ";
pid = ldPathSemanticIndexManager.createIndex(name,
"test_index_description", program);
- SemanticIndex tempSemanticIndex =
semanticIndexManager.getIndex(name);
+ SemanticIndex<ContentItem> tempSemanticIndex =
(SemanticIndex<ContentItem>)semanticIndexManager.getIndex(name);
int timeoutCount = 0;
while (tempSemanticIndex == null) {
if (timeoutCount == 8) break;
Thread.sleep(500);
- tempSemanticIndex = semanticIndexManager.getIndex(name);
+ tempSemanticIndex =
(SemanticIndex<ContentItem>)semanticIndexManager.getIndex(name);
timeoutCount++;
}
+ assertNotNull("SemanticIndex '"+name+"' not available after
waiting 4sec!",tempSemanticIndex);
+ assertTrue("This tests assume that the Semantic Index with the
name '"
+ + name +"' is of type
"+LDPathSemanticIndex.class.getSimpleName(),
+ tempSemanticIndex instanceof LDPathSemanticIndex);
semanticIndex = (LDPathSemanticIndex) tempSemanticIndex;
solrServer = semanticIndex.getServer();
}
Modified:
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/store/file/FileRevisionManagerTest.java
URL:
http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/store/file/FileRevisionManagerTest.java?rev=1364974&r1=1364973&r2=1364974&view=diff
==============================================================================
---
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/store/file/FileRevisionManagerTest.java
(original)
+++
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/store/file/FileRevisionManagerTest.java
Tue Jul 24 10:57:40 2012
@@ -31,6 +31,7 @@ import org.apache.stanbol.contenthub.ser
import org.apache.stanbol.contenthub.servicesapi.store.StoreException;
import org.apache.stanbol.contenthub.store.file.FileRevisionManager;
import org.apache.stanbol.contenthub.store.file.FileStoreDBManager;
+import org.apache.stanbol.enhancer.servicesapi.ContentItem;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
@@ -137,7 +138,7 @@ public class FileRevisionManagerTest {
}
// check changes
- ChangeSet changeSet =
fileRevisionManager.getChanges(startRevision, 3);
+ ChangeSet<ContentItem> changeSet =
fileRevisionManager.getChanges(startRevision, 3);
Set<String> changedItems = changeSet.changed();
assertTrue("Wrong number of changed items", (changedItems.size()
== 3));
for (int i = 0; i < 3; i++) {
@@ -237,7 +238,7 @@ public class FileRevisionManagerTest {
@Test
public void emptyChangesTest() throws StoreException {
long revision = System.currentTimeMillis();
- ChangeSet changeSet = fileRevisionManager.getChanges(revision, 1);
+ ChangeSet<ContentItem> changeSet =
fileRevisionManager.getChanges(revision, 1);
assertTrue("There must be no changes", changeSet.changed().size() ==
0);
assertTrue("Wrong start version", changeSet.fromRevision() == -1);
assertTrue("Wrong end version", changeSet.toRevision() == -1);