Database { public static native SyncgroupSpec JoinSyncgroup(String name, String remoteSyncbaseName, List<String> expectedSyncbaseBlessings, Id syncgroupId, SyncgroupMemberInfo info) throws VError;  static native VersionedPermissions GetPermissions(String name); static native void SetPermissions(String name, VersionedPermissions permissions); static native void Create(String name, Permissions permissions); static native void Destroy(String name); static native boolean Exists(String name); static native String BeginBatch(String name, BatchOptions options); static native List<Id> ListCollections(String name, String batchHandle); static native void Commit(String name, String batchHandle); static native void Abort(String name, String batchHandle); static native byte[] GetResumeMarker(String name, String batchHandle); static native List<Id> ListSyncgroups(String name); static native void CreateSyncgroup(String name, Id syncgroupId, SyncgroupSpec spec, SyncgroupMemberInfo info); static native SyncgroupSpec JoinSyncgroup(String name, String remoteSyncbaseName, List<String> expectedSyncbaseBlessings, Id syncgroupId, SyncgroupMemberInfo info); static native void LeaveSyncgroup(String name, Id syncgroupId); static native void DestroySyncgroup(String name, Id syncgroupId); static native void EjectFromSyncgroup(String name, Id syncgroupId, String member); static native VersionedSyncgroupSpec GetSyncgroupSpec(String name, Id syncgroupId); static native void SetSyncgroupSpec(String name, Id syncgroupId, VersionedSyncgroupSpec spec); static native Map<String, SyncgroupMemberInfo> GetSyncgroupMembers(String name, Id syncgroupId); static native void WatchPatterns(String name, byte[] resumeMarker, List<CollectionRowPattern> patterns, WatchPatternsCallbacks callbacks); static native long SyncgroupInvitesNewScan(String name, SyncgroupInvitesCallbacks callbacks); static native void SyncgroupInvitesStopScan(long id);  }
@Test public void joinSyncgroup() { Id dbId = new Id("idp:a:angrybirds", "join_syncgroup"); String dbName = dbId.encode(); Id sgId = new Id("idp:u:alice", "syncgroup"); boolean exceptionThrown = false; try { Database.JoinSyncgroup( dbName, "", new ArrayList<String>(), sgId, new SyncgroupMemberInfo()); } catch (VError vError) { assertEquals("v.io/v23/verror.NoExist", vError.id); assertNotNull(vError.message); assertNotNull(vError.stack); assertEquals(0, vError.actionCode); exceptionThrown = true; } assertTrue(exceptionThrown); }