userInfo.usri1_priv = LMAccess.USER_PRIV_USER;
// ignore test if not able to add user (need to be administrator to do this).
assumeTrue(LMErr.NERR_Success == Netapi32.INSTANCE.NetUserAdd(null, 1, userInfo, null));
try {
IWindowsAuthProvider prov = new WindowsAuthProviderImpl();
IWindowsIdentity identity = prov.logonUser(userInfo.usri1_name.toString(),
userInfo.usri1_password.toString());
IWindowsImpersonationContext ctx = identity.impersonate();
assertTrue(userInfo.usri1_name.toString().equals(Advapi32Util.getUserName()));
ctx.revertToSelf();
assertFalse(userInfo.usri1_name.toString().equals(Advapi32Util.getUserName()));