?? motoroladeviceimportertestcase.java
字號(hào):
/**
* Copyright (c) 2003-2006 Craig Setera
* All Rights Reserved.
* Licensed under the Eclipse Public License - v 1.0
* For more information see http://www.eclipse.org/legal/epl-v10.html
*/
package eclipseme.toolkit.motorola.impl;
import java.io.File;
import java.io.FileFilter;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import org.eclipse.core.runtime.NullProgressMonitor;
import eclipseme.core.model.AbstractCoreTestCase;
import eclipseme.core.model.device.IDevice;
/**
* Testcases for the Siemens Device Importer
* <p />
* Copyright (c) 2003-2006 Craig Setera<br>
* All Rights Reserved.<br>
* Licensed under the Eclipse Public License - v 1.0<p/>
* <br>
* $Revision: 1.1 $
* <br>
* $Date: 2006/02/11 21:26:47 $
* <br>
* @author Craig Setera
*/
public class MotorolaDeviceImporterTestCase extends AbstractCoreTestCase {
public void testMotorolaDeviceImport()
throws Exception
{
File path = getFileForProperty("motorola.path");
MotorolaDeviceImporter importer = new MotorolaDeviceImporter();
ArrayList devices = new ArrayList();
addMatchingDevices(devices, importer, path);
assertTrue("Expected to find at least one device", devices.size() > 0);
}
/**
* Recursively search for any available devices in the specified
* path.
*
* @param devices
* @param importer
*/
private void addMatchingDevices(ArrayList devices, MotorolaDeviceImporter importer, File path) {
IDevice[] matchingDevices = importer.getMatchingDevices(path, new NullProgressMonitor());
if (matchingDevices != null) {
devices.addAll(Arrays.asList(matchingDevices));
}
File[] subdirs = path.listFiles(new FileFilter() {
public boolean accept(File pathname) {
return pathname.isDirectory();
}
});
for (int i = 0; i < subdirs.length; i++) {
addMatchingDevices(devices, importer, subdirs[i]);
}
}
/**
* Load the test properties into the system properties.
*/
protected void loadProperties() {
super.loadProperties();
InputStream is = MotorolaDeviceImporterTestCase.class.getResourceAsStream("motorola_test.properties");
loadProperties(is);
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -