@Test public void testLoadXml() throws KettleException { String directory = "/home/admin"; Node jobNode = Mockito.mock( Node.class ); NodeList nodeList = new NodeList() { Node node = Mockito.mock( Node.class ); { Mockito.when( node.getNodeName() ).thenReturn( "directory" ); Node child = Mockito.mock( Node.class ); Mockito.when( node.getFirstChild() ).thenReturn( child ); Mockito.when( child.getNodeValue() ).thenReturn( directory ); } @Override public Node item( int index ) { return node; } @Override public int getLength() { return 1; } }; Mockito.when( jobNode.getChildNodes() ).thenReturn( nodeList ); Repository rep = Mockito.mock( Repository.class ); RepositoryDirectory repDirectory = new RepositoryDirectory( new RepositoryDirectory( new RepositoryDirectory(), "home" ), "admin" ); Mockito.when( rep.findDirectory( Mockito.eq( directory ) ) ).thenReturn( repDirectory ); JobMeta meta = new JobMeta(); meta.loadXML( jobNode, null, rep, Mockito.mock( IMetaStore.class ), false, Mockito.mock( OverwritePrompter.class ) ); Job job = new Job( rep, meta ); job.setInternalKettleVariables( null ); Assert.assertEquals( repDirectory.getPath(), job.getVariable( Const.INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY ) ); }
public void loadXML( Node jobnode, Repository rep, OverwritePrompter prompter ) throws KettleXMLException { loadXML( jobnode, rep, false, prompter ); }
JobMeta extends AbstractMeta implements Cloneable, Comparable<JobMeta>, XMLInterface, ResourceExportInterface, RepositoryElementInterface,
    LoggingObjectInterface { public void loadXML( Node jobnode, Repository rep, OverwritePrompter prompter ) throws KettleXMLException { loadXML( jobnode, rep, false, prompter ); } }
JobMeta extends AbstractMeta implements Cloneable, Comparable<JobMeta>, XMLInterface, ResourceExportInterface, RepositoryElementInterface,
    LoggingObjectInterface { public void loadXML( Node jobnode, Repository rep, OverwritePrompter prompter ) throws KettleXMLException { loadXML( jobnode, rep, false, prompter ); } JobMeta();  JobMeta( String fname, Repository rep );  JobMeta( String fname, Repository rep, OverwritePrompter prompter ); @Deprecated  JobMeta( VariableSpace parentSpace, String fname, Repository rep, OverwritePrompter prompter );  JobMeta( VariableSpace parentSpace, String fname, Repository rep, IMetaStore metaStore,
      OverwritePrompter prompter );  JobMeta( InputStream inputStream, Repository rep, OverwritePrompter prompter );  JobMeta( Node jobnode, Repository rep, OverwritePrompter prompter );  JobMeta( Node jobnode, Repository rep, boolean ignoreRepositorySharedObjects, OverwritePrompter prompter ); }
JobMeta extends AbstractMeta implements Cloneable, Comparable<JobMeta>, XMLInterface, ResourceExportInterface, RepositoryElementInterface,
    LoggingObjectInterface { public void loadXML( Node jobnode, Repository rep, OverwritePrompter prompter ) throws KettleXMLException { loadXML( jobnode, rep, false, prompter ); } JobMeta();  JobMeta( String fname, Repository rep );  JobMeta( String fname, Repository rep, OverwritePrompter prompter ); @Deprecated  JobMeta( VariableSpace parentSpace, String fname, Repository rep, OverwritePrompter prompter );  JobMeta( VariableSpace parentSpace, String fname, Repository rep, IMetaStore metaStore,
      OverwritePrompter prompter );  JobMeta( InputStream inputStream, Repository rep, OverwritePrompter prompter );  JobMeta( Node jobnode, Repository rep, OverwritePrompter prompter );  JobMeta( Node jobnode, Repository rep, boolean ignoreRepositorySharedObjects, OverwritePrompter prompter ); @Override void clear(); void addDefaults(); static final JobEntryCopy createStartEntry(); static final JobEntryCopy createDummyEntry(); JobEntryCopy getStart(); JobEntryCopy getDummy(); int compare( JobMeta j1, JobMeta j2 ); int compareTo( JobMeta o ); boolean equals( Object obj ); Object clone(); Object realClone( boolean doClear ); JobLogTable getJobLogTable(); void setJobLogTable( JobLogTable jobLogTable ); @Override void clearChanged(); @Override boolean hasChanged(); boolean isDatabaseConnectionUsed( DatabaseMeta databaseMeta ); String getFileType(); String[] getFilterNames(); String[] getFilterExtensions(); String getDefaultExtension(); String getXML(); boolean isRepReference(); boolean isFileReference(); static boolean isRepReference( String fileName, String transName ); static boolean isFileReference( String fileName, String transName ); void loadXML( Node jobnode, Repository rep, OverwritePrompter prompter ); void loadXML( Node jobnode, String fname, Repository rep, OverwritePrompter prompter ); void loadXML( Node jobnode, Repository rep, boolean ignoreRepositorySharedObjects, OverwritePrompter prompter ); @Deprecated void loadXML( Node jobnode, String fname, Repository rep, boolean ignoreRepositorySharedObjects,
      OverwritePrompter prompter ); void loadXML( Node jobnode, String fname, Repository rep, IMetaStore metaStore,
      boolean ignoreRepositorySharedObjects, OverwritePrompter prompter ); JobEntryCopy getJobEntryCopy( int x, int y, int iconsize ); int nrJobEntries(); int nrJobHops(); JobHopMeta getJobHop( int i ); JobEntryCopy getJobEntry( int i ); void addJobEntry( JobEntryCopy je ); void addJobHop( JobHopMeta hi ); void addJobEntry( int p, JobEntryCopy si ); void addJobHop( int p, JobHopMeta hi ); void removeJobEntry( int i ); void removeJobHop( int i ); void removeJobHop( JobHopMeta hop ); int indexOfJobHop( JobHopMeta he ); int indexOfJobEntry( JobEntryCopy ge ); void setJobEntry( int idx, JobEntryCopy jec ); JobEntryCopy findJobEntry( String name, int nr, boolean searchHiddenToo ); JobEntryCopy findJobEntry( String full_name_nr ); JobHopMeta findJobHop( String name ); JobHopMeta findJobHopFrom( JobEntryCopy jge ); JobHopMeta findJobHop( JobEntryCopy from, JobEntryCopy to ); JobHopMeta findJobHop( JobEntryCopy from, JobEntryCopy to, boolean includeDisabled ); JobHopMeta findJobHopTo( JobEntryCopy jge ); int findNrPrevJobEntries( JobEntryCopy from ); JobEntryCopy findPrevJobEntry( JobEntryCopy to, int nr ); int findNrPrevJobEntries( JobEntryCopy to, boolean info ); JobEntryCopy findPrevJobEntry( JobEntryCopy to, int nr, boolean info ); int findNrNextJobEntries( JobEntryCopy from ); JobEntryCopy findNextJobEntry( JobEntryCopy from, int cnt ); boolean hasLoop( JobEntryCopy entry ); boolean hasLoop( JobEntryCopy entry, JobEntryCopy lookup, boolean info ); boolean isEntryUsedInHops( JobEntryCopy jge ); int countEntries( String name ); int findUnusedNr( String name ); int findMaxNr( String name ); String getAlternativeJobentryName( String entryname ); JobEntryCopy[] getAllJobGraphEntries( String name ); JobHopMeta[] getAllJobHopsUsing( String name ); boolean isPathExist( JobEntryInterface from, JobEntryInterface to ); void selectAll(); void unselectAll(); Point getMaximum(); Point getMinimum(); Point[] getSelectedLocations(); Point[] getSelectedNoteLocations(); List<JobEntryCopy> getSelectedEntries(); int[] getEntryIndexes( List<JobEntryCopy> entries ); JobEntryCopy findStart(); String toString(); boolean isBatchIdPassed(); void setBatchIdPassed( boolean batchIdPassed ); List<SQLStatement> getSQLStatements( Repository repository, ProgressMonitorListener monitor ); List<SQLStatement> getSQLStatements( Repository repository, IMetaStore metaStore,
      ProgressMonitorListener monitor ); @Deprecated String[] getArguments(); @Deprecated void setArguments( String[] arguments ); List<StringSearchResult> getStringList( boolean searchSteps, boolean searchDatabases, boolean searchNotes ); List<String> getUsedVariables(); boolean haveJobEntriesChanged(); boolean haveJobHopsChanged(); String getJobversion(); int getJobstatus(); void setJobversion( String jobVersion ); void setJobstatus( int jobStatus ); static final JobEntryInterface findJobEntry( List<JobEntryInterface> jobentries, ObjectId id_jobentry ); static final JobEntryCopy findJobEntryCopy( List<JobEntryCopy> jobcopies, ObjectId id_jobentry_copy ); @Override void setInternalKettleVariables( VariableSpace var ); @Deprecated void checkJobEntries( List<CheckResultInterface> remarks, boolean only_selected,
      ProgressMonitorListener monitor ); void checkJobEntries( List<CheckResultInterface> remarks, boolean only_selected,
      ProgressMonitorListener monitor, VariableSpace space, Repository repository, IMetaStore metaStore ); List<ResourceReference> getResourceDependencies(); String exportResources( VariableSpace space, Map<String, ResourceDefinition> definitions,
      ResourceNamingInterface namingInterface, Repository repository, IMetaStore metaStore ); void renameJobEntryIfNameCollides( JobEntryCopy je ); List<JobEntryCopy> getJobCopies(); List<JobHopMeta> getJobhops(); RepositoryObjectType getRepositoryElementType(); List<JobEntryInterface> composeJobEntryInterfaceList(); String getLogChannelId(); LoggingObjectType getObjectType(); JobEntryLogTable getJobEntryLogTable(); void setJobEntryLogTable( JobEntryLogTable jobEntryLogTable ); List<LogTableInterface> getLogTables(); boolean hasRepositoryReferences(); void lookupRepositoryReferences( Repository repository ); @Override boolean isGatheringMetrics(); @Override void setGatheringMetrics( boolean gatheringMetrics ); @Override boolean isForcingSeparateLogging(); @Override void setForcingSeparateLogging( boolean forcingSeparateLogging ); List<LogTableInterface> getExtraLogTables(); void setExtraLogTables( List<LogTableInterface> extraLogTables ); boolean containsJobCopy( JobEntryCopy jobCopy ); List<MissingEntry> getMissingEntries(); void addMissingEntry( MissingEntry missingEntry ); void removeMissingEntry( MissingEntry missingEntry ); boolean hasMissingPlugins(); @Override NamedClusterEmbedManager getNamedClusterEmbedManager( ); }
JobMeta extends AbstractMeta implements Cloneable, Comparable<JobMeta>, XMLInterface, ResourceExportInterface, RepositoryElementInterface,
    LoggingObjectInterface { public void loadXML( Node jobnode, Repository rep, OverwritePrompter prompter ) throws KettleXMLException { loadXML( jobnode, rep, false, prompter ); } JobMeta();  JobMeta( String fname, Repository rep );  JobMeta( String fname, Repository rep, OverwritePrompter prompter ); @Deprecated  JobMeta( VariableSpace parentSpace, String fname, Repository rep, OverwritePrompter prompter );  JobMeta( VariableSpace parentSpace, String fname, Repository rep, IMetaStore metaStore,
      OverwritePrompter prompter );  JobMeta( InputStream inputStream, Repository rep, OverwritePrompter prompter );  JobMeta( Node jobnode, Repository rep, OverwritePrompter prompter );  JobMeta( Node jobnode, Repository rep, boolean ignoreRepositorySharedObjects, OverwritePrompter prompter ); @Override void clear(); void addDefaults(); static final JobEntryCopy createStartEntry(); static final JobEntryCopy createDummyEntry(); JobEntryCopy getStart(); JobEntryCopy getDummy(); int compare( JobMeta j1, JobMeta j2 ); int compareTo( JobMeta o ); boolean equals( Object obj ); Object clone(); Object realClone( boolean doClear ); JobLogTable getJobLogTable(); void setJobLogTable( JobLogTable jobLogTable ); @Override void clearChanged(); @Override boolean hasChanged(); boolean isDatabaseConnectionUsed( DatabaseMeta databaseMeta ); String getFileType(); String[] getFilterNames(); String[] getFilterExtensions(); String getDefaultExtension(); String getXML(); boolean isRepReference(); boolean isFileReference(); static boolean isRepReference( String fileName, String transName ); static boolean isFileReference( String fileName, String transName ); void loadXML( Node jobnode, Repository rep, OverwritePrompter prompter ); void loadXML( Node jobnode, String fname, Repository rep, OverwritePrompter prompter ); void loadXML( Node jobnode, Repository rep, boolean ignoreRepositorySharedObjects, OverwritePrompter prompter ); @Deprecated void loadXML( Node jobnode, String fname, Repository rep, boolean ignoreRepositorySharedObjects,
      OverwritePrompter prompter ); void loadXML( Node jobnode, String fname, Repository rep, IMetaStore metaStore,
      boolean ignoreRepositorySharedObjects, OverwritePrompter prompter ); JobEntryCopy getJobEntryCopy( int x, int y, int iconsize ); int nrJobEntries(); int nrJobHops(); JobHopMeta getJobHop( int i ); JobEntryCopy getJobEntry( int i ); void addJobEntry( JobEntryCopy je ); void addJobHop( JobHopMeta hi ); void addJobEntry( int p, JobEntryCopy si ); void addJobHop( int p, JobHopMeta hi ); void removeJobEntry( int i ); void removeJobHop( int i ); void removeJobHop( JobHopMeta hop ); int indexOfJobHop( JobHopMeta he ); int indexOfJobEntry( JobEntryCopy ge ); void setJobEntry( int idx, JobEntryCopy jec ); JobEntryCopy findJobEntry( String name, int nr, boolean searchHiddenToo ); JobEntryCopy findJobEntry( String full_name_nr ); JobHopMeta findJobHop( String name ); JobHopMeta findJobHopFrom( JobEntryCopy jge ); JobHopMeta findJobHop( JobEntryCopy from, JobEntryCopy to ); JobHopMeta findJobHop( JobEntryCopy from, JobEntryCopy to, boolean includeDisabled ); JobHopMeta findJobHopTo( JobEntryCopy jge ); int findNrPrevJobEntries( JobEntryCopy from ); JobEntryCopy findPrevJobEntry( JobEntryCopy to, int nr ); int findNrPrevJobEntries( JobEntryCopy to, boolean info ); JobEntryCopy findPrevJobEntry( JobEntryCopy to, int nr, boolean info ); int findNrNextJobEntries( JobEntryCopy from ); JobEntryCopy findNextJobEntry( JobEntryCopy from, int cnt ); boolean hasLoop( JobEntryCopy entry ); boolean hasLoop( JobEntryCopy entry, JobEntryCopy lookup, boolean info ); boolean isEntryUsedInHops( JobEntryCopy jge ); int countEntries( String name ); int findUnusedNr( String name ); int findMaxNr( String name ); String getAlternativeJobentryName( String entryname ); JobEntryCopy[] getAllJobGraphEntries( String name ); JobHopMeta[] getAllJobHopsUsing( String name ); boolean isPathExist( JobEntryInterface from, JobEntryInterface to ); void selectAll(); void unselectAll(); Point getMaximum(); Point getMinimum(); Point[] getSelectedLocations(); Point[] getSelectedNoteLocations(); List<JobEntryCopy> getSelectedEntries(); int[] getEntryIndexes( List<JobEntryCopy> entries ); JobEntryCopy findStart(); String toString(); boolean isBatchIdPassed(); void setBatchIdPassed( boolean batchIdPassed ); List<SQLStatement> getSQLStatements( Repository repository, ProgressMonitorListener monitor ); List<SQLStatement> getSQLStatements( Repository repository, IMetaStore metaStore,
      ProgressMonitorListener monitor ); @Deprecated String[] getArguments(); @Deprecated void setArguments( String[] arguments ); List<StringSearchResult> getStringList( boolean searchSteps, boolean searchDatabases, boolean searchNotes ); List<String> getUsedVariables(); boolean haveJobEntriesChanged(); boolean haveJobHopsChanged(); String getJobversion(); int getJobstatus(); void setJobversion( String jobVersion ); void setJobstatus( int jobStatus ); static final JobEntryInterface findJobEntry( List<JobEntryInterface> jobentries, ObjectId id_jobentry ); static final JobEntryCopy findJobEntryCopy( List<JobEntryCopy> jobcopies, ObjectId id_jobentry_copy ); @Override void setInternalKettleVariables( VariableSpace var ); @Deprecated void checkJobEntries( List<CheckResultInterface> remarks, boolean only_selected,
      ProgressMonitorListener monitor ); void checkJobEntries( List<CheckResultInterface> remarks, boolean only_selected,
      ProgressMonitorListener monitor, VariableSpace space, Repository repository, IMetaStore metaStore ); List<ResourceReference> getResourceDependencies(); String exportResources( VariableSpace space, Map<String, ResourceDefinition> definitions,
      ResourceNamingInterface namingInterface, Repository repository, IMetaStore metaStore ); void renameJobEntryIfNameCollides( JobEntryCopy je ); List<JobEntryCopy> getJobCopies(); List<JobHopMeta> getJobhops(); RepositoryObjectType getRepositoryElementType(); List<JobEntryInterface> composeJobEntryInterfaceList(); String getLogChannelId(); LoggingObjectType getObjectType(); JobEntryLogTable getJobEntryLogTable(); void setJobEntryLogTable( JobEntryLogTable jobEntryLogTable ); List<LogTableInterface> getLogTables(); boolean hasRepositoryReferences(); void lookupRepositoryReferences( Repository repository ); @Override boolean isGatheringMetrics(); @Override void setGatheringMetrics( boolean gatheringMetrics ); @Override boolean isForcingSeparateLogging(); @Override void setForcingSeparateLogging( boolean forcingSeparateLogging ); List<LogTableInterface> getExtraLogTables(); void setExtraLogTables( List<LogTableInterface> extraLogTables ); boolean containsJobCopy( JobEntryCopy jobCopy ); List<MissingEntry> getMissingEntries(); void addMissingEntry( MissingEntry missingEntry ); void removeMissingEntry( MissingEntry missingEntry ); boolean hasMissingPlugins(); @Override NamedClusterEmbedManager getNamedClusterEmbedManager( ); static final String XML_TAG; static final RepositoryObjectType REPOSITORY_ELEMENT_TYPE; static final String STRING_SPECIAL; static final String STRING_SPECIAL_START; static final String STRING_SPECIAL_DUMMY; static final String STRING_SPECIAL_OK; static final String STRING_SPECIAL_ERROR; public boolean[] max; }