Class Helper

java.lang.Object
org.nuxeo.ecm.core.opencmis.tests.Helper

public class Helper extends Object
Various static methods used in several test cases.
  • Field Details

  • Constructor Details

    • Helper

      public Helper()
  • Method Details

    • read

      public static String read(InputStream in, String charset) throws IOException
      Reads a stream into a string.
      Throws:
      IOException
    • getCalendar

      public static GregorianCalendar getCalendar(int year, int month, int day, int hours, int minutes, int seconds)
      Gets a Calendar object.
    • getCalendar

      public static GregorianCalendar getCalendar(int year, int month, int day, int hours, int minutes, int seconds, TimeZone tz)
      Gets a Calendar object with a specific timezone
    • makeNuxeoRepository

      public static Map<String,String> makeNuxeoRepository(CoreSession session)
    • makeNuxeoRepository

      public static Map<String,String> makeNuxeoRepository(CoreSession session, boolean addProxy)
      Creates data in the repository using the Nuxeo API. This is then used as a starting point by unit tests.
    • sleepForAuditGranularity

      public static void sleepForAuditGranularity()
      For audit, make sure event dates don't have the same millisecond.
    • createDocument

      public static DocumentModel createDocument(CoreSession session, DocumentModel doc)
    • saveDocument

      public static DocumentModel saveDocument(CoreSession session, DocumentModel doc)
    • createUserWorkspace

      public static String createUserWorkspace(CoreSession repo, String username)