public void syncMetaName( EngineMetaInterface meta, String name ) { ( (JobMeta) meta ).setName( name ); }
public Job( String name, String file, String[] args ) { this(); jobMeta = new JobMeta(); if ( name != null ) { setName( name + " (" + super.getName() + ")" ); } jobMeta.setName( name ); jobMeta.setFilename( file ); this.arguments = args; init(); this.log = new LogChannel( this ); }
/** * Given job meta object. <br/> * When the job is called to export resources, then the existing current directory should be used as a context to * locate resources. */ @Test public void shouldUseExistingRepositoryDirectoryWhenExporting() throws KettleException { final JobMeta jobMetaSpy = spy( jobMeta ); JobMeta jobMeta = new JobMeta() { @Override public Object realClone( boolean doClear ) { return jobMetaSpy; } }; jobMeta.setRepositoryDirectory( directoryJob ); jobMeta.setName( JOB_META_NAME ); jobMeta.exportResources( null, new HashMap<String, ResourceDefinition>( 4 ), mock( ResourceNamingInterface.class ), null, null ); // assert verify( jobMetaSpy ).setRepositoryDirectory( directoryJob ); }
@Before public void setUp() { jobMeta = new JobMeta(); // prepare directoryJob = mock( RepositoryDirectoryInterface.class ); when( directoryJob.getPath() ).thenReturn( "directoryPath" ); listener = mock( ContentChangedListener.class ); objectRevision = mock( ObjectRevision.class ); when( objectRevision.getName() ).thenReturn( "revisionName" ); jobMeta.addContentChangedListener( listener ); jobMeta.setRepositoryDirectory( directoryJob ); jobMeta.setName( JOB_META_NAME ); jobMeta.setObjectRevision( objectRevision ); }
@Test public void testEquals_secondNameNull() { jobMeta.setName( null ); assertFalse( testEquals( JOB_META_NAME, null, null, null ) ); }
private boolean testEquals( String name, RepositoryDirectoryInterface repDirectory, ObjectRevision revision, String filename ) { JobMeta jobMeta2 = new JobMeta(); jobMeta2.setName( name ); jobMeta2.setRepositoryDirectory( repDirectory ); jobMeta2.setObjectRevision( revision ); jobMeta2.setFilename( filename ); return jobMeta.equals( jobMeta2 ); }
@Override public JobMeta loadJob( String jobname, RepositoryDirectoryInterface repdir, ProgressMonitorListener monitor, String versionName ) throws KettleException { // This is a standard load of a transformation serialized in XML... // String filename = calcDirectoryName( repdir ) + jobname + EXT_JOB; JobMeta jobMeta = new JobMeta( filename, this ); jobMeta.setFilename( null ); jobMeta.setName( jobname ); jobMeta.setObjectId( new StringObjectId( calcObjectId( repdir, jobname, EXT_JOB ) ) ); jobMeta.setRepository( this ); jobMeta.setMetaStore( getMetaStore() ); readDatabases( jobMeta, true ); jobMeta.clearChanged(); return jobMeta; }
private JobMeta buildJobMeta( final RepositoryFile file, final RepositoryDirectoryInterface parentDir, final NodeRepositoryFileData data, final ObjectRevision revision ) throws KettleException { JobMeta jobMeta = new JobMeta(); jobMeta.setName( file.getTitle() ); jobMeta.setFilename( file.getName() ); jobMeta.setDescription( file.getDescription() ); jobMeta.setObjectId( new StringObjectId( file.getId().toString() ) ); jobMeta.setObjectRevision( revision ); jobMeta.setRepository( this ); jobMeta.setRepositoryDirectory( parentDir ); jobMeta.setMetaStore( getMetaStore() ); readJobMetaSharedObjects( jobMeta ); // This should read from the local cache jobDelegate.dataNodeToElement( data.getNode(), jobMeta ); jobMeta.clearChanged(); return jobMeta; }
jobMeta.setName( wJobname.getText() ); jobMeta.setDescription( wJobdescription.getText() ); jobMeta.setExtendedDescription( wExtendeddescription.getText() );
if ( !exists ) { launchJobMeta = new JobMeta(); launchJobMeta.setName( exactJobname ); launchJobMeta.setRepositoryDirectory( repDir ); } else {
@Test public void testCurrentDirJob() throws Exception { final String dirName = "dirName"; final String jobName = "job"; JobMeta setupJobMeta = new JobMeta(); setupJobMeta.setName( jobName ); RepositoryDirectoryInterface repoDir = repository.createRepositoryDirectory( new RepositoryDirectory(), dirName ); setupJobMeta.setRepositoryDirectory( repoDir ); repository.save( setupJobMeta, "" ); JobMeta jobMeta = repository.loadJob( jobName, repoDir, null, "" ); assertEquals( repository, jobMeta.getRepository() ); assertEquals( repoDir.getPath(), jobMeta.getRepositoryDirectory().getPath() ); jobMeta.setInternalKettleVariables(); String currentDir = jobMeta.getVariable( Const.INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY ); assertEquals( repoDir.getPath(), currentDir ); }
jobMeta.setDatabases( databases ); jobMeta.setFilename( null ); jobMeta.setName( jobname );
setName( XMLHandler.getTagValue( jobnode, "name" ) );
jobMeta.setName( jobRow.getString( KettleDatabaseRepository.FIELD_JOB_NAME, null ) ); jobMeta.setDescription( jobRow.getString( KettleDatabaseRepository.FIELD_JOB_DESCRIPTION, null ) ); jobMeta.setExtendedDescription( jobRow.getString(
jobMeta.setName( "Generated Demo Job" );