Project

General

Profile

« Previous | Next » 

Revision 14a1655f

Added by Andreas Kohlbecker over 10 years ago

adapting test framwork to changes in selenium api

View differences:

7.x/modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/main/java/eu/etaxonomy/dataportal/selenium/AllTrue.java
17 17
 */
18 18
public class AllTrue implements Function<WebDriver, Boolean> {
19 19

  
20
	List<Function<WebDriver, Boolean>> functions = new ArrayList<Function<WebDriver, Boolean>>();
21

  
22
	public AllTrue(Function<WebDriver, Boolean> ... functions) {
23
		if(functions == null){
24
			throw new NullPointerException("Constructor parameter mus not be null");
25
		}
26
		this.functions = Arrays.asList(functions);
27
	}
28

  
29
	/* (non-Javadoc)
30
	 * @see com.google.common.base.Function#apply(java.lang.Object)
31
	 */
32
	public Boolean apply(WebDriver driver) {
33
		Boolean allTrue = true;
34
		for(Function<WebDriver, Boolean> f : functions){
35
			allTrue &= f.apply(driver);
36
		}
37
		return allTrue;
38
	}
20
    List<Function<WebDriver, Boolean>> functions = new ArrayList<Function<WebDriver, Boolean>>();
21

  
22
    public AllTrue(Function<WebDriver, Boolean> ... functions) {
23
        if(functions == null){
24
            throw new NullPointerException("Constructor parameter mus not be null");
25
        }
26
        this.functions = Arrays.asList(functions);
27
    }
28

  
29
    /* (non-Javadoc)
30
     * @see com.google.common.base.Function#apply(java.lang.Object)
31
     */
32
    @Override
33
    public Boolean apply(WebDriver driver) {
34
        Boolean allTrue = true;
35
        for(Function<WebDriver, Boolean> f : functions){
36
            allTrue &= f.apply(driver);
37
        }
38
        return allTrue;
39
    }
39 40

  
40 41
}

Also available in: Unified diff