Package com.google.nigori.client

Examples of com.google.nigori.client.NigoriDatastore.register()


  public void setGetDelete() throws NigoriCryptographyException, IOException, UnauthorisedException {
    NigoriDatastore nigori = getStore();

    for (int i = 0; i < AcceptanceTests.REPEAT; ++i) {// check we can do this more than once
      try {
        assertTrue("Not registered" + i, nigori.register());
        assertTrue("Not a clean store " + i, nigori.getIndices().isEmpty());

        for (IndexValue iv : testCases) {// once round for each
          final Index index = iv.index;
          final Revision revision = iv.revvalue.getRevision();
View Full Code Here


  @Test
  public void getRevisions() throws IOException, NigoriCryptographyException, UnauthorisedException {
    NigoriDatastore nigori = getStore();
    try {
      assertTrue("Not registered", nigori.register());
      final Index index = new Index("index");
      final Revision a = new Revision("a");
      final Revision b = new Revision("b");
      assertTrue("Not put", nigori.put(index, a, toBytes("aa")));
      assertTrue("Not put", nigori.put(index, b, toBytes("bb")));
View Full Code Here

  @Test
  public void getIndices() throws IOException, NigoriCryptographyException, UnauthorisedException {
    NigoriDatastore nigori = getStore();
    try {
      assertTrue("Not registered", nigori.register());
      final Index indexa = new Index("indexa");
      final Index indexb = new Index("indexb");
      final Revision revision = new Revision("a");
      assertTrue("Not put", nigori.put(indexa, revision, toBytes("aa")));
      assertTrue("Not put", nigori.put(indexb, revision, toBytes("bb")));
View Full Code Here

  // this due to the way revisions are generated.
  public void immutableRevisions() throws IOException, NigoriCryptographyException,
      UnauthorisedException {
    NigoriDatastore nigori = getStore();
    try {
      assertTrue("Not registered", nigori.register());
      final Index index = new Index("index");
      final Revision revision = new Revision("rev");
      assertTrue("Not put", nigori.put(index, revision, Util.int2bin(0)));
      assertFalse("Could replace revision value", nigori.put(index, revision, Util.int2bin(1)));
      nigori.delete(index, NULL_DELETE_TOKEN);
View Full Code Here

          try {
            NigoriDatastore nigori = getStore();

            for (int i = 0; i < AcceptanceTests.REPEAT * REPEAT_FACTOR; ++i) {
              // check we can do this more than once
              assertTrue("Not registered" + i, nigori.register());
              try {
                for (IndexValue iv : SetGetDeleteTest.testCases) {// once round for each
                  final Index index = iv.index;
                  final byte[] value = iv.revvalue.getValue();
                  final Revision revision = iv.revvalue.getRevision();
View Full Code Here

      UnauthorisedException {
    failed = false;
    Thread[] threads = new Thread[THREADS];

    final NigoriDatastore nigori = getStore();
    assertTrue("Not registered", nigori.register());
    try {
      final List<Throwable> exceptionList =
          Collections.synchronizedList(new LinkedList<Throwable>());
      for (int j = 0; j < THREADS; ++j) {
        threads[j] = new Thread() {
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.