congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
JobMeta.setRepositoryDirectory
Code IndexAdd Tabnine to your IDE (free)

How to use
setRepositoryDirectory
method
in
org.pentaho.di.job.JobMeta

Best Java code snippets using org.pentaho.di.job.JobMeta.setRepositoryDirectory (Showing top 20 results out of 315)

origin: pentaho/pentaho-kettle

@Test
public void testFireCurrentDirChanged() throws Exception {
 String pathBefore = "/path/before", pathAfter = "path/after";
 RepositoryDirectoryInterface repoDirOrig = mock( RepositoryDirectoryInterface.class );
 when( repoDirOrig.getPath() ).thenReturn( pathBefore );
 RepositoryDirectoryInterface repoDir = mock( RepositoryDirectoryInterface.class );
 when( repoDir.getPath() ).thenReturn( pathAfter );
 jobMeta.setRepository( mock( Repository.class ) );
 jobMeta.setRepositoryDirectory( repoDirOrig );
 CurrentDirectoryChangedListener listener = mock( CurrentDirectoryChangedListener.class );
 jobMeta.addCurrentDirectoryChangedListener( listener );
 jobMeta.setRepositoryDirectory( repoDir );
 verify( listener, times( 1 ) ).directoryChanged( jobMeta, pathBefore, pathAfter );
}
origin: pentaho/pentaho-kettle

/**
 * 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 );
}
origin: pentaho/pentaho-kettle

@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 );
}
origin: pentaho/pentaho-kettle

@Test
public void testUpdateCurrentDirWithRepository( ) {
 JobMeta jobMetaTest = new JobMeta(  );
 RepositoryDirectoryInterface path = mock( RepositoryDirectoryInterface.class );
 when( path.getPath() ).thenReturn( "aPath" );
 jobMetaTest.setRepository( mock( Repository.class ) );
 jobMetaTest.setRepositoryDirectory( path );
 jobMetaTest.setVariable( Const.INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY, "Original value defined at run execution" );
 jobMetaTest.setVariable( Const.INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY, "file:///C:/SomeFilenameDirectory" );
 jobMetaTest.setVariable( Const.INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY, "/SomeRepDirectory" );
 jobMetaTest.updateCurrentDir();
 assertEquals( "/SomeRepDirectory", jobMetaTest.getVariable( Const.INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY ) );
}
origin: pentaho/pentaho-kettle

@Test
public void testSetInternalEntryCurrentDirectoryWithRepository( ) {
 JobMeta jobMetaTest = new JobMeta(  );
 RepositoryDirectoryInterface path = mock( RepositoryDirectoryInterface.class );
 when( path.getPath() ).thenReturn( "aPath" );
 jobMetaTest.setRepository( mock( Repository.class ) );
 jobMetaTest.setRepositoryDirectory( path );
 jobMetaTest.setVariable( Const.INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY, "Original value defined at run execution" );
 jobMetaTest.setVariable( Const.INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY, "file:///C:/SomeFilenameDirectory" );
 jobMetaTest.setVariable( Const.INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY, "/SomeRepDirectory" );
 jobMetaTest.setInternalEntryCurrentDirectory();
 assertEquals( "/SomeRepDirectory", jobMetaTest.getVariable( Const.INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY ) );
}
origin: pentaho/pentaho-kettle

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 );
}
origin: pentaho/pentaho-kettle

  jobMeta.setObjectId( newId );
 jobMeta.setRepositoryDirectory( newDirectory );
 wDirectory.setText( jobMeta.getRepositoryDirectory().getPath() );
} catch ( KettleException dbe ) {
 jobMeta.setRepositoryDirectory( dirFrom );
jobMeta.setRepositoryDirectory( newDirectory );
origin: pentaho/pentaho-kettle

executorJobMeta.setRepositoryDirectory( new RepositoryDirectory() );
origin: pentaho/pentaho-kettle

jobMeta.setRepositoryDirectory( new RepositoryDirectory() );
origin: pentaho/pentaho-kettle

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;
}
origin: pentaho/pentaho-kettle

jobMeta1.setRepositoryDirectory( subdir1 );
repo.save( jobMeta1, null, null );
jobMeta2.setRepositoryDirectory( subdir2 );
repo.save( jobMeta2, null, null );
origin: pentaho/pentaho-kettle

jobMeta.setRepositoryDirectory( targetDirectory );
jobMeta.setObjectId( existintId );
patchJobEntries( jobMeta );
origin: pentaho/pentaho-kettle

 repository.findDirectory( jobMeta.getRepositoryDirectory().getPath() );
if ( rdi != null && !rdi.getPath().equals( "/" ) ) {
 jobMeta.setRepositoryDirectory( rdi );
} else {
 jobMeta.setRepositoryDirectory( repository.loadRepositoryDirectoryTree() );
origin: pentaho/pentaho-kettle

jobMeta.setRepositoryDirectory( directory );
origin: pentaho/pentaho-kettle

 launchJobMeta = new JobMeta();
 launchJobMeta.setName( exactJobname );
 launchJobMeta.setRepositoryDirectory( repDir );
} else {
origin: pentaho/pentaho-kettle

jobMeta.setRepositoryDirectory( getDefaultSaveLocation( jobMeta ) );
origin: pentaho/pentaho-kettle

@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 );
}
origin: pentaho/pentaho-kettle

 jobMeta.setRepositoryDirectory( repdir );
} else {
 jobMeta.setFilename( Const.createFilename( directory, jobname, "." + Const.STRING_JOB_DEFAULT_EXT ) );
origin: pentaho/pentaho-kettle

jobMeta.setRepositoryDirectory( spoon.getDefaultSaveLocation( jobMeta ) );
jobMeta.setRepository( spoon.getRepository() );
jobMeta.setMetaStore( spoon.getMetaStore() );
origin: pentaho/pentaho-kettle

jobMeta.setRepositoryDirectory( repdir );
org.pentaho.di.jobJobMetasetRepositoryDirectory

Popular methods of JobMeta

  • environmentSubstitute
  • <init>
    Create a new JobMeta object by loading it from a a DOM node.
  • getName
  • findDatabase
  • getDatabases
  • getJobCopies
    Gets the job copies.
  • getParameterDefault
  • getXML
  • setName
  • addDatabase
  • addJobEntry
    Adds the job entry.
  • addJobHop
    Adds the job hop.
  • addJobEntry,
  • addJobHop,
  • addNote,
  • addParameterDefinition,
  • clearChanged,
  • findJobEntry,
  • getCreatedDate,
  • getCreatedUser,
  • getDatabase,
  • getExtendedDescription

Popular in Java

  • Start an intent from android
  • getSystemService (Context)
  • setRequestProperty (URLConnection)
  • getExternalFilesDir (Context)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • String (java.lang)
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • JLabel (javax.swing)
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now