Lines 45-61
Link Here
|
45 |
|
45 |
|
46 |
import java.awt.Component; |
46 |
import java.awt.Component; |
47 |
import java.awt.Window; |
47 |
import java.awt.Window; |
48 |
import java.beans.PropertyEditor; |
|
|
49 |
import java.beans.PropertyEditorManager; |
50 |
import java.io.File; |
48 |
import java.io.File; |
51 |
import java.io.IOException; |
49 |
import java.io.IOException; |
52 |
import java.io.PrintStream; |
50 |
import java.io.PrintStream; |
53 |
import java.lang.reflect.Array; |
51 |
import java.lang.reflect.Array; |
54 |
import java.lang.reflect.Field; |
|
|
55 |
import java.lang.reflect.InvocationTargetException; |
52 |
import java.lang.reflect.InvocationTargetException; |
56 |
import java.lang.reflect.Method; |
53 |
import java.lang.reflect.Method; |
57 |
import java.util.ArrayList; |
54 |
import java.util.ArrayList; |
58 |
import java.util.Arrays; |
|
|
59 |
import java.util.List; |
55 |
import java.util.List; |
60 |
import java.util.Map; |
56 |
import java.util.Map; |
61 |
import javax.swing.JDialog; |
57 |
import javax.swing.JDialog; |
Lines 66-76
Link Here
|
66 |
import org.netbeans.jemmy.EventTool; |
62 |
import org.netbeans.jemmy.EventTool; |
67 |
import org.netbeans.jemmy.JemmyException; |
63 |
import org.netbeans.jemmy.JemmyException; |
68 |
import org.netbeans.jemmy.JemmyProperties; |
64 |
import org.netbeans.jemmy.JemmyProperties; |
69 |
import org.netbeans.jemmy.QueueTool; |
|
|
70 |
import org.netbeans.jemmy.TestOut; |
65 |
import org.netbeans.jemmy.TestOut; |
71 |
import org.netbeans.jemmy.operators.JDialogOperator; |
66 |
import org.netbeans.jemmy.operators.JDialogOperator; |
|
|
67 |
import org.netbeans.jemmy.util.PNGEncoder; |
72 |
import org.netbeans.jemmy.util.Dumper; |
68 |
import org.netbeans.jemmy.util.Dumper; |
73 |
import org.netbeans.jemmy.util.PNGEncoder; |
|
|
74 |
import org.netbeans.junit.AssertionFailedErrorException; |
69 |
import org.netbeans.junit.AssertionFailedErrorException; |
75 |
import org.netbeans.junit.NbModuleSuite; |
70 |
import org.netbeans.junit.NbModuleSuite; |
76 |
import org.netbeans.junit.NbTestCase; |
71 |
import org.netbeans.junit.NbTestCase; |
Lines 132-170
Link Here
|
132 |
} catch (Exception e) { |
127 |
} catch (Exception e) { |
133 |
throw new JemmyException("Initialization of timeouts failed.", e); |
128 |
throw new JemmyException("Initialization of timeouts failed.", e); |
134 |
} |
129 |
} |
135 |
// #210618 - workaround that custom property editors are not properly |
|
|
136 |
// registered when IDE is launched by NbModuleSuite |
137 |
new QueueTool().invokeSmoothly(new Runnable() { |
138 |
@Override |
139 |
public void run() { |
140 |
try { |
141 |
PropertyEditor pe = PropertyEditorManager.findEditor(String.class); |
142 |
if (pe != null && !pe.getClass().getName().equals("sun.beans.editors.StringEditor")) { |
143 |
// OK |
144 |
return; |
145 |
} |
146 |
// CoreBridgeImpl.editorsRegistered = false; |
147 |
// CoreBridgeImpl.doRegisterPropertyEditors(); |
148 |
Class cl = Class.forName("org.netbeans.core.CoreBridgeImpl"); |
149 |
Field fieldReg = cl.getDeclaredField("editorsRegistered"); |
150 |
fieldReg.setAccessible(true); |
151 |
fieldReg.setBoolean(null, false); |
152 |
Method methodRegisterPE = cl.getDeclaredMethod("doRegisterPropertyEditors"); |
153 |
methodRegisterPE.setAccessible(true); |
154 |
methodRegisterPE.invoke(null); |
155 |
} catch (Exception e) { |
156 |
throw new JemmyException("Cannot call CoreBridgeImpl.doRegisterPropertyEditors().", e); |
157 |
} |
158 |
// Add core.execution property editor search path. |
159 |
String coreExecutionPath = "org.netbeans.core.execution.beaninfo.editors"; |
160 |
List<String> paths = Arrays.asList(PropertyEditorManager.getEditorSearchPath()); |
161 |
if (!paths.contains(coreExecutionPath)) { |
162 |
paths = new ArrayList<String>(paths); |
163 |
paths.add(coreExecutionPath); |
164 |
PropertyEditorManager.setEditorSearchPath(paths.toArray(new String[0])); |
165 |
} |
166 |
} |
167 |
}); |
168 |
} |
130 |
} |
169 |
|
131 |
|
170 |
/** Overridden method from JUnit framework execution to perform conditional |
132 |
/** Overridden method from JUnit framework execution to perform conditional |
Lines 528-534
Link Here
|
528 |
} |
490 |
} |
529 |
|
491 |
|
530 |
protected static junit.framework.Test createModuleTest(String modules, String clusters, Class testClass, String... testNames) { |
492 |
protected static junit.framework.Test createModuleTest(String modules, String clusters, Class testClass, String... testNames) { |
531 |
return NbModuleSuite.create(testClass, clusters, modules, testNames); |
493 |
return NbModuleSuite.emptyConfiguration(). |
|
|
494 |
enableModules(modules). |
495 |
clusters(clusters). |
496 |
addTest(testClass, testNames). |
497 |
honorAutoloadEager(true). |
498 |
suite(); |
532 |
} |
499 |
} |
533 |
|
500 |
|
534 |
protected static junit.framework.Test createModuleTest(Class testClass, String... testNames) { |
501 |
protected static junit.framework.Test createModuleTest(Class testClass, String... testNames) { |