Skip to content

Commit

Permalink
Renamed keyword assert to Condition according to review
Browse files Browse the repository at this point in the history
  • Loading branch information
raczeja committed Feb 9, 2021
1 parent b433596 commit 715817c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
7 changes: 4 additions & 3 deletions src/main/java/uk/co/objectivity/test/db/DBTestCompare.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import uk.co.objectivity.test.db.beans.TestParams;
import uk.co.objectivity.test.db.beans.TestResults;
import uk.co.objectivity.test.db.beans.xml.Compare;
import uk.co.objectivity.test.db.beans.xml.Condition;
import uk.co.objectivity.test.db.utils.Printer;
import uk.co.objectivity.test.db.utils.SavedTimes;
import uk.co.objectivity.test.db.utils.TCMessages;
Expand Down Expand Up @@ -88,12 +89,12 @@ public void testSQLResults() {

// assertions
if (compare.getCompareMode() == CompareMode.NMB_OF_RESULTS) {
List<uk.co.objectivity.test.db.beans.xml.Assert> assertList = compare.getAssertions();
List<Condition> assertList = compare.getAssertions();
if (assertList != null) {
logInfo2All("Rows count:" + testResults.getNmbOfRows(), tcMsgs);
TestResults effFinalTR = testResults;
assertList.forEach(a -> logInfo2All(a.getAssertType().name() + " " + a.getValue(), tcMsgs));
assertList.forEach(a -> a.getAssertType().assertByType(effFinalTR.getNmbOfRows(), a.getValue()));
assertList.forEach(a -> logInfo2All(a.getConditionType().name() + " " + a.getValue(), tcMsgs));
assertList.forEach(a -> a.getConditionType().assertByType(effFinalTR.getNmbOfRows(), a.getValue()));
int p = getIndexByName(testParams.getTestName());
if (p >= 0) {
savedTimesList.get(p).setTestResult("Passed");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import org.testng.Assert;

public enum AssertType {
public enum ConditionType {
EQ, NE, LT, LE, GE, GT;

public void assertByType(Integer actual, Integer expected) throws AssertionError {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public class Compare {
private List<BeforeSqls> beforeSqls;

@XmlElement(name = "assert")
private List<Assert> assertions;
private List<Condition> assertions;

@XmlElement(name = "file")
private File file;
Expand Down Expand Up @@ -150,11 +150,11 @@ public void setMinusQueryIndicatorOn(boolean minusQueryIndicatorOn) {
this.minusQueryIndicatorOn = minusQueryIndicatorOn;
}

public List<Assert> getAssertions() {
public List<Condition> getAssertions() {
return assertions;
}

public void setAssertions(List<Assert> assertions) {
public void setAssertions(List<Condition> assertions) {
this.assertions = assertions;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlValue;

import uk.co.objectivity.test.db.beans.AssertType;
import uk.co.objectivity.test.db.beans.ConditionType;

@XmlAccessorType(XmlAccessType.FIELD)
public class Assert {
public class Condition {

@XmlAttribute(name = "type")
private AssertType assertType;
private ConditionType conditionType;

@XmlValue
private Integer value;

public AssertType getAssertType() {
return assertType;
public ConditionType getConditionType() {
return conditionType;
}

public void setAssertType(AssertType assertType) {
this.assertType = assertType;
public void setConditionType(ConditionType conditionType) {
this.conditionType = conditionType;
}

public Integer getValue() {
Expand Down

0 comments on commit 715817c

Please sign in to comment.