use of com.intellij.lang.javascript.flex.projectStructure.model.ModifiableFlexBuildConfiguration in project intellij-plugins by JetBrains.
the class FlexCompletionTest method testNonApplicableInheritors.
@JSTestOptions({ JSTestOption.WithGumboSdk, JSTestOption.WithFlexLib, JSTestOption.WithSmartCompletion })
public void testNonApplicableInheritors() throws Exception {
FlexTestUtils.modifyConfigs(myProject, editor -> {
final ModifiableFlexBuildConfiguration bc1 = editor.getConfigurations(myModule)[0];
final ModifiableFlexBuildConfiguration bc2 = editor.copyConfiguration(bc1, BuildConfigurationNature.DEFAULT);
bc2.setName("bc 2");
bc2.getDependencies().getModifiableEntries().clear();
});
LookupElement[] elements = doTest("", "as");
assertEquals(3, elements.length);
assertEquals("Image", elements[0].getLookupString());
assertEquals("Base64Image", elements[1].getLookupString());
assertEquals("ImageMap", elements[2].getLookupString());
final FlexBuildConfigurationManager manager = FlexBuildConfigurationManager.getInstance(myModule);
manager.setActiveBuildConfiguration(manager.findConfigurationByName("bc 2"));
elements = doTest("", "as");
assertEquals(1, elements.length);
assertEquals("Image", elements[0].getLookupString());
}
use of com.intellij.lang.javascript.flex.projectStructure.model.ModifiableFlexBuildConfiguration in project intellij-plugins by JetBrains.
the class FlexProjectConfigTest method testModuleLibrary.
public void testModuleLibrary() throws ConfigurationException {
assertEquals(1, FlexBuildConfigurationManager.getInstance(myModule).getBuildConfigurations().length);
final String libraryId = createModuleLibrary();
FlexTestUtils.modifyConfigs(myProject, configEditor -> {
ModifiableFlexBuildConfiguration[] configurations = configEditor.getConfigurations(myModule);
assertEquals(1, configurations.length);
ModifiableFlexBuildConfiguration c = configurations[0];
configEditor.createModuleLibraryEntry(c.getDependencies(), libraryId);
});
OrderEntry libraryEntry = findLibraryEntry(myModule, libraryId);
assertNull(libraryEntry);
}
use of com.intellij.lang.javascript.flex.projectStructure.model.ModifiableFlexBuildConfiguration in project intellij-plugins by JetBrains.
the class FlexProjectConfigTest method createConfiguration.
private static ModifiableFlexBuildConfiguration createConfiguration(FlexProjectConfigurationEditor editor, Module module) {
int i = 1;
String name = "Config";
while (true) {
boolean found = false;
for (ModifiableFlexBuildConfiguration configuration : editor.getConfigurations(module)) {
if (configuration.getName().equals(name = "Config " + String.valueOf(i))) {
found = true;
break;
}
}
if (found) {
i++;
} else {
break;
}
}
ModifiableFlexBuildConfiguration c = editor.createConfiguration(module);
c.setName(name);
return c;
}
use of com.intellij.lang.javascript.flex.projectStructure.model.ModifiableFlexBuildConfiguration in project intellij-plugins by JetBrains.
the class ActionScriptHighlightingTest method testVectorWithSdk.
public void testVectorWithSdk() throws Exception {
final Sdk sdk45 = FlexTestUtils.createSdk(FlexTestUtils.getPathToCompleteFlexSdk("4.5"), null, true);
FlexTestUtils.modifyConfigs(myProject, editor -> {
ModifiableFlexBuildConfiguration bc1 = editor.getConfigurations(myModule)[0];
FlexTestUtils.setSdk(bc1, sdk45);
});
doTestFor(true, getTestName(false) + ".as");
}
use of com.intellij.lang.javascript.flex.projectStructure.model.ModifiableFlexBuildConfiguration in project intellij-plugins by JetBrains.
the class ActionScriptHighlightingTest method testCorrectScopeForSuperclassCheck6.
public void testCorrectScopeForSuperclassCheck6() throws Exception {
// monkey patching SDK class
final Sdk sdk45 = FlexTestUtils.createSdk(FlexTestUtils.getPathToCompleteFlexSdk("4.5"), null, false);
FlexTestUtils.modifyConfigs(myProject, e -> {
ModifiableFlexBuildConfiguration bc1 = e.getConfigurations(myModule)[0];
FlexTestUtils.setSdk(bc1, sdk45);
});
doTestFor(true, getTestName(false) + ".js2", getTestName(false) + "_2.js2");
}
Aggregations