예제 #1
0
  private String makeDescription() {
    String tmp = "";
    if (testItem.getDefaultGraphURIs() != null) {
      for (Iterator<String> iter = testItem.getDefaultGraphURIs().iterator(); iter.hasNext(); )
        tmp = tmp + iter.next();
    }
    if (testItem.getNamedGraphURIs() != null) {
      for (Iterator<String> iter = testItem.getNamedGraphURIs().iterator(); iter.hasNext(); )
        tmp = tmp + iter.next();
    }

    String d = "Test " + testNumber + " :: " + testItem.getName();
    // +" :: QueryFile="+testItem.getQueryFile()+
    //          ", DataFile="+tmp+", ResultsFile="+testItem.getResultFile() ;
    return d;
  }
예제 #2
0
  private Dataset setUpDataset(Query query, TestItem testItem) {
    try {
      // testItem.requiresTextIndex()

      if (doesQueryHaveDataset(query) && doesTestItemHaveDataset(testItem)) {
        // Only warn if there are results to test
        // Syntax tests may have FROM etc and a manifest data file.
        if (testItem.getResultFile() != null)
          Log.warn(this, testItem.getName() + " : query data source and also in test file");
      }

      // In test file?
      if (doesTestItemHaveDataset(testItem))
        // Not specified in the query - get from test item and load
        return createDataset(testItem.getDefaultGraphURIs(), testItem.getNamedGraphURIs());

      // Check 3 - were there any at all?

      if (!doesQueryHaveDataset(query)) fail("No dataset");

      // Left to query
      return null;

    } catch (JenaException jEx) {
      fail("JenaException creating data source: " + jEx.getMessage());
      return null;
    }
  }
예제 #3
0
 private static boolean doesTestItemHaveDataset(TestItem testItem) {
   boolean r =
       (testItem.getDefaultGraphURIs() != null && testItem.getDefaultGraphURIs().size() > 0)
           || (testItem.getNamedGraphURIs() != null && testItem.getNamedGraphURIs().size() > 0);
   return r;
 }