Rel 1.12.1 alpha (#249)
* Update issue templates * Run unit tests in alphabetical order (#244) * fix: unit tests VIVO-2003 (#245) * updates to outdated urls Co-authored-by: Dragan Ivanovic <chenejac@uns.ac.rs> Co-authored-by: Brian Lowe <brian@ontocale.com> Co-authored-by: Georgy Litvinov <git@litvinovg.pro>
This commit is contained in:
parent
028af518f9
commit
fc8b92fcf6
23 changed files with 138 additions and 22 deletions
|
@ -22,6 +22,7 @@ import org.apache.jena.vocabulary.RDF;
|
|||
import org.apache.jena.vocabulary.RDFS;
|
||||
import org.apache.jena.vocabulary.XSD;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import edu.cornell.mannlib.vitro.testing.AbstractTestClass;
|
||||
|
@ -36,6 +37,9 @@ import edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatementImpl;
|
|||
import edu.cornell.mannlib.vitro.webapp.beans.VClass;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.InsertException;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
|
||||
import stubs.edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactoryStub;
|
||||
import stubs.edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccessFactoryStub;
|
||||
import stubs.javax.servlet.ServletContextStub;
|
||||
|
||||
|
||||
public class JenaBaseDaoTest extends AbstractTestClass {
|
||||
|
@ -54,6 +58,12 @@ public class JenaBaseDaoTest extends AbstractTestClass {
|
|||
"@prefix owl: <" + OWL.getURI() + "> . \n" +
|
||||
"@prefix ex: <http://example.com/> . \n" ;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
WebappDaoFactoryStub wdf = new WebappDaoFactoryStub();
|
||||
ServletContextStub ctx = new ServletContextStub();
|
||||
new ModelAccessFactoryStub().get(ctx).setWebappDaoFactory(wdf);
|
||||
}
|
||||
@Test
|
||||
public void smartRemoveTestForIndivdiualDelete(){
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ package edu.cornell.mannlib.vitro.webapp.dao.jena;
|
|||
|
||||
import edu.cornell.mannlib.vitro.testing.AbstractTestClass;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -23,6 +23,8 @@ import edu.cornell.mannlib.vitro.webapp.dao.OntologyDao;
|
|||
import edu.cornell.mannlib.vitro.webapp.dao.UserAccountsDao;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.VClassDao;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
|
||||
import stubs.edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccessFactoryStub;
|
||||
import stubs.javax.servlet.ServletContextStub;
|
||||
|
||||
/**
|
||||
* Test that the Jena DAOs write different types of data to the appropriate models.
|
||||
|
@ -31,11 +33,14 @@ import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
|
|||
*/
|
||||
public class OntModelSegementationTest extends AbstractTestClass {
|
||||
|
||||
private WebappDaoFactoryJena wadf;
|
||||
@org.junit.Before
|
||||
private WebappDaoFactoryJena wadf;
|
||||
|
||||
@Before
|
||||
public void setUpWebappDaoFactoryJena() {
|
||||
super.setUp();
|
||||
wadf = new WebappDaoFactoryJena(new SimpleOntModelSelector());
|
||||
ServletContextStub ctx = new ServletContextStub();
|
||||
new ModelAccessFactoryStub().get(ctx).setWebappDaoFactory(wadf);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -9,7 +9,7 @@ import java.util.Map;
|
|||
|
||||
import edu.cornell.mannlib.vitro.testing.AbstractTestClass;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.apache.jena.ontology.OntModel;
|
||||
import org.apache.jena.ontology.OntModelSpec;
|
||||
import org.apache.jena.rdf.model.Model;
|
||||
|
@ -19,6 +19,8 @@ import org.apache.jena.vocabulary.XSD;
|
|||
import edu.cornell.mannlib.vitro.webapp.beans.PropertyInstance;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
|
||||
import stubs.edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccessFactoryStub;
|
||||
import stubs.javax.servlet.ServletContextStub;
|
||||
|
||||
|
||||
public class PropertyInstanceDaoJenaTest extends AbstractTestClass {
|
||||
|
@ -37,7 +39,16 @@ public class PropertyInstanceDaoJenaTest extends AbstractTestClass {
|
|||
"@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . \n"+
|
||||
"@prefix owl: <http://www.w3.org/2002/07/owl#> . \n";
|
||||
|
||||
private WebappDaoFactoryJena wadf;
|
||||
|
||||
@Before
|
||||
public void setUpWebappDaoFactoryJena() {
|
||||
super.setUp();
|
||||
wadf = new WebappDaoFactoryJena(new SimpleOntModelSelector());
|
||||
ServletContextStub ctx = new ServletContextStub();
|
||||
new ModelAccessFactoryStub().get(ctx).setWebappDaoFactory(wadf);
|
||||
}
|
||||
|
||||
void printModels(Model expected, Model result){
|
||||
System.out.println("Expected:");
|
||||
expected.write(System.out);
|
||||
|
|
|
@ -19,11 +19,16 @@ import org.apache.jena.rdf.model.Model;
|
|||
import org.apache.jena.rdf.model.ModelFactory;
|
||||
import org.apache.jena.rdf.model.ResourceFactory;
|
||||
import org.apache.jena.vocabulary.OWL;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import edu.cornell.mannlib.vitro.testing.AbstractTestClass;
|
||||
import edu.cornell.mannlib.vitro.webapp.beans.VClass;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
|
||||
import stubs.edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactoryStub;
|
||||
import stubs.edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccessFactoryStub;
|
||||
import stubs.javax.servlet.ServletContextStub;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -31,7 +36,14 @@ import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
|
|||
*/
|
||||
|
||||
public class VClassDaoTest extends AbstractTestClass {
|
||||
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
WebappDaoFactoryStub wdf = new WebappDaoFactoryStub();
|
||||
ServletContextStub ctx = new ServletContextStub();
|
||||
new ModelAccessFactoryStub().get(ctx).setWebappDaoFactory(wdf);
|
||||
}
|
||||
|
||||
@Test
|
||||
// Test that the VClassDaoJena::updateVClass method will only update the jena model for
|
||||
// those properties in VClass that have a different value from what is already in the
|
||||
|
@ -45,7 +57,9 @@ public class VClassDaoTest extends AbstractTestClass {
|
|||
// it will migrate to the super-model) because of the way jena handles additions and
|
||||
// deletions with respect to super and sub models. This migration of statements may cause
|
||||
// undesirable behavior in the vivo/vitro application.
|
||||
|
||||
|
||||
|
||||
public void modelIsolation(){
|
||||
|
||||
// 1. create two models and attach one as a sub-model of the other
|
||||
|
|
|
@ -7,8 +7,8 @@ import java.net.URLEncoder;
|
|||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import edu.cornell.mannlib.vitro.testing.AbstractTestClass;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.apache.jena.ontology.AllValuesFromRestriction;
|
||||
|
@ -38,11 +38,15 @@ import org.apache.jena.shared.Lock;
|
|||
import org.apache.jena.util.iterator.ClosableIterator;
|
||||
import org.apache.jena.vocabulary.RDFS;
|
||||
|
||||
import edu.cornell.mannlib.vitro.testing.AbstractTestClass;
|
||||
import edu.cornell.mannlib.vitro.webapp.beans.BaseResourceBean;
|
||||
import edu.cornell.mannlib.vitro.webapp.beans.Ontology;
|
||||
import edu.cornell.mannlib.vitro.webapp.beans.VClass;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.OntologyDao;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
|
||||
import stubs.edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactoryStub;
|
||||
import stubs.edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccessFactoryStub;
|
||||
import stubs.javax.servlet.ServletContextStub;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -51,7 +55,14 @@ import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
|
|||
*/
|
||||
|
||||
public class VClassJenaTest extends AbstractTestClass {
|
||||
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
WebappDaoFactoryStub wdf = new WebappDaoFactoryStub();
|
||||
ServletContextStub ctx = new ServletContextStub();
|
||||
new ModelAccessFactoryStub().get(ctx).setWebappDaoFactory(wdf);
|
||||
}
|
||||
|
||||
@Test
|
||||
// NIHVIVO-1157 introduced VClassJena.java, a lazy-loading version of VClass.java.
|
||||
// Per instructions from Brian L., this test tests that for one randomly selected Class,
|
||||
|
|
|
@ -9,6 +9,7 @@ import java.util.Map;
|
|||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import edu.cornell.mannlib.vitro.testing.AbstractTestClass;
|
||||
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
||||
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationVTwo;
|
||||
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.MultiValueEditSubmission;
|
||||
|
@ -16,7 +17,7 @@ import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldVTwo;
|
|||
|
||||
import stubs.javax.servlet.http.HttpServletRequestStub;
|
||||
|
||||
public class AntiXssValidationTest {
|
||||
public class AntiXssValidationTest extends AbstractTestClass{
|
||||
|
||||
@Test
|
||||
public void testLiteral( ){
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
@prefix vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#>.
|
||||
|
||||
<http://vivo.cornell.edu/individual/individualIssueVivo15> vivo:overview "There is a form feed in the following text. Hex 0c, that sometimes displays as ^L. Star Award for excellence in scientic publication and for productive collaborations with other Center scientists, U.S. Department of the Interior, 2009. Publications Award for scientist at Florida Integrated Science Center with highest annual scien-tic productivity as measured by number, quality, and impact of publications., U.S. Department of the Interior, 2009.";
|
||||
vivo:webpage <https://jira.duraspace.org/browse/VIVO-15>;
|
||||
vivo:webpage <https://jira.lyrasis.org/browse/VIVO-15>;
|
||||
a mann:CornellNonAcademicStaff,
|
||||
local:InternalThing,
|
||||
vivoc:CornellAffiliatedPerson,
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
@prefix vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#>.
|
||||
|
||||
<http://vivo.cornell.edu/individual/individualIssueVivo15> vivo:overview "There is a form feed in the following text. Hex 0c, that sometimes displays as ^L. Star Award for excellence in scientic publication and for productive collaborations with other Center scientists, U.S. Department of the Interior, 2009. Publications Award for scientist at Florida Integrated Science Center with highest annual scien-tic productivity as measured by number, quality, and impact of publications., U.S. Department of the Interior, 2009.";
|
||||
vivo:webpage <https://jira.duraspace.org/browse/VIVO-15>;
|
||||
vivo:webpage <https://jira.lyrasis.org/browse/VIVO-15>;
|
||||
a mann:CornellNonAcademicStaff,
|
||||
local:InternalThing,
|
||||
vivoc:CornellAffiliatedPerson,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue