RealmTest.java revision 3a6d5ffcd36b94407cb6d3b5cf9ca204071559a0
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: RealmTest.java,v 1.8 2008/06/25 05:44:18 qcheng Exp $
*
*/
/**
* Portions Copyrighted 2012 ForgeRock Inc
*/
/**
* This is to test the realm related sub commands.
*/
private CommandManager cmdManager;
/**
* Creates a new instance of <code>RealmTest</code>
*/
public RealmTest() {
super("CLI");
}
/**
* Create the CLIManager.
*/
public void suiteSetup()
throws CLIException {
"com.sun.identity.cli.AccessManager");
}
@Parameters ({"realm"})
throws CLIException, SMSException {
"create-realm",
realm};
exiting("createRealm");
}
@Parameters ({"parent-realm"})
throws CLIException, SMSException {
"list-realms",
"*",
exiting("listRealms");
}
@Parameters ({"realm"})
throws CLIException, SMSException {
"list-realm-assignable-svcs",
realm};
exiting("getAssignableServicesInRealm");
}
@Parameters ({"realm"})
throws CLIException, SMSException {
"show-realm-svcs",
realm};
exiting("getAssignedServicesInRealm");
}
public void assignedServiceToRealm(
"add-svc-realm",
};
getAdminSSOToken(), realm);
exiting("assignedServiceToRealm");
}
@Parameters ({"realm"})
throws CLIException {
"get-realm",
"/",
"sunIdentityRepositoryService"
};
exiting("getRealmAttributeValues");
}
@Parameters ({"realm"})
dependsOnMethods = {"removeRealmAttribute"})
"set-realm-attrs",
"sunIdentityRepositoryService",
"sunOrganizationStatus=Active"
};
getAdminSSOToken(), realm);
exiting("setRealmAttributeValues");
}
@Parameters ({"realm"})
"delete-realm-attr",
"sunIdentityRepositoryService",
"sunOrganizationStatus"
};
getAdminSSOToken(), realm);
assert (attrValues == null);
exiting("removeRealmAttribute");
}
public void createPolicy()
"create-policies",
"/",
};
assert (p != null);
exiting("createPolicy");
}
dependsOnMethods = {"createPolicy"})
public void getPolicy()
"list-policies",
"/"
};
exiting("getPolicy");
}
dependsOnMethods = {"getPolicy"})
public void deletePolicy()
"delete-policies",
"/",
"clipolicy"
};
try {
assert (p == null);
} catch (NameNotFoundException e) {
// do nothing
}
exiting("deletePolicy");
}
dependsOnMethods = {"assignedServiceToRealm"})
throws CLIException {
"get-realm-svc-attrs",
};
exiting("getServiceAttribute");
}
dependsOnMethods = {"assignedServiceToRealm"})
public void setServiceAttribute(
"set-svc-attrs",
};
getAdminSSOToken(), realm);
exiting("setServiceAttribute");
}
@Parameters ({"realm"})
dependsOnMethods = {"assignedServiceToRealm"})
"set-realm-attrs",
"sunIdentityRepositoryService",
"sunOrganizationAliases=dummy"
};
exiting("addRealmAttribute");
}
dependsOnGroups = {"services"})
public void unassignServiceFromRealm(
"remove-svc-realm",
};
getAdminSSOToken(), realm);
exiting("unassignServiceFromRealm");
}
@Parameters ({"realm"})
throws CLIException, SMSException {
"delete-realm",
realm};
exiting("deleteRealm");
}
}