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$ */
|
||||
package edu.cornell.mannlib.vitro.webapp.search.solr;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
import org.apache.solr.common.SolrInputDocument;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
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;
|
||||
|
||||
|
||||
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
|
||||
public static void setup(){
|
||||
Model m = ModelFactory.createDefaultModel();
|
||||
InputStream stream = VivoAgentContextNodeFieldsTest
|
||||
.class.getResourceAsStream("./NIHVIVO3853_DataSet1.rdf");
|
||||
@BeforeClass
|
||||
public static void setup(){
|
||||
Model m = ModelFactory.createDefaultModel();
|
||||
InputStream stream = VivoAgentContextNodeFieldsTest
|
||||
.class.getResourceAsStream("./NIHVIVO3853_DataSet1.rdf");
|
||||
|
||||
long preloadSize = m.size();
|
||||
long preloadSize = m.size();
|
||||
|
||||
m.read(stream, null);
|
||||
assertTrue("expected to load statements from file", m.size() > preloadSize );
|
||||
m.read(stream, null);
|
||||
assertTrue("expected to load statements from file", m.size() > preloadSize );
|
||||
|
||||
assertTrue("expect statements about SPCA",
|
||||
m.contains(ResourceFactory.createResource(SPCA),(Property) null,(RDFNode) null));
|
||||
assertTrue("expect statements about SPCA",
|
||||
m.contains(ResourceFactory.createResource(SPCA),(Property) null,(RDFNode) null));
|
||||
|
||||
RDFService rdfService = new RDFServiceModel(m);
|
||||
rdfServiceFactory = new RDFServiceFactorySingle(rdfService);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testJane(){
|
||||
Individual ind = new IndividualImpl();
|
||||
@Test
|
||||
public void testJane(){
|
||||
Individual ind = new IndividualImpl();
|
||||
ind.setURI(SPCA);
|
||||
|
||||
VivoAgentContextNodeFields vacnf = new VivoAgentContextNodeFields(rdfServiceFactory);
|
||||
|
@ -62,12 +61,11 @@ public class VivoAgentContextNodeFieldsTest extends AbstractTestClass{
|
|||
|
||||
boolean hasJane = values.toLowerCase().indexOf("jane") > 0;
|
||||
assertTrue("expected to have jane because SPCA advises jane", hasJane);
|
||||
}
|
||||
}
|
||||
|
||||
@Ignore
|
||||
@Test
|
||||
public void testWonder(){
|
||||
Individual ind = new IndividualImpl();
|
||||
@Test
|
||||
public void testWonder(){
|
||||
Individual ind = new IndividualImpl();
|
||||
ind.setURI(SPCA);
|
||||
|
||||
VivoAgentContextNodeFields vacnf = new VivoAgentContextNodeFields(rdfServiceFactory);
|
||||
|
@ -78,11 +76,11 @@ public class VivoAgentContextNodeFieldsTest extends AbstractTestClass{
|
|||
|
||||
boolean hasWonder = values.toLowerCase().indexOf("wonders") > 0;
|
||||
assertTrue("expected to have jane because SPCA won wonders award", hasWonder);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testChimp(){
|
||||
Individual ind = new IndividualImpl();
|
||||
@Test
|
||||
public void testChimp(){
|
||||
Individual ind = new IndividualImpl();
|
||||
ind.setURI(SPCA);
|
||||
|
||||
VivoAgentContextNodeFields vacnf = new VivoAgentContextNodeFields(rdfServiceFactory);
|
||||
|
@ -93,5 +91,5 @@ public class VivoAgentContextNodeFieldsTest extends AbstractTestClass{
|
|||
|
||||
boolean hasNotChimp = ! (values.toLowerCase().indexOf("chimp") > 0);
|
||||
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