Examples of revert()


Examples of org.apache.jackrabbit.jcr2spi.state.ItemState.revert()

        int oldStatus = state.getStatus();
        switch (oldStatus) {
            case Status.EXISTING_MODIFIED:
            case Status.STALE_MODIFIED:
                // revert state modifications
                state.revert();
                state.setStatus(Status.EXISTING);
                break;
            case Status.EXISTING_REMOVED:
                // revert state modifications
                state.revert();
View Full Code Here

Examples of org.apache.jackrabbit.jcr2spi.state.ItemState.revert()

                state.revert();
                state.setStatus(Status.EXISTING);
                break;
            case Status.EXISTING_REMOVED:
                // revert state modifications
                state.revert();
                state.setStatus(Status.EXISTING);
                break;
            case Status.NEW:
                // reverting a NEW state is equivalent to its removal.
                // however: no need remove the complete hierarchy as revert is
View Full Code Here

Examples of org.apache.poi.openxml4j.opc.OPCPackage.revert()

      PackagePartName nameDerived = PackagingURIHelper
          .createPartName("/word/document.xml/image1.gif");
      pkg.createPart(name, ContentTypes.XML);
      pkg.createPart(nameDerived, ContentTypes.EXTENSION_GIF);
    } catch (InvalidOperationException e) {
      pkg.revert();
      return;
    } catch (InvalidFormatException e) {
      fail(e.getMessage());
    }
    fail("A package implementer shall neither create nor recognize a part with a"
View Full Code Here

Examples of org.apache.poi.openxml4j.opc.OPCPackage.revert()

    } catch (InvalidFormatException e) {
      throw new RuntimeException(e);
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
    pkg.revert();
  }

  private static String extractInvalidFormatMessage(String sampleNameSuffix) {

    InputStream is = OpenXML4JTestDataSamples.openComplianceSampleStream("OPCCompliance_CoreProperties_" + sampleNameSuffix);
View Full Code Here

Examples of org.apache.poi.openxml4j.opc.OPCPackage.revert()

      // expected during successful test
      return e.getMessage();
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
    pkg.revert();
    // Normally must thrown an InvalidFormatException exception.
    throw new AssertionFailedError("expected OPC compliance exception was not thrown");
  }
 
  /**
 
View Full Code Here

Examples of org.apache.poi.openxml4j.opc.OPCPackage.revert()

      throw new RuntimeException(e);
    } catch (InvalidOperationException e) {
      // expected during successful test
      assertEquals("OPC Compliance error [M4.1]: can't add another core properties part ! Use the built-in package method instead.", e.getMessage());
    }
    pkg.revert();
  }

  /**
   * Test M4.1 rule.
   */
 
View Full Code Here

Examples of org.apache.poi.openxml4j.opc.OPCPackage.revert()

      throw new RuntimeException(e);
    } catch (InvalidOperationException e) {
      // expected during successful test
      assertEquals("OPC Compliance error [M4.1]: you try to add more than one core properties relationship in the package !", e.getMessage());
    }
    pkg.revert();
  }

  /**
   * Test M4.2 rule.
   */
 
View Full Code Here

Examples of org.apache.poi.openxml4j.opc.OPCPackage.revert()

    PackagePartName relativeName = PackagingURIHelper.createPartName(
        "media/image1.gif", partBase);
    assertTrue("The part name must be equal to "
        + partNameToValid.getName(), partNameToValid
        .equals(relativeName));
    pkg.revert();
  }

  /**
   * Test createPartName(URI, y)
   */
 
View Full Code Here

Examples of org.apache.poi.openxml4j.opc.OPCPackage.revert()

    PackagePartName relativeName = PackagingURIHelper.createPartName(
        new URI("media/image1.gif"), partBase);
    assertTrue("The part name must be equal to "
        + partNameToValid.getName(), partNameToValid
        .equals(relativeName));
    pkg.revert();
  }
}
View Full Code Here

Examples of org.apache.poi.openxml4j.opc.OPCPackage.revert()

    PackagePartName relativeName = PackagingURIHelper.createPartName(
        "media/image1.gif", partBase);
    assertTrue("The part name must be equal to "
        + partNameToValid.getName(), partNameToValid
        .equals(relativeName));
    pkg.revert();
  }

  /**
   * Test createPartName(URI, y)
   */
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.