0
|
1 |
/*
|
|
2 |
* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
package com.symbian.driver.plugins.reboot;
|
|
20 |
|
|
21 |
import junit.framework.TestCase;
|
|
22 |
|
|
23 |
import org.eclipse.core.runtime.IExtension;
|
|
24 |
import org.eclipse.core.runtime.IExtensionPoint;
|
|
25 |
import org.eclipse.core.runtime.IExtensionRegistry;
|
|
26 |
import org.eclipse.core.runtime.Platform;
|
|
27 |
|
|
28 |
import com.symbian.driver.core.extension.IReboot;
|
|
29 |
|
|
30 |
public class RebootDeviceTest extends TestCase {
|
|
31 |
|
|
32 |
|
|
33 |
private static final String EXTENSION_POINT = "com.symbian.driver.core.DeviceReboot";
|
|
34 |
private String CLASS_ATTRIBUTE = "class";
|
|
35 |
IReboot plugin = null ;
|
|
36 |
|
|
37 |
|
|
38 |
protected void setUp() throws Exception {
|
|
39 |
super.setUp();
|
|
40 |
IExtensionRegistry registry = Platform.getExtensionRegistry();
|
|
41 |
IExtensionPoint extensionPoint =
|
|
42 |
registry.getExtensionPoint(EXTENSION_POINT);
|
|
43 |
IExtension[] extensions = extensionPoint.getExtensions();
|
|
44 |
plugin = (IReboot )extensions[0].getConfigurationElements()[0].createExecutableExtension(CLASS_ATTRIBUTE) ;
|
|
45 |
}
|
|
46 |
|
|
47 |
protected void tearDown() throws Exception {
|
|
48 |
super.tearDown();
|
|
49 |
}
|
|
50 |
|
|
51 |
public void testSwitcthOff() {
|
|
52 |
if(!plugin.SwitcthOff() )
|
|
53 |
fail();
|
|
54 |
}
|
|
55 |
|
|
56 |
public void testSwitcthOn() {
|
|
57 |
if(!plugin.SwitcthOn())
|
|
58 |
fail();
|
|
59 |
}
|
|
60 |
|
|
61 |
public void testReboot() {
|
|
62 |
if(!plugin.Reboot())
|
|
63 |
fail();
|
|
64 |
}
|
|
65 |
|
|
66 |
}
|