use of com.intellij.lang.javascript.flex.projectStructure.model.ModifiableBuildConfigurationEntry in project intellij-plugins by JetBrains.
the class FlexProjectConfigTest method testBcDependency.
public void testBcDependency() throws ConfigurationException {
final Module module2 = createModule("module2");
assertFalse(doesDepend(myModule, module2));
assertFalse(doesDepend(module2, myModule));
FlexTestUtils.modifyConfigs(myProject, editor -> {
ModifiableFlexBuildConfiguration module1Config = editor.getConfigurations(myModule)[0];
ModifiableFlexBuildConfiguration module2Config = editor.getConfigurations(module2)[0];
ModifiableBuildConfigurationEntry entry = editor.createBcEntry(module1Config.getDependencies(), module2Config, null);
editor.setEntries(module1Config.getDependencies(), Collections.singletonList(entry));
});
assertTrue(doesDepend(myModule, module2));
assertFalse(doesDepend(module2, myModule));
FlexTestUtils.modifyConfigs(myProject, editor -> {
ModifiableFlexBuildConfiguration module1Config = editor.getConfigurations(myModule)[0];
editor.setEntries(module1Config.getDependencies(), new ArrayList<>());
});
assertFalse(doesDepend(myModule, module2));
assertFalse(doesDepend(module2, myModule));
final Module module3 = createModule("module3");
final Module module4 = createModule("module4");
FlexTestUtils.modifyConfigs(myProject, editor -> {
ModifiableFlexBuildConfiguration m1bc1 = editor.getConfigurations(myModule)[0];
ModifiableFlexBuildConfiguration m1bc2 = createConfiguration(editor, myModule);
ModifiableFlexBuildConfiguration m1bc3 = createConfiguration(editor, myModule);
ModifiableFlexBuildConfiguration m1bc4 = createConfiguration(editor, myModule);
ModifiableFlexBuildConfiguration m2bc1 = editor.getConfigurations(module2)[0];
ModifiableFlexBuildConfiguration m3bc1 = editor.getConfigurations(module3)[0];
ModifiableFlexBuildConfiguration m2bc2 = createConfiguration(editor, module2);
ModifiableBuildConfigurationEntry e1 = editor.createBcEntry(m1bc1.getDependencies(), m2bc1, null);
editor.setEntries(m1bc1.getDependencies(), Collections.singletonList(e1));
ModifiableBuildConfigurationEntry e2 = editor.createBcEntry(m1bc2.getDependencies(), m2bc2, null);
ModifiableBuildConfigurationEntry e3 = editor.createBcEntry(m1bc2.getDependencies(), m3bc1, null);
editor.setEntries(m1bc1.getDependencies(), Arrays.asList(e2, e3));
});
assertTrue(doesDepend(myModule, module2));
assertTrue(doesDepend(myModule, module3));
assertFalse(doesDepend(myModule, module4));
}
Aggregations