Пример #1
0
  @Test
  public void testCheckOutForInstance() throws Exception {

    URL resource = getClass().getResource("/org/kuali/ole/repository/requestInstance.xml");
    File file = new File(resource.toURI());
    String inputFile = readFile(file);
    Request request = new RequestHandler().toObject(inputFile);
    Response response = ingestNIndexHandlerService.ingestNIndexRequestDocuments(request);
    assertNotNull(response);
    List<RequestDocument> docStoreDocuments = request.getRequestDocuments();

    CheckoutManager checkoutManager = new CheckoutManager();
    for (Iterator<RequestDocument> iterator = docStoreDocuments.iterator(); iterator.hasNext(); ) {
      RequestDocument next = iterator.next();
      String checkedOutContent = checkoutManager.checkOut(next.getUuid(), "mockUser", "checkout");
      assertNotNull(checkedOutContent);
      System.out.println(checkedOutContent);
    }
  }
Пример #2
0
  @Test
  public void testCheckOut() throws Exception {
    URL resource = getClass().getResource("request.xml");
    File file = new File(resource.toURI());
    String inputFile = readFile(file);
    Request request = new RequestHandler().toObject(inputFile);
    Response response = ingestNIndexHandlerService.ingestNIndexRequestDocuments(request);
    assertNotNull(response);
    List<RequestDocument> docStoreDocuments = request.getRequestDocuments();

    CheckoutManager checkoutManager = new CheckoutManager();
    DocStoreLogger docStoreLogger = checkoutManager.getDocStoreLogger();
    docStoreLogger.log("checkOutManager");
    for (Iterator<RequestDocument> iterator = docStoreDocuments.iterator(); iterator.hasNext(); ) {
      RequestDocument next = iterator.next();
      String checkedOutContent = checkoutManager.checkOut(next.getUuid(), "mockUser", "checkout");
      docStoreLogger.log("checkOut content:" + checkedOutContent);
      assertNotNull(checkedOutContent);
    }
  }