NIHVIVO-3817 Update VivoInformationResourceContextNodesFieldsTest to work with modified ContextNodesField that takes RDFServiceFactory in constructor
This commit is contained in:
parent
e107ab4b9b
commit
f739b86766
1 changed files with 11 additions and 6 deletions
|
@ -19,6 +19,10 @@ import edu.cornell.mannlib.vitro.testing.AbstractTestClass;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
|
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.jena.WebappDaoFactoryJena;
|
import edu.cornell.mannlib.vitro.webapp.dao.jena.WebappDaoFactoryJena;
|
||||||
|
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
|
||||||
|
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceFactory;
|
||||||
|
import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.RDFServiceFactorySingle;
|
||||||
|
import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.jena.model.RDFServiceModel;
|
||||||
|
|
||||||
public class VivoInformationResourceContextNodeFieldsTest extends AbstractTestClass {
|
public class VivoInformationResourceContextNodeFieldsTest extends AbstractTestClass {
|
||||||
|
|
||||||
|
@ -27,9 +31,8 @@ public class VivoInformationResourceContextNodeFieldsTest extends AbstractTestCl
|
||||||
String DOCUMENT_URI = "http://example.com/vivo/individual/n7474";
|
String DOCUMENT_URI = "http://example.com/vivo/individual/n7474";
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
||||||
public void testNoLabel() throws IOException{
|
public void testNoLabel() throws IOException{
|
||||||
/*
|
|
||||||
//Test that rdfs:label is NOT added by the VivoInformationResourceContextNodeFields
|
//Test that rdfs:label is NOT added by the VivoInformationResourceContextNodeFields
|
||||||
|
|
||||||
//setup a model & wdf with test RDF file
|
//setup a model & wdf with test RDF file
|
||||||
|
@ -46,10 +49,12 @@ public class VivoInformationResourceContextNodeFieldsTest extends AbstractTestCl
|
||||||
Individual ind = wadf.getIndividualDao().getIndividualByURI(DOCUMENT_URI);
|
Individual ind = wadf.getIndividualDao().getIndividualByURI(DOCUMENT_URI);
|
||||||
Assert.assertNotNull(ind);
|
Assert.assertNotNull(ind);
|
||||||
|
|
||||||
|
RDFService rdfService = new RDFServiceModel(ontModel);
|
||||||
|
RDFServiceFactory rdfServiceFactory = new RDFServiceFactorySingle(rdfService);
|
||||||
SolrInputDocument doc = new SolrInputDocument();
|
SolrInputDocument doc = new SolrInputDocument();
|
||||||
doc.addField("ALLTEXT", "");
|
doc.addField("ALLTEXT", "");
|
||||||
|
|
||||||
VivoInformationResourceContextNodeFields vircnf = new VivoInformationResourceContextNodeFields(ontModel);
|
VivoInformationResourceContextNodeFields vircnf = new VivoInformationResourceContextNodeFields(rdfServiceFactory);
|
||||||
vircnf.modifyDocument(ind, doc, new StringBuffer());
|
vircnf.modifyDocument(ind, doc, new StringBuffer());
|
||||||
|
|
||||||
Collection values = doc.getFieldValues("ALLTEXT");
|
Collection values = doc.getFieldValues("ALLTEXT");
|
||||||
|
@ -57,9 +62,9 @@ public class VivoInformationResourceContextNodeFieldsTest extends AbstractTestCl
|
||||||
Assert.assertFalse("rdf:label erroneously added by document modifier:", value.toString().contains(RDFS_LABEL_VALUE));
|
Assert.assertFalse("rdf:label erroneously added by document modifier:", value.toString().contains(RDFS_LABEL_VALUE));
|
||||||
}
|
}
|
||||||
|
|
||||||
VivoAgentContextNodeFields vacnf = new VivoAgentContextNodeFields(ontModel);
|
VivoAgentContextNodeFields vacnf = new VivoAgentContextNodeFields(rdfServiceFactory);
|
||||||
vacnf.modifyDocument(ind, doc, new StringBuffer());
|
vacnf.modifyDocument(ind, doc, new StringBuffer());
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue