code: package it.unibz.inf.ontop.docker.mysql;
  
  
  import it.unibz.inf.ontop.docker.AbstractVirtualModeTest;
  import it.unibz.inf.ontop.owlapi.OntopOWLEngine;
  import it.unibz.inf.ontop.owlapi.connection.OntopOWLConnection;
  import it.unibz.inf.ontop.owlapi.connection.OntopOWLStatement;
  import org.junit.AfterClass;
  import org.junit.BeforeClass;
  import org.junit.Test;
  import org.semanticweb.owlapi.model.OWLException;
  import org.semanticweb.owlapi.model.OWLOntologyCreationException;
  
  public class ViewGenerationParserTest extends AbstractVirtualModeTest {
  
      static final String owlFile = "/mysql/northwind/northwind.owl";
      static final String obdaFile = "/mysql/northwind/northwindComplex.obda";
      static final String propertiesFile = "/mysql/northwind/northwindComplex.properties";
  
      private static OntopOWLEngine REASONER;
      private static OntopOWLConnection CONNECTION;
  
      @BeforeClass
      public static void before() throws OWLOntologyCreationException {
          REASONER = createReasoner(owlFile, obdaFile, propertiesFile);
          CONNECTION = REASONER.getConnection();
      }
  
      @Override
      protected OntopOWLStatement createStatement() throws OWLException {
          return CONNECTION.createStatement();
      }
  
      @AfterClass
      public static void after() throws Exception {
          CONNECTION.close();
          REASONER.close();
      }
  
      @Test
      public void testComplexFunction() throws Exception {
          String query = "PREFIX : <http://www.semanticweb.org/vidar/ontologies/2014/11/northwind-handmade#>" +
                  " select * {?x a :Category}";
          countResults(8, query);
      }
      @Test
      public void testComplexFunction2() throws Exception {
          String query = "PREFIX : <http://www.semanticweb.org/vidar/ontologies/2014/11/northwind-handmade#>" +
                  " select * {?x a :Customer}";
          countResults(93, query);
      }
  
      @Test
      public void testSimpleFunction() throws Exception {
          String query = "PREFIX : <http://www.semanticweb.org/vidar/ontologies/2014/11/northwind-handmade#>" +
                  " select * {?x :locationRegion ?y}";
          countResults(4, query);
      }
  
      @Test
      public void testStar() throws Exception {
          String query = "PREFIX : <http://www.semanticweb.org/vidar/ontologies/2014/11/northwind-handmade#>" +
                  " select * {?x :orderDetailDiscount ?y}";
          countResults(830, query);
      }
  
  }
  
  