DatabaseManager.delete(context, "eperson", eid); context.complete();
    public void testAccountManager()    {        // NOTE: This test makes some assumptions about the internal API,        // namely:        //        //   All the real processing for the official methods        //   sendRegistrationInfo and sendForgotPasswordInfo is done        //   by the internal sendInfo method.        Context context = null;        try        {            context = new Context();            // An unlikely email address            String email = "foo@bar.testing.DO_NOT_USE";            EPerson ep = createEPerson(context, email);            assertNotNull("Got an EPerson for testing", ep);            int eid = ep.getID();            ////////////////////            // Registration            ////////////////////            // Create callback data for registration            TableRow registration_data =                AccountManagerShim.publicSendInfo(context, email, true, false);            assertNotNull("Created callback data for registration",                          registration_data);            // Get the EPerson from the Callback            EPerson registration_eperson =                AccountManager.getEPerson                (context, registration_data.getStringColumn("token"));            assertNotNull("Got an eperson from the callback",                registration_eperson);            assertEquals("Got the same eperson that we registered",                registration_eperson.getID(), eid);            // Cleanup registration            String registration_token = registration_data.getStringColumn("token");            AccountManager.deleteToken(context, registration_token);            assertNull("No EPerson corresponding to token",                AccountManager.getEPerson(context, registration_token));            ////////////////////            // Change password            ////////////////////            // Create callback data for changing passwords            TableRow change_password_data =                AccountManagerShim.publicSendInfo(context, email, false, false);            assertNotNull("Created callback data for changing password",                change_password_data);            // Get the EPerson from the Callback            EPerson change_password_eperson =                AccountManager.getEPerson                (context, change_password_data.getStringColumn("token"));            assertNotNull("Got an eperson from the callback",                change_password_eperson);            assertEquals("Got the same eperson that we registered",                         change_password_eperson.getID(), eid);            // Clean up change_password            String change_password_token = change_password_data.getStringColumn("token");            AccountManager.deleteToken(context, change_password_token);            assertNull("No EPerson corresponding to token",                AccountManager.getEPerson(context, change_password_token));            // Lastly, clean up the EPerson            DatabaseManager.delete(context, "eperson", eid);            context.complete();        }        catch (Exception e)        {            if (context != null)                context.abort();            e.printStackTrace();            System.out.println("Got exception: " + e);            fail("Exception while running test: " + e);        }    }