Package uk.ac.osswatch.simal.rdf

Examples of uk.ac.osswatch.simal.rdf.SimalRepositoryException


   *          (i.e. not a test repo)
   * @throws SimalRepositoryException
   */
  public void initialise(String directory) throws SimalRepositoryException {
    if (model != null) {
      throw new SimalRepositoryException(
          "Illegal attempt to create a second SimalRepository in the same JAVA VM.");
    }

    if (isTest) {
      model = ModelFactory.createDefaultModel();
View Full Code Here


   */
  private void initTestData() throws SimalRepositoryException {
    try {
      ModelSupport.addTestData(this);
    } catch (Exception e) {
      throw new SimalRepositoryException("Unable to add test data", e);
    }
  }
View Full Code Here

      bw.flush();

      addProject(file.toURI().toURL(), "");
    } catch (MalformedURLException mue) {
      // should never happen as we created the file here
      throw new SimalRepositoryException(
          "Strange... a file we created has a malformed URL", mue);
    } catch (IOException e) {
      throw new SimalRepositoryException(
          "Unable to write file from data string", e);
    } finally {
      if (bw != null) {
        try {
          bw.close();
View Full Code Here

      throws SimalRepositoryException {
    try {
      model.read(url.openStream(), baseURI);
      LOGGER.debug("Added RDF/XML from " + url.toString());
    } catch (IOException e) {
      throw new SimalRepositoryException("Unable to open stream for " + url, e);
    }
  }
View Full Code Here

    } catch (QueryException e) {
      String message = "QueryException when trying to SPARQLquery with query: "
          + queryStr;
      LOGGER.warn(message + "; message: " + e.getMessage());
      throw new SimalRepositoryException(message, e);
    } finally {
      if (qe != null) {
        qe.close();
      }
    }
View Full Code Here

    String className = "org.apache.derby.jdbc.EmbeddedDriver";

    try {
      Class.forName(className);
    } catch (ClassNotFoundException e) {
      throw new SimalRepositoryException("Unable to find derby driver", e);
    }
  }
View Full Code Here

public class SimalRepositoryExceptionTest {

  @Test
  public void testSimalRepositoryException() {
    SimalRepositoryException e = new SimalRepositoryException("Just testing",
        null);
    assertEquals("Just testing", e.getMessage());
    assertNull(e.getCause());

    e = new SimalRepositoryException("Just testing", new IOException(
        "Just testing an IO exception"));
    assertEquals("Just testing", e.getMessage());
    assertNotNull(e.getCause());
  }
View Full Code Here

TOP

Related Classes of uk.ac.osswatch.simal.rdf.SimalRepositoryException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.