use of org.eclipse.debug.core.ILaunchConfiguration in project jbosstools-hibernate by jbosstools.
the class CodeGenExternalProcessExecutionTest method setUp.
protected void setUp() throws Exception {
super.setUp();
this.project = new LaunchConfigTestProject2();
final String fileNameConsoleConfig = LaunchConfigTestProject2.LAUNCH_CONSOLE_CONFIG_TEST_FILE;
ILaunchConfiguration launchConfig = loadLaunchConfigFromFile(fileNameConsoleConfig);
final EclipseLaunchConsoleConfigurationPreferences cfgprefs = new EclipseLaunchConsoleConfigurationPreferences(launchConfig);
consoleCfg = new ConsoleConfiguration(cfgprefs);
KnownConfigurations.getInstance().addConfiguration(consoleCfg, true);
}
use of org.eclipse.debug.core.ILaunchConfiguration in project jbosstools-hibernate by jbosstools.
the class CodeGenExternalProcessExecutionTest method testExecuteExternalLaunchConfig.
public void testExecuteExternalLaunchConfig() {
IFolder testFolder = project.getTestFolder();
int nTest = -1;
try {
nTest = testFolder.members().length;
} catch (CoreException e) {
}
assertEquals(0, nTest);
ILaunchConfiguration launchConfig = null;
ILaunchConfigurationWorkingCopy launchConfigWC = null;
//
final String fileNameCodeGenExtern = LaunchConfigTestProject2.LAUNCH_CODE_GEN_TEST_FILE_EXTERN;
launchConfig = loadLaunchConfigFromFile(fileNameCodeGenExtern);
launchConfigWC = null;
try {
launchConfigWC = launchConfig.getWorkingCopy();
} catch (CoreException e) {
}
assertNotNull(launchConfigWC);
launchConfigWC.setAttribute(IExternalToolConstants.ATTR_LAUNCH_IN_BACKGROUND, false);
DebugUIPlugin.launchInForeground(launchConfigWC, ILaunchManager.RUN_MODE);
nTest = -1;
try {
nTest = testFolder.members().length;
} catch (CoreException e) {
}
// TODO: uncomment when JBIDE-7441 be fixed
// assertTrue(nTest > 0);
//
final String fileNameCodeGenIntern = LaunchConfigTestProject2.LAUNCH_CODE_GEN_TEST_FILE_INTERN;
launchConfig = loadLaunchConfigFromFile(fileNameCodeGenIntern);
launchConfigWC = null;
try {
launchConfigWC = launchConfig.getWorkingCopy();
} catch (CoreException e) {
}
assertNotNull(launchConfigWC);
launchConfigWC.setAttribute(IExternalToolConstants.ATTR_LAUNCH_IN_BACKGROUND, false);
DebugUIPlugin.launchInForeground(launchConfigWC, ILaunchManager.RUN_MODE);
nTest = -1;
try {
nTest = testFolder.members().length;
} catch (CoreException e) {
}
assertTrue(nTest > 0);
}
use of org.eclipse.debug.core.ILaunchConfiguration in project jbosstools-hibernate by jbosstools.
the class CodeGenExternalProcessExecutionTest method loadLaunchConfigFromFile.
public ILaunchConfiguration loadLaunchConfigFromFile(String fileName) {
IPath path = new Path(fileName);
IFile ifile = getProject().getIProject().getFile(path);
ILaunchConfiguration launchConfig = launchManager.getLaunchConfiguration((IFile) ifile);
return launchConfig;
}
use of org.eclipse.debug.core.ILaunchConfiguration in project jbosstools-hibernate by jbosstools.
the class ConnectionProfileRenameParticipant method createChange.
@Override
public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
ILaunchConfiguration[] configs = HibernateRefactoringUtil.getAffectedLaunchConfigurations(profile);
List<Change> changes = new ArrayList<Change>();
Change change = null;
for (int i = 0; i < configs.length; i++) {
change = new ConnectionProfileRenameChange(configs[i], profile, getArguments());
changes.add(change);
}
return HibernateRefactoringUtil.createChangesFromList(changes, getName());
}
use of org.eclipse.debug.core.ILaunchConfiguration in project jbosstools-hibernate by jbosstools.
the class RenameResourceParticipant method createChange.
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#createChange(org.eclipse.core.runtime.IProgressMonitor)
*/
public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
ILaunchConfiguration[] configs = HibernateRefactoringUtil.getAffectedConsoleConfigs(fResource.getFullPath());
List<Change> changes = new ArrayList<Change>();
Change change = null;
for (int i = 0; i < configs.length; i++) {
ConsoleConfiguration cc = KnownConfigurations.getInstance().find(configs[i].getName());
if (cc != null) {
cc.reset();
}
change = new LaunchConfigurationResourceNameChange(configs[i], fResource.getFullPath(), fResource.getParent().getFullPath().append(getArguments().getNewName()));
changes.add(change);
}
configs = HibernateRefactoringUtil.getAffectedCodeGenerationConfigs(fResource.getFullPath());
for (int i = 0; i < configs.length; i++) {
change = new CodeGenerationResourceNameChange(configs[i], fResource.getFullPath(), fResource.getParent().getFullPath().append(getArguments().getNewName()));
changes.add(change);
}
return HibernateRefactoringUtil.createChangesFromList(changes, getName());
}
Aggregations