Merge branch 'maint-rel-1.6' into develop
This commit is contained in:
commit
b47900cf1a
2 changed files with 14365 additions and 14344 deletions
File diff suppressed because it is too large
Load diff
|
@ -1,13 +1,12 @@
|
||||||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||||
package edu.cornell.mannlib.vitro.webapp.search.solr;
|
package edu.cornell.mannlib.vitro.webapp.search.solr;
|
||||||
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.*;
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
|
||||||
|
import org.apache.solr.common.SolrInputDocument;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Ignore;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import com.hp.hpl.jena.rdf.model.Model;
|
import com.hp.hpl.jena.rdf.model.Model;
|
||||||
|
@ -25,33 +24,33 @@ import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.RDFServiceFactorySingle;
|
||||||
import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.jena.model.RDFServiceModel;
|
import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.jena.model.RDFServiceModel;
|
||||||
|
|
||||||
|
|
||||||
public class VivoAgentContextNodeFieldsTest extends AbstractTestClass{
|
public class VivoAgentContextNodeFieldsTest extends AbstractTestClass{
|
||||||
|
|
||||||
static String SPCA = "http://vivo.mydomain.edu/individual/n8087";
|
static String SPCA = "http://vivo.mydomain.edu/individual/n8087";
|
||||||
|
|
||||||
static RDFServiceFactory rdfServiceFactory;
|
static RDFServiceFactory rdfServiceFactory;
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void setup(){
|
public static void setup(){
|
||||||
Model m = ModelFactory.createDefaultModel();
|
Model m = ModelFactory.createDefaultModel();
|
||||||
InputStream stream = VivoAgentContextNodeFieldsTest
|
InputStream stream = VivoAgentContextNodeFieldsTest
|
||||||
.class.getResourceAsStream("./NIHVIVO3853_DataSet1.rdf");
|
.class.getResourceAsStream("./NIHVIVO3853_DataSet1.rdf");
|
||||||
|
|
||||||
long preloadSize = m.size();
|
long preloadSize = m.size();
|
||||||
|
|
||||||
m.read(stream, null);
|
m.read(stream, null);
|
||||||
assertTrue("expected to load statements from file", m.size() > preloadSize );
|
assertTrue("expected to load statements from file", m.size() > preloadSize );
|
||||||
|
|
||||||
assertTrue("expect statements about SPCA",
|
assertTrue("expect statements about SPCA",
|
||||||
m.contains(ResourceFactory.createResource(SPCA),(Property) null,(RDFNode) null));
|
m.contains(ResourceFactory.createResource(SPCA),(Property) null,(RDFNode) null));
|
||||||
|
|
||||||
RDFService rdfService = new RDFServiceModel(m);
|
RDFService rdfService = new RDFServiceModel(m);
|
||||||
rdfServiceFactory = new RDFServiceFactorySingle(rdfService);
|
rdfServiceFactory = new RDFServiceFactorySingle(rdfService);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testJane(){
|
public void testJane(){
|
||||||
Individual ind = new IndividualImpl();
|
Individual ind = new IndividualImpl();
|
||||||
ind.setURI(SPCA);
|
ind.setURI(SPCA);
|
||||||
|
|
||||||
VivoAgentContextNodeFields vacnf = new VivoAgentContextNodeFields(rdfServiceFactory);
|
VivoAgentContextNodeFields vacnf = new VivoAgentContextNodeFields(rdfServiceFactory);
|
||||||
|
@ -61,13 +60,12 @@ public class VivoAgentContextNodeFieldsTest extends AbstractTestClass{
|
||||||
String values = sb.toString();
|
String values = sb.toString();
|
||||||
|
|
||||||
boolean hasJane = values.toLowerCase().indexOf("jane") > 0;
|
boolean hasJane = values.toLowerCase().indexOf("jane") > 0;
|
||||||
assertTrue("expected to have jane because SPCA advises jane", hasJane);
|
assertTrue("expected to have jane because SPCA advises jane", hasJane);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
@Test
|
||||||
@Test
|
public void testWonder(){
|
||||||
public void testWonder(){
|
Individual ind = new IndividualImpl();
|
||||||
Individual ind = new IndividualImpl();
|
|
||||||
ind.setURI(SPCA);
|
ind.setURI(SPCA);
|
||||||
|
|
||||||
VivoAgentContextNodeFields vacnf = new VivoAgentContextNodeFields(rdfServiceFactory);
|
VivoAgentContextNodeFields vacnf = new VivoAgentContextNodeFields(rdfServiceFactory);
|
||||||
|
@ -77,12 +75,12 @@ public class VivoAgentContextNodeFieldsTest extends AbstractTestClass{
|
||||||
String values = sb.toString();
|
String values = sb.toString();
|
||||||
|
|
||||||
boolean hasWonder = values.toLowerCase().indexOf("wonders") > 0;
|
boolean hasWonder = values.toLowerCase().indexOf("wonders") > 0;
|
||||||
assertTrue("expected to have jane because SPCA won wonders award", hasWonder);
|
assertTrue("expected to have jane because SPCA won wonders award", hasWonder);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testChimp(){
|
public void testChimp(){
|
||||||
Individual ind = new IndividualImpl();
|
Individual ind = new IndividualImpl();
|
||||||
ind.setURI(SPCA);
|
ind.setURI(SPCA);
|
||||||
|
|
||||||
VivoAgentContextNodeFields vacnf = new VivoAgentContextNodeFields(rdfServiceFactory);
|
VivoAgentContextNodeFields vacnf = new VivoAgentContextNodeFields(rdfServiceFactory);
|
||||||
|
@ -92,6 +90,6 @@ public class VivoAgentContextNodeFieldsTest extends AbstractTestClass{
|
||||||
String values = sb.toString();
|
String values = sb.toString();
|
||||||
|
|
||||||
boolean hasNotChimp = ! (values.toLowerCase().indexOf("chimp") > 0);
|
boolean hasNotChimp = ! (values.toLowerCase().indexOf("chimp") > 0);
|
||||||
assertTrue("expected to not have chimp because jane won chimp award, not SPCA", hasNotChimp);
|
assertTrue("expected to not have chimp because jane won chimp award, not SPCA", hasNotChimp);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue