Service { public static native VersionedPermissions GetPermissions();  static native void Init(String rootDir, boolean testLogin, int logLevel); static native void Serve(); static native void Shutdown(); static native VersionedPermissions GetPermissions(); static native void SetPermissions(VersionedPermissions permissions); static native List<Id> ListDatabases(); static native void Login(String oAuthProvider, String oAuthToken); static native boolean IsLoggedIn();  }
@Test public void getPermissions() { VersionedPermissions versionedPermissions1 = Service.GetPermissions(); assertNotNull(versionedPermissions1); assertTrue(versionedPermissions1.version.length() > 0); String json = new String(versionedPermissions1.permissions.json); assertTrue(json.contains("Admin")); try { Service.SetPermissions(versionedPermissions1); VersionedPermissions versionedPermissions2 = Service.GetPermissions(); assertEquals("1", versionedPermissions2.version); assertEquals(json, new String(versionedPermissions2.permissions.json)); } catch (VError vError) { vError.printStackTrace(); fail(vError.toString()); } }