Skip to content

Commit

Permalink
Improvment of dynamically changed await
Browse files Browse the repository at this point in the history
  • Loading branch information
filipcynarski committed Sep 28, 2017
1 parent 53bb429 commit 54d1963
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 84 deletions.
Expand Up @@ -3,7 +3,6 @@
import java.util.List;
import java.util.function.Predicate;

import org.fluentlenium.core.domain.FluentList;
import org.fluentlenium.core.domain.FluentWebElement;

/**
Expand Down Expand Up @@ -64,7 +63,7 @@ public List<? extends FluentWebElement> getActualElements() {
}

@Override
public DynamicIntegerConditions size() {
public AbstractIntegerConditions size() {
return new DynamicIntegerConditionsImpl(() -> elements, negation);
}

Expand Down
@@ -1,18 +1,12 @@
package org.fluentlenium.core.conditions;

import java.util.List;

import org.fluentlenium.core.conditions.message.Message;
import org.fluentlenium.core.conditions.message.NotMessage;
import org.fluentlenium.core.domain.FluentWebElement;

/**
* Conditions API for Integer.
*/
public interface DynamicIntegerConditions extends Conditions<List<? extends FluentWebElement>> {
public interface AbstractIntegerConditions<T, C extends AbstractIntegerConditions> extends Conditions<T> {
@Override
@Negation
DynamicIntegerConditions not();
C not();

/**
* Check that this is equal to given value
Expand Down Expand Up @@ -63,5 +57,4 @@ public interface DynamicIntegerConditions extends Conditions<List<? extends Flue
@Message("is greater than or equal to {0}")
@NotMessage("is not greater than or equal to {0}")
boolean greaterThanOrEqualTo(int value);

}
Expand Up @@ -10,24 +10,14 @@
* Conditions for integer
*/
public class DynamicIntegerConditionsImpl extends AbstractObjectConditions<List<? extends FluentWebElement>>
implements DynamicIntegerConditions {
/**
* Creates a new conditions object on integer.
*
* @param supplier underlying integer
*/
public DynamicIntegerConditionsImpl(Supplier<List<? extends FluentWebElement>> supplier) {
super(supplier.get());
}

implements ListIntegerConditions {
/**
* Creates a new conditions object on integer.
*
* @param supplier underlying list
* @param negation negation value
*/
public DynamicIntegerConditionsImpl(Supplier<List<? extends FluentWebElement>> supplier, boolean
negation) {
public DynamicIntegerConditionsImpl(Supplier<List<? extends FluentWebElement>> supplier, boolean negation) {
super(supplier.get(), negation);
}

Expand Down
Expand Up @@ -55,5 +55,5 @@ public interface FluentListConditions extends FluentConditions {
* @return an object to configure advanced conditions on size
*/
@MessageContext("size")
DynamicIntegerConditions size();
AbstractIntegerConditions size();
}
@@ -1,67 +1,8 @@
package org.fluentlenium.core.conditions;

import org.fluentlenium.core.conditions.message.Message;
import org.fluentlenium.core.conditions.message.NotMessage;

/**
* Conditions API for Integer.
*/


//todo consider removal of this class and replacing by DynamicIntegerConditions
public interface IntegerConditions extends Conditions<Integer> {
@Override
@Negation
IntegerConditions not();

/**
* Check that this is equal to given value
*
* @param value the value to compare with
* @return true if is equals, false otherwise
*/
@Message("is equal to {0}")
@NotMessage("is not equal to {0}")
boolean equalTo(int value);

/**
* Check that this is less than given value
*
* @param value the value to compare with
* @return true if less than, false otherwise
*/
@Message("is less than {0}")
@NotMessage("is not less than {0}")
boolean lessThan(int value);

/**
* Check that this is less than or equal given value
*
* @param value the value to compare with
* @return true if less than or equal, false otherwise
*/
@Message("is less than or equal to {0}")
@NotMessage("is not less than or equal to {0}")
boolean lessThanOrEqualTo(int value);

/**
* Check that this is greater than given value
*
* @param value the value to compare with
* @return true if greater than, false otherwise
*/
@Message("is greater than {0}")
@NotMessage("is not greater than {0}")
boolean greaterThan(int value);

/**
* Check that this is greater than or equal given value
*
* @param value the value to compare with
* @return true if greater than or equal, false otherwise
*/
@Message("is greater than or equal to {0}")
@NotMessage("is not greater than or equal to {0}")
boolean greaterThanOrEqualTo(int value);
public interface IntegerConditions extends AbstractIntegerConditions<Integer, IntegerConditions> {

}
@@ -0,0 +1,13 @@
package org.fluentlenium.core.conditions;

import java.util.List;

import org.fluentlenium.core.domain.FluentWebElement;

/**
* Conditions API for FluentLists.
*/
public interface ListIntegerConditions extends AbstractIntegerConditions<List<? extends FluentWebElement>,
ListIntegerConditions> {

}

0 comments on commit 54d1963

Please sign in to comment.