Skip to content

Commit 3bf4da7

Browse files
committed
deprecated Literals - all factories to be found in the to be produced base classes
1 parent c055e23 commit 3bf4da7

File tree

6 files changed

+40
-12
lines changed

6 files changed

+40
-12
lines changed
Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,36 @@
11
package net.itarray.automotion.validation;
22

3-
import net.itarray.automotion.internal.ZoomImpl;
43
import net.itarray.automotion.validation.properties.Resolution;
5-
import net.itarray.automotion.internal.ResolutionImpl;
64
import net.itarray.automotion.validation.properties.Zoom;
75

6+
/**
7+
* @deprecated As of release 2.0, replaced by {@link net.itarray.automotion.validation.properties.Zoom} or {@link net.itarray.automotion.validation.properties.Resolution}
8+
*/
9+
@Deprecated
810
public class Literals {
911

10-
public static Resolution resolution(String widthXheight) {
11-
return ResolutionImpl.of(widthXheight);
12+
/**
13+
* @deprecated As of release 2.0, replaced by {@link net.itarray.automotion.validation.properties.Resolution#resolution(String)}
14+
*/
15+
@Deprecated
16+
public static Resolution resolution(String widthXHeight) {
17+
return Resolution.resolution(widthXHeight);
1218
}
1319

20+
/**
21+
* @deprecated As of release 2.0, replaced by {@link net.itarray.automotion.validation.properties.Resolution#resolution(int, int)}
22+
*/
23+
@Deprecated
1424
public static Resolution resolution(int width, int height) {
15-
return ResolutionImpl.of(width, height);
25+
return Resolution.resolution(width, height);
1626
}
1727

28+
/**
29+
* @deprecated As of release 2.0, replaced by {@link net.itarray.automotion.validation.properties.Zoom#zoom(int)}
30+
*/
31+
@Deprecated
1832
public static Zoom zoom(int percentage) {
19-
return ZoomImpl.of(percentage);
33+
return Zoom.zoom(percentage);
2034
}
2135

2236
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
package net.itarray.automotion.validation.properties;
22

33
import net.itarray.automotion.internal.DriverFacade;
4+
import net.itarray.automotion.internal.ResolutionImpl;
45

56
public interface Resolution {
67
void applyTo(DriverFacade driver);
78
Resolution queryIfUnknown(DriverFacade driver);
9+
10+
static Resolution resolution(String widthXHeight) {
11+
return ResolutionImpl.of(widthXHeight);
12+
}
13+
14+
static Resolution resolution(int width, int height) {
15+
return ResolutionImpl.of(width, height);
16+
}
817
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
package net.itarray.automotion.validation.properties;
22

33
import net.itarray.automotion.internal.DriverFacade;
4+
import net.itarray.automotion.internal.ZoomImpl;
45

56
public interface Zoom {
67
void applyTo(DriverFacade driver);
78
double getFactor(DriverFacade driver);
89
Zoom queryIfUnknown(DriverFacade driver);
10+
11+
static Zoom zoom(int percentage) {
12+
return ZoomImpl.of(percentage);
13+
}
14+
915
}

src/test/java/ResponsiveValidatorNewDSLTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import http.helpers.EnvironmentHelper;
22
import net.itarray.automotion.validation.ResponsiveUIValidator;
33
import net.itarray.automotion.validation.UISnapshot;
4+
import net.itarray.automotion.validation.properties.Padding;
45
import org.assertj.core.api.SoftAssertions;
56
import org.junit.After;
67
import org.junit.Ignore;
@@ -10,17 +11,15 @@
1011
import org.openqa.selenium.WebElement;
1112
import org.openqa.selenium.phantomjs.PhantomJSDriverService;
1213
import util.driver.WebDriverFactory;
13-
import net.itarray.automotion.validation.properties.Padding;
1414

1515
import java.awt.*;
1616
import java.util.HashMap;
1717
import java.util.Map;
1818

19-
import static net.itarray.automotion.validation.properties.Expression.percent;
20-
import static net.itarray.automotion.validation.properties.Expression.percentOrPixels;
21-
import static net.itarray.automotion.validation.Literals.zoom;
2219
import static net.itarray.automotion.validation.properties.Condition.between;
20+
import static net.itarray.automotion.validation.properties.Expression.percent;
2321
import static net.itarray.automotion.validation.properties.PercentReference.PAGE;
22+
import static net.itarray.automotion.validation.properties.Zoom.zoom;
2423

2524
@Ignore
2625
public class ResponsiveValidatorNewDSLTest {

src/test/java/net/itarray/automotion/tests/ZoomTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import org.junit.Before;
77
import org.junit.Test;
88

9-
import static net.itarray.automotion.validation.Literals.zoom;
9+
import static net.itarray.automotion.validation.properties.Zoom.zoom;
1010
import static org.assertj.core.api.Assertions.assertThat;
1111
import static org.mockito.Mockito.*;
1212

src/test/java/net/itarray/automotion/tests/ZoomUnknownTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import org.junit.Before;
77
import org.junit.Test;
88

9-
import static net.itarray.automotion.validation.Literals.zoom;
9+
import static net.itarray.automotion.validation.properties.Zoom.zoom;
1010
import static org.assertj.core.api.Assertions.assertThat;
1111
import static org.mockito.Mockito.*;
1212

0 commit comments

Comments
 (0)