Package com.hp.hpl.jena.gvs

Examples of com.hp.hpl.jena.gvs.Store


   *
   */
  private void initControl() {
    Model authenticationModel = createAuthenticationModel();
   
    Store store = new MemoryStoreImpl();
    Source authenticationSource = new SourceImpl("http://localhost/authentication-master#");
    store.assertGraph(authenticationSource, new FCAGraphImpl(authenticationModel));
   
    Model authorizationModel = createAuthorizationModel();
    Source authorizationSource = new SourceImpl("http://localhost/authorization-master#");
    store.assertGraph(authorizationSource, new FCAGraphImpl(authorizationModel));
   
    Set<Source> sources = new HashSet<Source>();
    sources.add(authenticationSource);
    sources.add(authorizationSource);
    GraphOverTime configGOT = store.getGraphOverTime(sources );
    //JenaUtil.getModelFromGraph(configGOT.getGraph(new Date())).write(System.out);
    Configuration.setConfiguration(new GVSConfiguration(configGOT,
        "gvs"));
    Policy.setPolicy(new DefaultPolicy(configGOT));
  }
View Full Code Here


   * the SecurityConstants.DO_AS_PRIVILEGED_PERMISSION the user still has.
   *
   */
  public void notYetTestChangeUser() {
    final boolean[] exceptionCatched = new boolean[1];
    final Store store = new MemoryStoreImpl();
    Subject subject = new Subject();
    System.setSecurityManager(new SecurityManager());
    try {
      Subject.doAsPrivileged(subject, new PrivilegedExceptionAction() {
        public Object run() throws Exception {
          Source source = new SourceImpl("http://example.org/graph-source");
          Subject subject2 = new Subject();
          try {
            Subject.doAsPrivileged(null, new PrivilegedExceptionAction() {
              public Object run() throws Exception {
                Source source = new SourceImpl("http://example.org/graph-source");
                try {
                  store.assertGraph(source, new FCAGraphImpl(new SimpleGraph()));
                } catch (AccessControlException ex) {
                  exceptionCatched[0] = true;
                }
                return null;
              }
View Full Code Here

  /**
   * @param args
   */
  public static void main(String[] args) {
    Store store = FailureFinder.getStoreImpl();
    for (int i = 0; i < threads; i++) {
      startTestingThread(store, i);
    }
  }
View Full Code Here

  public boolean performTest(FCAGraph[] graphs) {
    for (int k = 0; k < 2; k++) {
    JenaParameters.disableBNodeUIDGeneration = true;
    try {
      ToyClock clock = new ToyClock();
      Store store = getStoreImpl(clock);
      Source source = new SourceImpl("http://example.org/graph-source");
      for (int i = 0; i < graphs.length; i++) {
        //TODO leanify based on dec
        graphs[i] = new FCAGraphImpl(MoleculeBasedLeanifier.getLeanVersionOf(graphs[i]));
      }
      TimedGraphSequence tgs = TimedGraphSequence
          .getSequenceWithRandomDates(graphs);
      for (int i = 0; i < tgs.getSize(); i++) {
        clock.setTime(tgs.getDate(i));
        store.updateGraph(source, tgs.getGraph(i));
      }
      if (!StoreTest.compareAllVersions(store, source, tgs)) {
        return false;
      }
    } catch (Exception ex) {
View Full Code Here

        System.err.println("Argument not understood "+unused);
        showHelp(invocationString);
        return;
      }
    }
    Store store;
    try {
      GraphCache cache;
      if (arguments.getUseEhcahe()) {
        cache = new EhcacheGraphCache();
      } else {
View Full Code Here

   
    recursiveDelete(testStoreDir);
    if (!testStoreDir.mkdirs()) {
      throw new RuntimeException("failed to create "+testStoreDir);
    }
    Store result =  new BaseStoreImpl(new MemoryMetaStore(), new FSMoleculeStore(testStoreDir, new EhcacheGraphCache()));
    return result;
  }
View Full Code Here

   * @param round
   */
  private static void singleRound(int round) {
    System.out.println("round nr: " + round);
    ToyClock clock = new ToyClock();
    Store store = getStoreImpl();
    store.setClock(clock);
    Source source = new SourceImpl("http://example.org/graph-source");
    TimedGraphSequence testData = TimedGraphSequence.getRandomSequence(4,
        315);// + 300);//(round / 5));
    try {
      System.out.println("writing current-case.txt");
      FileOutputStream currentCaseOut = new FileOutputStream(
          "current-case.txt");
      testData.write(currentCaseOut);
      currentCaseOut.close();
      currentCaseOut = null;
      // graphs representing the state of a changing graph in
      // chronological
      // order
      for (int i = 0; i < testData.getSize(); i++) {
        clock.setTime(testData.getDate(i));
        store.updateGraph(source, testData.getGraph(i));
      }
      for (int i = 0; i < 1/* 0 */; i++) {

        if (!StoreTest.compareVersionAtRandomDate(store, source,
            testData)) {
View Full Code Here

      public int getPort() {
        return 8989;
      }
     
    };
    Store store = new MemoryStoreImpl();
    File directory = new File("testdata");
    String baseURLString = "http://"
        + serverBinding.getInetAddress().getHostName() + ":"
        + serverBinding.getPort() + "/";
    CannedDataReader.readCannedData(store, directory, baseURLString);
View Full Code Here

  /**
   * @param data
   *
   */
  private static void action(SortedSet<Assertion> assertions) {
    Store store = new MemoryStoreImpl();
    CannedDataReader.addToStrore(store, assertions);
    GraphOverTime got = store.getGraphOverTime(Collections
        .singleton((Source) new SourceImpl(baseURLString + "danbri")));
    got.getGraph(new Date());
  }
View Full Code Here

    super(name);
  }

  public void testSingleSourceVersions() {
    ToyClock clock = new ToyClock();
    Store store = getStoreImpl(clock);
    Source source = new SourceImpl("http://example.org/graph-source");

    // graphs representing the state of a changing graph in chronological
    // order
    TimedGraphSequence testData = TimedGraphSequence.getRandomSequence(12,
        100);
    for (int i = 0; i < testData.getSize(); i++) {
      clock.setTime(testData
          .getDate(i));
      store
          .updateGraph(source, testData.getGraph(i));
    }
    for (int i = 0; i < 10; i++) {
      assertTrue("retreved graph equals to original",
          compareVersionAtRandomDate(store, source, testData));
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.gvs.Store

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.