String subjectaltname = username+"@foo.se";
String subjectaltname = "rfc822Name="+username+"@foo.se";
    public void test01Create2000Users() throws Exception {        log.debug(">test01Create2000Users()");        //UserDataRemote data1=null;        Admin administrator = new Admin(Admin.TYPE_RACOMMANDLINE_USER);        for (int i=0;i<2000;i++) {            String username = genUserName();            pwd = genRandomPwd();            /*            data1 = home.create(username, pwd, "C=SE, O=AnaTom, CN="+username);            assertNotNull("Error creating", data1);            */            int type  = 1;            int token = 1;            int profileid =  SecConst.EMPTY_ENDENTITYPROFILE;            int certificatetypeid = SecConst.CERTPROFILE_FIXED_ENDUSER;            int hardtokenissuerid = SecConst.NO_HARDTOKENISSUER;            boolean error = false;            boolean usehardtokenissuer = false;            String dn = "C=SE, O=AnaTom, CN="+username;            String subjectaltname = username+"@foo.se";            String email = username+"@foo.se";            if(cacheAdmin.findUser(administrator, username) != null){;              System.out.println("Error : User already exists in the database." );              error= true;            }            cacheAdmin.addUser(administrator, username, pwd, CertTools.stringToBCDNString(dn), subjectaltname, email, false, profileid, certificatetypeid,                                         type, token, hardtokenissuerid);            if (i%100 == 0) {                log.debug("Created "+i+" users...");            }        }        log.debug("Created 2000 users!");        log.debug("<test01Create2000Users()");    }