/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can
* obtain a copy of the License at
* or packager/legal/LICENSE.txt. See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each
* file and include the License file at packager/legal/LICENSE.txt.
*
* GPL Classpath Exception:
* Oracle designates this particular file as subject to the "Classpath"
* exception as provided by Oracle in the GPL Version 2 section of the License
* file that accompanied this code.
*
* Modifications:
* If applicable, add the following below the License Header, with the fields
* enclosed by brackets [] replaced by your own identifying information:
* "Portions Copyright [year] [name of copyright owner]"
*
* Contributor(s):
* If you wish your version of this file to be governed by only the CDDL or
* only the GPL Version 2, indicate your decision by adding "[Contributor]
* elects to include this software in this distribution under the [CDDL or GPL
* Version 2] license." If you don't indicate a single choice of license, a
* recipient has the option to distribute your version of this file under
* either the CDDL, the GPL Version 2 or to extend the choice of license to
* its licensees as provided above. However, if you add GPL Version 2 code
* and therefore, elected the GPL Version 2 license, then the option applies
* only if the new code is made subject to such option by the copyright
* holder.
*/
/**
*/
public final class AuthRealmConfigTest
extends ConfigMgrTestBase {
public AuthRealmConfigTest() {
if (checkNotOffline("ensureDefaultInstance")) {
}
}
private static boolean WARNED_TESTABLE = false;
try {
" does not have a 'file' property (test skipped)");
" uses a ${...} name, not yet supported (test skipped)");
} else {
}
}
catch (Exception e) {
}
}
}
if (!WARNED_TESTABLE) {
WARNED_TESTABLE = true;
}
return std;
}
public synchronized void
testGetters() {
}
}
}
private boolean
final AuthRealmConfig config,
warning( "testAddRemoveUpdateUser.userExists(): NO API exists to getUserNames()" );
//return GSetUtil.newStringSet((String[]) config.getUserNames()).contains(user);
return false;
}
public synchronized void
throws Exception {
/*
final Map<String, AuthRealmConfig> arcMap = getTestableAuthRealms();
final String USER = "test";
final Set<AuthRealmConfig> failures = new HashSet<AuthRealmConfig>();
for (final AuthRealmConfig ar : arcMap.values()) {
//printVerbose( "TESTING: " + ar.getName() );
try {
ar.getUserNames();
if (userExists(ar, USER)) {
ar.removeUser(USER);
}
ar.addUser(USER, "foo-pwd", null);
assert (userExists(ar, USER));
ar.updateUser(USER, "foo-pwd2", null);
assert (userExists(ar, USER));
ar.removeUser(USER);
assert (!userExists(ar, USER));
//printVerbose( "SUCCESS testing: " + ar.getName() );
}
catch (Exception e) {
trace("");
trace("");
trace("FAILURE FOR: " + ar.getName());
//e.printStackTrace();
failures.add(ar);
}
}
if (failures.size() != 0) {
final Set<String> names = Util.getNames(failures);
warning("testAddRemoveUpdateUser failed on the following realms: " +
CollectionUtil.toString(names));
assert (false);
}
*/
}
public synchronized void
warning( "testAddRemoveUpdateUser.testGetGroupNames(): NO API exists for getGroupNames()" );
/*
final Map<String, AuthRealmConfig> arcMap = getTestableAuthRealms();
for (final AuthRealmConfig ar : arcMap.values()) {
ar.getGroupNames();
}
*/
}
public synchronized void
warning( "testAddRemoveUpdateUser.testGetUserGroupNames(): NO API exists for getUserNames(), getUserGroupNames()" );
/*
final Map<String, AuthRealmConfig> arcMap = getTestableAuthRealms();
for (final AuthRealmConfig ar : arcMap.values()) {
final String[] users = ar.getUserNames();
for (final String user : users) {
ar.getUserGroupNames(user);
}
}
*/
}
public static String
return getDefaultInstanceName("AuthRealmConfig");
}
public static AuthRealmConfig
KEY_FILE_PREFIX + "default-instance-test");
}
return result;
}
public static AuthRealmConfig
}
protected Container
return getConfigConfig().getSecurityServiceConfig();
}
protected String
return XTypes.AUTH_REALM_CONFIG;
}
protected void
}
protected final AMXConfig
// MBean doesn't detect illegal parameters; anything is allowed
// for the realm.
throw new IllegalArgumentException();
}
}
}