/** Stop all activity by setting the stopped property to true. */ public void stopAll() { setStopped( true ); }
private void scheduleStopJobExecution() { ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor(); Runnable task = () -> mockedJob.setStopped( true ); scheduler.schedule( task, 1, TimeUnit.SECONDS ); scheduler.shutdown(); } }
@Before public void setUp() throws Exception { job = new Job( null, new JobMeta() ); entry = new JobEntryFolderIsEmpty(); job.getJobMeta().addJobEntry( new JobEntryCopy( entry ) ); entry.setParentJob( job ); JobMeta mockJobMeta = mock( JobMeta.class ); entry.setParentJobMeta( mockJobMeta ); job.setStopped( false ); File dir = Files.createTempDirectory( "dir", new FileAttribute<?>[0] ).toFile(); dir.deleteOnExit(); emptyDir = dir.getPath(); dir = Files.createTempDirectory( "dir", new FileAttribute<?>[0] ).toFile(); dir.deleteOnExit(); nonEmptyDir = dir.getPath(); File file = File.createTempFile( "existingFile", "ext", dir ); file.deleteOnExit(); }
private void setupJobMockExecution() { setInternalState( mockedJob, "jobMeta", mockedJobMeta ); setInternalState( mockedJob, "log", mockedLogChannel ); setInternalState( mockedJob, "jobTracker", new JobTracker( mockedJobMeta ) ); setInternalState( mockedJob, "jobEntryListeners", new ArrayList<>( ) ); setInternalState( mockedJob, "jobEntryResults", new LinkedList<>( ) ); setInternalState( mockedJob, "status", new AtomicInteger( 0 ) ); when( mockedJobMeta.findJobEntry( JobMeta.STRING_SPECIAL_START, 0, false ) ).thenReturn( mockedJobEntryCopy ); when( mockedJobEntryCopy.getEntry() ).thenReturn( mockedJobEntrySpecial ); when( mockedJobEntrySpecial.getLogChannel() ).thenReturn( mockedLogChannel ); when( mockedJobEntrySpecial.clone() ).thenReturn( mockedJobEntrySpecial ); when( mockedJob.isStopped() ).thenCallRealMethod(); doCallRealMethod().when( mockedJob ).setStopped( anyBoolean() ); KettleLogStore.init(); }
@Before public void setUp() throws Exception { job = new Job( null, new JobMeta() ); entry = new JobEntryFilesExist(); job.getJobMeta().addJobEntry( new JobEntryCopy( entry ) ); entry.setParentJob( job ); JobMeta mockJobMeta = mock( JobMeta.class ); entry.setParentJobMeta( mockJobMeta ); job.setStopped( false ); existingFile1 = TestUtils.createRamFile( getClass().getSimpleName() + "/existingFile1.ext", entry ); existingFile2 = TestUtils.createRamFile( getClass().getSimpleName() + "/existingFile2.ext", entry ); }
@Before public void setUp() { Job parentJob = new Job( null, new JobMeta() ); jobEntry = spy( new JobEntryColumnsExist( "" ) ); parentJob.getJobMeta().addJobEntry( new JobEntryCopy( jobEntry ) ); parentJob.setStopped( false ); jobEntry.setParentJob( parentJob ); parentJob.setLogLevel( LogLevel.NOTHING ); DatabaseMeta dbMeta = mock( DatabaseMeta.class ); jobEntry.setDatabase( dbMeta ); db = spy( new Database( jobEntry, dbMeta ) ); jobEntry.setParentJob( parentJob ); jobEntry.setTablename( TABLENAME ); jobEntry.setArguments( COLUMNS ); jobEntry.setSchemaname( SCHEMANAME ); }
@Before public void setUp() throws Exception { job = new Job( null, new JobMeta() ); entry = new JobEntrySetVariables(); job.getJobMeta().addJobEntry( new JobEntryCopy( entry ) ); entry.setParentJob( job ); job.setStopped( false ); }
setStopped( false ); setFinished( false ); setInitialized( true ); setStopped( false ); } finally { try {
@Before public void setUp() throws Exception { MockDriver.registerInstance(); Job job = new Job( null, new JobMeta() ); entry = new JobEntryEvalTableContent(); job.getJobMeta().addJobEntry( new JobEntryCopy( entry ) ); entry.setParentJob( job ); job.setStopped( false ); DatabaseMeta dbMeta = new DatabaseMeta(); dbMeta.setDatabaseType( "mock-db" ); entry.setDatabase( dbMeta ); }
@Before public void setUp() throws Exception { job = new Job( null, new JobMeta() ); entry = new MockedJobEntryFTP(); job.getJobMeta().addJobEntry( new JobEntryCopy( entry ) ); entry.setParentJob( job ); job.setStopped( false ); entry.setServerName( "some.server" ); entry.setUserName( "anonymous" ); entry.setFtpDirectory( "." ); entry.setWildcard( "robots.txt" ); entry.setBinaryMode( false ); entry.setSuccessCondition( "success_if_no_errors" ); existingDir = TestUtils.createTempDir(); }
setStopped( false ); KettleEnvironment.setExecutionInformation( this, rep );