Skip to content

Commit

Permalink
Trying to fix the build.
Browse files Browse the repository at this point in the history
  • Loading branch information
CoolTomatos committed Sep 6, 2022
1 parent 6d87dfc commit 19f7bf2
Show file tree
Hide file tree
Showing 18 changed files with 25 additions and 784 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
package tech.picnic.errorprone.refastertemplates;

import static com.google.errorprone.refaster.ImportPolicy.STATIC_IMPORT_ALWAYS;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.data.Offset.offset;
import static org.assertj.core.data.Percentage.withPercentage;

import com.google.errorprone.refaster.Refaster;
import com.google.errorprone.refaster.annotation.AfterTemplate;
import com.google.errorprone.refaster.annotation.BeforeTemplate;
import com.google.errorprone.refaster.annotation.UseImportPolicy;
import org.assertj.core.api.AbstractBooleanAssert;
import org.assertj.core.api.AbstractByteAssert;

final class AssertJByteTemplates {
Expand All @@ -28,20 +24,6 @@ AbstractByteAssert<?> after(AbstractByteAssert<?> byteAssert, byte n) {
}
}

static final class AbstractByteAssertActualIsEqualToExpected {
@BeforeTemplate
AbstractBooleanAssert<?> before(byte actual, byte expected) {
return Refaster.anyOf(
assertThat(actual == expected).isTrue(), assertThat(actual != expected).isFalse());
}

@AfterTemplate
@UseImportPolicy(STATIC_IMPORT_ALWAYS)
AbstractByteAssert<?> after(byte actual, byte expected) {
return assertThat(actual).isEqualTo(expected);
}
}

static final class AbstractByteAssertIsNotEqualTo {
@BeforeTemplate
AbstractByteAssert<?> before(AbstractByteAssert<?> byteAssert, byte n) {
Expand All @@ -56,20 +38,6 @@ AbstractByteAssert<?> after(AbstractByteAssert<?> byteAssert, byte n) {
}
}

static final class AbstractByteAssertActualIsNotEqualToExpected {
@BeforeTemplate
AbstractBooleanAssert<?> before(byte actual, byte expected) {
return Refaster.anyOf(
assertThat(actual != expected).isTrue(), assertThat(actual == expected).isFalse());
}

@AfterTemplate
@UseImportPolicy(STATIC_IMPORT_ALWAYS)
AbstractByteAssert<?> after(byte actual, byte expected) {
return assertThat(actual).isNotEqualTo(expected);
}
}

static final class AbstractByteAssertIsZero {
@BeforeTemplate
AbstractByteAssert<?> before(AbstractByteAssert<?> byteAssert) {
Expand Down Expand Up @@ -105,60 +73,4 @@ AbstractByteAssert<?> after(AbstractByteAssert<?> byteAssert) {
return byteAssert.isEqualTo((byte) 1);
}
}

static final class AbstractByteAssertActualIsLessThanExpected {
@BeforeTemplate
AbstractBooleanAssert<?> before(byte actual, byte expected) {
return Refaster.anyOf(
assertThat(actual < expected).isTrue(), assertThat(actual >= expected).isFalse());
}

@AfterTemplate
@UseImportPolicy(STATIC_IMPORT_ALWAYS)
AbstractByteAssert<?> after(byte actual, byte expected) {
return assertThat(actual).isLessThan(expected);
}
}

static final class AbstractByteAssertActualIsLessThanOrEqualToExpected {
@BeforeTemplate
AbstractBooleanAssert<?> before(byte actual, byte expected) {
return Refaster.anyOf(
assertThat(actual <= expected).isTrue(), assertThat(actual > expected).isFalse());
}

@AfterTemplate
@UseImportPolicy(STATIC_IMPORT_ALWAYS)
AbstractByteAssert<?> after(byte actual, byte expected) {
return assertThat(actual).isLessThanOrEqualTo(expected);
}
}

static final class AbstractByteAssertActualIsGreaterThanExpected {
@BeforeTemplate
AbstractBooleanAssert<?> before(byte actual, byte expected) {
return Refaster.anyOf(
assertThat(actual > expected).isTrue(), assertThat(actual <= expected).isFalse());
}

@AfterTemplate
@UseImportPolicy(STATIC_IMPORT_ALWAYS)
AbstractByteAssert<?> after(byte actual, byte expected) {
return assertThat(actual).isGreaterThan(expected);
}
}

static final class AbstractByteAssertActualIsGreaterThanOrEqualToExpected {
@BeforeTemplate
AbstractBooleanAssert<?> before(byte actual, byte expected) {
return Refaster.anyOf(
assertThat(actual >= expected).isTrue(), assertThat(actual < expected).isFalse());
}

@AfterTemplate
@UseImportPolicy(STATIC_IMPORT_ALWAYS)
AbstractByteAssert<?> after(byte actual, byte expected) {
return assertThat(actual).isGreaterThanOrEqualTo(expected);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,20 @@
import static com.google.errorprone.refaster.ImportPolicy.STATIC_IMPORT_ALWAYS;
import static org.assertj.core.api.Assertions.assertThat;

import com.google.errorprone.refaster.Refaster;
import com.google.errorprone.refaster.annotation.AfterTemplate;
import com.google.errorprone.refaster.annotation.BeforeTemplate;
import com.google.errorprone.refaster.annotation.UseImportPolicy;
import org.assertj.core.api.AbstractBooleanAssert;
import org.assertj.core.api.AbstractComparableAssert;
import org.assertj.core.api.AbstractIntegerAssert;

final class AssertJComparableTemplates {
private AssertJComparableTemplates() {}

static final class AbstractComparableAssertActualIsLessThanExpected<
T extends Comparable<? super T>> {
@BeforeTemplate
AbstractBooleanAssert<?> before(T actual, T expected) {
return Refaster.anyOf(
assertThat(actual.compareTo(expected) < 0).isTrue(),
assertThat(actual.compareTo(expected) >= 0).isFalse());
AbstractIntegerAssert<?> before(T actual, T expected) {
return assertThat(actual.compareTo(expected)).isNegative();
}

@AfterTemplate
Expand All @@ -32,10 +29,8 @@ AbstractBooleanAssert<?> before(T actual, T expected) {
static final class AbstractComparableAssertActualIsLessThanOrEqualToExpected<
T extends Comparable<? super T>> {
@BeforeTemplate
AbstractBooleanAssert<?> before(T actual, T expected) {
return Refaster.anyOf(
assertThat(actual.compareTo(expected) <= 0).isTrue(),
assertThat(actual.compareTo(expected) > 0).isFalse());
AbstractIntegerAssert<?> before(T actual, T expected) {
return assertThat(actual.compareTo(expected)).isNotPositive();
}

@AfterTemplate
Expand All @@ -48,10 +43,8 @@ AbstractBooleanAssert<?> before(T actual, T expected) {
static final class AbstractComparableAssertActualIsGreaterThanExpected<
T extends Comparable<? super T>> {
@BeforeTemplate
AbstractBooleanAssert<?> before(T actual, T expected) {
return Refaster.anyOf(
assertThat(actual.compareTo(expected) > 0).isTrue(),
assertThat(actual.compareTo(expected) <= 0).isFalse());
AbstractIntegerAssert<?> before(T actual, T expected) {
return assertThat(actual.compareTo(expected)).isPositive();
}

@AfterTemplate
Expand All @@ -64,10 +57,8 @@ AbstractBooleanAssert<?> before(T actual, T expected) {
static final class AbstractComparableAssertActualIsGreaterThanOrEqualToExpected<
T extends Comparable<? super T>> {
@BeforeTemplate
AbstractBooleanAssert<?> before(T actual, T expected) {
return Refaster.anyOf(
assertThat(actual.compareTo(expected) >= 0).isTrue(),
assertThat(actual.compareTo(expected) < 0).isFalse());
AbstractIntegerAssert<?> before(T actual, T expected) {
return assertThat(actual.compareTo(expected)).isNotNegative();
}

@AfterTemplate
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
package tech.picnic.errorprone.refastertemplates;

import static com.google.errorprone.refaster.ImportPolicy.STATIC_IMPORT_ALWAYS;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.data.Offset.offset;
import static org.assertj.core.data.Percentage.withPercentage;

import com.google.errorprone.refaster.Refaster;
import com.google.errorprone.refaster.annotation.AfterTemplate;
import com.google.errorprone.refaster.annotation.BeforeTemplate;
import com.google.errorprone.refaster.annotation.UseImportPolicy;
import org.assertj.core.api.AbstractBooleanAssert;
import org.assertj.core.api.AbstractFloatAssert;
import org.assertj.core.data.Offset;

Expand Down Expand Up @@ -49,20 +45,6 @@ AbstractFloatAssert<?> after(AbstractFloatAssert<?> floatAssert, float n) {
}
}

static final class AbstractFloatAssertActualIsEqualToExpected {
@BeforeTemplate
AbstractBooleanAssert<?> before(float actual, float expected) {
return Refaster.anyOf(
assertThat(actual == expected).isTrue(), assertThat(actual != expected).isFalse());
}

@AfterTemplate
@UseImportPolicy(STATIC_IMPORT_ALWAYS)
AbstractFloatAssert<?> after(float actual, float expected) {
return assertThat(actual).isEqualTo(expected);
}
}

static final class AbstractFloatAssertIsNotEqualTo {
@BeforeTemplate
AbstractFloatAssert<?> before(AbstractFloatAssert<?> floatAssert, float n) {
Expand All @@ -76,20 +58,6 @@ AbstractFloatAssert<?> after(AbstractFloatAssert<?> floatAssert, float n) {
}
}

static final class AbstractFloatAssertActualIsNotEqualToExpected {
@BeforeTemplate
AbstractBooleanAssert<?> before(float actual, float expected) {
return Refaster.anyOf(
assertThat(actual != expected).isTrue(), assertThat(actual == expected).isFalse());
}

@AfterTemplate
@UseImportPolicy(STATIC_IMPORT_ALWAYS)
AbstractFloatAssert<?> after(float actual, float expected) {
return assertThat(actual).isNotEqualTo(expected);
}
}

static final class AbstractFloatAssertIsZero {
@BeforeTemplate
AbstractFloatAssert<?> before(AbstractFloatAssert<?> floatAssert) {
Expand Down Expand Up @@ -125,60 +93,4 @@ AbstractFloatAssert<?> after(AbstractFloatAssert<?> floatAssert) {
return floatAssert.isEqualTo(1);
}
}

static final class AbstractFloatAssertActualIsLessThanExpected {
@BeforeTemplate
AbstractBooleanAssert<?> before(float actual, float expected) {
return Refaster.anyOf(
assertThat(actual < expected).isTrue(), assertThat(actual >= expected).isFalse());
}

@AfterTemplate
@UseImportPolicy(STATIC_IMPORT_ALWAYS)
AbstractFloatAssert<?> after(float actual, float expected) {
return assertThat(actual).isLessThan(expected);
}
}

static final class AbstractFloatAssertActualIsLessThanOrEqualToExpected {
@BeforeTemplate
AbstractBooleanAssert<?> before(float actual, float expected) {
return Refaster.anyOf(
assertThat(actual <= expected).isTrue(), assertThat(actual > expected).isFalse());
}

@AfterTemplate
@UseImportPolicy(STATIC_IMPORT_ALWAYS)
AbstractFloatAssert<?> after(float actual, float expected) {
return assertThat(actual).isLessThanOrEqualTo(expected);
}
}

static final class AbstractFloatAssertActualIsGreaterThanExpected {
@BeforeTemplate
AbstractBooleanAssert<?> before(float actual, float expected) {
return Refaster.anyOf(
assertThat(actual > expected).isTrue(), assertThat(actual <= expected).isFalse());
}

@AfterTemplate
@UseImportPolicy(STATIC_IMPORT_ALWAYS)
AbstractFloatAssert<?> after(float actual, float expected) {
return assertThat(actual).isGreaterThan(expected);
}
}

static final class AbstractFloatAssertActualIsGreaterThanOrEqualToExpected {
@BeforeTemplate
AbstractBooleanAssert<?> before(float actual, float expected) {
return Refaster.anyOf(
assertThat(actual >= expected).isTrue(), assertThat(actual < expected).isFalse());
}

@AfterTemplate
@UseImportPolicy(STATIC_IMPORT_ALWAYS)
AbstractFloatAssert<?> after(float actual, float expected) {
return assertThat(actual).isGreaterThanOrEqualTo(expected);
}
}
}
Loading

0 comments on commit 19f7bf2

Please sign in to comment.