@@ -0,0 +1,1339 @@
+package test.ccn.security.access;%0A%0A%0Aimport org.junit.Assert;%0Aimport org.junit.BeforeClass;%0Aimport org.junit.Test;%0A%0Aimport com.parc.ccn.data.ContentName;%0Aimport com.parc.ccn.library.CCNLibrary;%0Aimport com.parc.ccn.security.keys.KeyManager;%0A%0Apublic class TestUserDataTestRepo %7B%0A%09%0A%09static ContentName userNamespace = null;%0A%09static int userCount = 10;%0A%0A%09@BeforeClass%0A%09public static void setUpBeforeClass() throws Exception %7B%0A%09%09userNamespace = ContentName.fromNative(%22/parc/Users%22);%0A%09%7D%0A%09%0A%09@Test%0A%09public void testUserCreation() %7B%0A%09%09try %7B%0A%09%09%09TestUserData td = new TestUserData(userNamespace, userCount,%0A%09%09%09%09%09true,%0A%09%09%09%09%09%22password%22.toCharArray(), CCNLibrary.open());%0A%09%09%09StringBuffer sb = new StringBuffer(%22Users: %22);%0A%09%09%09for (String s : td.friendlyNames()) %7B%0A%09%09%09%09sb.append(%22 %22 + s);%0A%09%09%09%7D%0A%09%09%09System.out.println(sb.toString());%0A%09%09%09System.out.println(%22Attempting to recover stored users.%22);%0A%09%09%09TestUserData td2 = new TestUserData(userNamespace, userCount,%0A%09%09%09%09%09true,%0A%09%09%09%09%09%22password%22.toCharArray(), CCNLibrary.open());%0A%09%09%09Assert.assertEquals(td.friendlyNames(), td2.friendlyNames());%0A%09%09%09%0A%09%09%09// OK, now let's make a library using one of these users.%0A%09%09%09// DKS TODO -- finish%0A%09%09%09KeyManager userKeyManager = td2.getUser(td2.friendlyNames().iterator().next());%0A%09%09%7D catch (Exception e) %7B%0A%09%09%09e.printStackTrace();%0A%09%09%09Assert.fail(%22Exception: %22 + e);%0A%09%09%7D%0A%0A%09%7D%0A%0A%7D%0A

Test for user generation.