author | timkelly |
Wed, 13 Oct 2010 12:30:28 -0500 | |
changeset 2152 | 816abb894472 |
parent 2150 | 64e9abb9ebeb |
child 2157 | 90c82caa6918 |
permissions | -rw-r--r-- |
2149 | 1 |
/* |
2 |
* Copyright (c) 2010 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 the License "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 |
* Test the BldInfViewPathHelper class. |
|
16 |
* |
|
17 |
*/ |
|
18 |
package com.nokia.carbide.cdt.builder.test; |
|
19 |
||
2152
816abb894472
Run create global prefs tests asynch on UI thread
timkelly
parents:
2150
diff
changeset
|
20 |
import org.eclipse.swt.widgets.Display; |
2149 | 21 |
import org.eclipse.ui.dialogs.PreferencesUtil; |
22 |
||
23 |
import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils; |
|
24 |
||
25 |
/** |
|
26 |
* Test class to simply load all the global Carbide preferences |
|
27 |
* |
|
28 |
*/ |
|
29 |
public class TestCreateGlobalPrefs extends BaseTest { |
|
30 |
||
2152
816abb894472
Run create global prefs tests asynch on UI thread
timkelly
parents:
2150
diff
changeset
|
31 |
// Deprecated - are filtered |
816abb894472
Run create global prefs tests asynch on UI thread
timkelly
parents:
2150
diff
changeset
|
32 |
//com.nokia.cdt.debug.cw.symbian.ui.GlobalSettings |
816abb894472
Run create global prefs tests asynch on UI thread
timkelly
parents:
2150
diff
changeset
|
33 |
//com.nokia.carbide.cpp.logging.LoggingPreferencesPage |
2149 | 34 |
private static final String[] carbidePrefIds = { "com.nokia.carbide.cpp.sdk.ui.preferences.BuildPlatformFilterPage", |
35 |
"com.nokia.carbide.cpp.internal.sdk.ui.SDKPreferencePage", |
|
36 |
"com.nokia.carbide.cpp.internal.sdk.ui.SDKPreferencePage", |
|
37 |
"com.nokia.carbide.cdt.internal.builder.ui.BuilderPreferencePage", |
|
38 |
"com.nokia.carbide.cpp.preferences.ExtensionsPreferencesPage", |
|
39 |
"com.nokia.carbide.cpp.internal.builder.utils.ui.PreprocessPreferencePage", |
|
40 |
"com.nokia.carbide.cpp.internal.project.ui.preferences.CarbidePreferencePage", |
|
2150
64e9abb9ebeb
add search preference page to test
Chad Peckham <chad.peckham@nokia.com>
parents:
2149
diff
changeset
|
41 |
"com.nokia.carbide.cdt.internal.builder.ui.BuilderPreferencePage", |
64e9abb9ebeb
add search preference page to test
Chad Peckham <chad.peckham@nokia.com>
parents:
2149
diff
changeset
|
42 |
"com.nokia.carbide.search.system.internal.ui.SearchPreferencePage" |
2149 | 43 |
}; |
44 |
||
45 |
@Override |
|
46 |
protected void setUp() throws Exception { |
|
47 |
||
48 |
} |
|
49 |
||
50 |
@Override |
|
51 |
protected void tearDown() throws Exception { |
|
52 |
super.tearDown(); |
|
53 |
} |
|
54 |
||
55 |
||
56 |
/** |
|
57 |
* Iterte all the global eclipse pref IDs for Carbide prefs |
|
58 |
* and try to create them. Any exception will require teasing |
|
59 |
* the stack frame to find the offending preference that could not be loaded. |
|
60 |
* @throws Exception |
|
61 |
*/ |
|
62 |
public void testCreatePrefs() throws Exception { |
|
63 |
||
2152
816abb894472
Run create global prefs tests asynch on UI thread
timkelly
parents:
2150
diff
changeset
|
64 |
// make sure to run on UI thread |
816abb894472
Run create global prefs tests asynch on UI thread
timkelly
parents:
2150
diff
changeset
|
65 |
// Display getAsynch() |
816abb894472
Run create global prefs tests asynch on UI thread
timkelly
parents:
2150
diff
changeset
|
66 |
// capture and throw exception |
816abb894472
Run create global prefs tests asynch on UI thread
timkelly
parents:
2150
diff
changeset
|
67 |
// wait to finish before existing |
816abb894472
Run create global prefs tests asynch on UI thread
timkelly
parents:
2150
diff
changeset
|
68 |
|
816abb894472
Run create global prefs tests asynch on UI thread
timkelly
parents:
2150
diff
changeset
|
69 |
// TODO: Need to throw exception on error when loading a pref page |
2149 | 70 |
|
2152
816abb894472
Run create global prefs tests asynch on UI thread
timkelly
parents:
2150
diff
changeset
|
71 |
Display.getDefault().asyncExec(new Runnable() { |
816abb894472
Run create global prefs tests asynch on UI thread
timkelly
parents:
2150
diff
changeset
|
72 |
|
816abb894472
Run create global prefs tests asynch on UI thread
timkelly
parents:
2150
diff
changeset
|
73 |
@Override |
816abb894472
Run create global prefs tests asynch on UI thread
timkelly
parents:
2150
diff
changeset
|
74 |
public void run() { |
816abb894472
Run create global prefs tests asynch on UI thread
timkelly
parents:
2150
diff
changeset
|
75 |
for (String id : carbidePrefIds){ |
816abb894472
Run create global prefs tests asynch on UI thread
timkelly
parents:
2150
diff
changeset
|
76 |
PreferencesUtil.createPreferenceDialogOn(WorkbenchUtils.getSafeShell(), id, null, null, 0); |
816abb894472
Run create global prefs tests asynch on UI thread
timkelly
parents:
2150
diff
changeset
|
77 |
} |
816abb894472
Run create global prefs tests asynch on UI thread
timkelly
parents:
2150
diff
changeset
|
78 |
} |
816abb894472
Run create global prefs tests asynch on UI thread
timkelly
parents:
2150
diff
changeset
|
79 |
|
816abb894472
Run create global prefs tests asynch on UI thread
timkelly
parents:
2150
diff
changeset
|
80 |
}); |
816abb894472
Run create global prefs tests asynch on UI thread
timkelly
parents:
2150
diff
changeset
|
81 |
|
2149 | 82 |
} |
83 |
} |