use of org.pentaho.di.job.JobMeta in project pentaho-kettle by pentaho.
the class SpoonTest method testJobToXMLFileSaveFileAsFailed.
@Test
public void testJobToXMLFileSaveFileAsFailed() throws Exception {
JobMeta mockJobMeta = mock(JobMeta.class);
// passing a invalid type so not running GUIResource class
prepareSetSaveTests(spoon, log, mockSpoonPerspective, mockJobMeta, true, true, "NotMainSpoonPerspective", true, false, "Invalid TYPE", null, true, true);
doCallRealMethod().when(spoon).saveFileAs(mockJobMeta);
assertFalse(spoon.saveFileAs(mockJobMeta));
verify(mockJobMeta).setRepository(spoon.rep);
verify(mockJobMeta).setMetaStore(spoon.metaStore);
verify(spoon).enableMenus();
}
use of org.pentaho.di.job.JobMeta in project pentaho-kettle by pentaho.
the class SpoonTest method testSetShellTextForJobWVersionEnabledRepIsNull.
@Test
public void testSetShellTextForJobWVersionEnabledRepIsNull() {
JobMeta mockJobMeta = mock(JobMeta.class);
Shell mockShell = prepareSetShellTextTests(spoon, mockJobMeta, true, false, true, false, false, false, false, false);
verify(mockShell).setText("Spoon - jobName v1.0");
}
use of org.pentaho.di.job.JobMeta in project pentaho-kettle by pentaho.
the class EngineMetaUtilsTest method isJobOrTransformation_withJob.
@Test
public void isJobOrTransformation_withJob() {
JobMeta jobInstance = new JobMeta();
assertTrue(EngineMetaUtils.isJobOrTransformation(jobInstance));
}
use of org.pentaho.di.job.JobMeta in project pentaho-kettle by pentaho.
the class SpoonDBDelegate method getSQL.
public void getSQL() {
TransMeta transMeta = spoon.getActiveTransformation();
if (transMeta != null) {
getTransSQL(transMeta);
}
JobMeta jobMeta = spoon.getActiveJob();
if (jobMeta != null) {
getJobSQL(jobMeta);
}
}
use of org.pentaho.di.job.JobMeta in project pentaho-kettle by pentaho.
the class SpoonJobDelegate method getJobEntryDialog.
public JobEntryDialogInterface getJobEntryDialog(JobEntryInterface jobEntryInterface, JobMeta jobMeta) {
Class<?>[] paramClasses = new Class<?>[] { Shell.class, JobEntryInterface.class, Repository.class, JobMeta.class };
Object[] paramArgs = new Object[] { spoon.getShell(), jobEntryInterface, spoon.getRepository(), jobMeta };
PluginRegistry registry = PluginRegistry.getInstance();
PluginInterface plugin = registry.getPlugin(JobEntryPluginType.class, jobEntryInterface);
String dialogClassName = plugin.getClassMap().get(JobEntryDialogInterface.class);
if (dialogClassName == null) {
// try the deprecated way
log.logDebug("Use of JobEntryInterface#getDialogClassName is deprecated, use PluginDialog annotation instead.");
dialogClassName = jobEntryInterface.getDialogClassName();
}
try {
Class<JobEntryDialogInterface> dialogClass = registry.getClass(plugin, dialogClassName);
Constructor<JobEntryDialogInterface> dialogConstructor = dialogClass.getConstructor(paramClasses);
JobEntryDialogInterface entryDialogInterface = dialogConstructor.newInstance(paramArgs);
entryDialogInterface.setMetaStore(spoon.getMetaStore());
return entryDialogInterface;
} catch (Throwable t) {
t.printStackTrace();
String errorTitle = BaseMessages.getString(PKG, "Spoon.Dialog.ErrorCreatingJobDialog.Title");
String errorMsg = BaseMessages.getString(PKG, "Spoon.Dialog.ErrorCreatingJobEntryDialog.Message", dialogClassName);
spoon.getLog().logError(spoon.toString(), errorMsg);
new ErrorDialog(spoon.getShell(), errorTitle, errorMsg, t);
return null;
}
}
Aggregations