~ubuntu-branches/ubuntu/trusty/eclipse-linuxtools/trusty

« back to all changes in this revision

Viewing changes to gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/internal/gcov/test/JobsRunning.java

  • Committer: Package Import Robot
  • Author(s): Jakub Adam
  • Date: 2012-06-29 12:07:30 UTC
  • Revision ID: package-import@ubuntu.com-20120629120730-bfri1xys1i71dpn6
Tags: upstream-1.0.0
ImportĀ upstreamĀ versionĀ 1.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package org.eclipse.linuxtools.internal.gcov.test;
 
2
 
 
3
import org.eclipse.core.runtime.jobs.Job;
 
4
import org.eclipse.swtbot.swt.finder.SWTBot;
 
5
import org.eclipse.swtbot.swt.finder.waits.ICondition;
 
6
 
 
7
public class JobsRunning implements ICondition {
 
8
 
 
9
        private final Object family;
 
10
        
 
11
        public JobsRunning(Object family) {
 
12
                this.family = family;
 
13
        }
 
14
        
 
15
        @Override
 
16
        public boolean test() throws Exception {
 
17
                Job[] allJobs = Job.getJobManager().find(family);
 
18
                return allJobs.length == 0;
 
19
        }
 
20
        
 
21
        @Override
 
22
        public void init(SWTBot bot) {
 
23
                
 
24
        }
 
25
        
 
26
        @Override
 
27
        public String getFailureMessage() {
 
28
                return "Jobs still running...";
 
29
        }
 
30
}