remove scope support for now part 2

This commit is contained in:
Bill Burke committed 2014-03-06 10:26:46 -05:00
1 parent 801ef3281a
commit dd292c1d52
11 files changed
+2 -133

No files matched your search

@@ -5,11 +5,9 @@ import org.junit.Test;
import org.keycloak.jose.jws.JWSBuilder;
import org.keycloak.jose.jws.JWSInput;
import org.keycloak.jose.jws.crypto.RSAProvider;
import org.keycloak.representations.AccessScope;
import org.keycloak.representations.AccessToken;
import org.keycloak.util.JsonSerialization;
import java.io.IOException;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
@@ -18,55 +16,6 @@ import java.security.KeyPairGenerator;
* @version $Revision: 1 $
*/
public class SkeletonKeyTokenTest {
private static class Parser implements Runnable {
private String json;
private Parser(String json) {
this.json = json;
}
@Override
public void run() {
for (int i = 0; i < 10000; i++) {
try {
AccessScope scope = JsonSerialization.readValue(json.getBytes(), AccessScope.class);
} catch (IOException e) {
}
}
}
}
@Test
public void testScope() throws Exception {
AccessScope scope2 = new AccessScope();
scope2.add("one", "admin");
scope2.add("one", "buyer");
scope2.add("two", "seller");
String json = JsonSerialization.writeValueAsString(scope2);
System.out.println(json);
/*
Thread[] threads = new Thread[1000];
for (int i = 0; i < 1000; i++) {
threads[i] = new Thread(new Parser(json));
}
long start = System.currentTimeMillis();
for (Thread thread : threads) {
thread.start();
}
for (Thread thread : threads) {
thread.join();
}
long end = System.currentTimeMillis() - start;
System.out.println("Time took: " + end);
*/
}
@Test
public void testToken() throws Exception {
AccessToken token = new AccessToken();