blob: 4480a24a9a18aec14c9832ef694f5d6d43b7ddf1 [file] [log] [blame]
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.net.wifi.cts;
import java.util.List;
import android.content.Context;
import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiManager;
import android.test.AndroidTestCase;
public class WifiConfigurationTest extends AndroidTestCase {
private WifiManager mWifiManager;
@Override
protected void setUp() throws Exception {
super.setUp();
mWifiManager = (WifiManager) mContext
.getSystemService(Context.WIFI_SERVICE);
}
public void testWifiConfiguration() {
if (!WifiFeature.isWifiSupported(getContext())) {
// skip the test if WiFi is not supported
return;
}
List<WifiConfiguration> wifiConfigurations = mWifiManager.getConfiguredNetworks();
if (wifiConfigurations != null) {
for (int i = 0; i < wifiConfigurations.size(); i++) {
WifiConfiguration wifiConfiguration = wifiConfigurations.get(i);
assertNotNull(wifiConfiguration);
assertNotNull(wifiConfiguration.toString());
}
}
}
}