From b9bb0ec76732377c2656e6837eaf96d5fc5f081a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Lamy?= Date: Sun, 19 Nov 2023 22:24:30 -0500 Subject: [PATCH] force validations --- .../java/app/owlcms/data/athlete/Athlete.java | 3 +++ .../java/app/owlcms/tests/MovingDownTest.java | 18 ++++++------------ 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/owlcms/src/main/java/app/owlcms/data/athlete/Athlete.java b/owlcms/src/main/java/app/owlcms/data/athlete/Athlete.java index 1ba71d523..88cd28ce4 100644 --- a/owlcms/src/main/java/app/owlcms/data/athlete/Athlete.java +++ b/owlcms/src/main/java/app/owlcms/data/athlete/Athlete.java @@ -5182,6 +5182,7 @@ private void validateChange1(int curLift, String automaticProgression, String de throw new RuleViolationException.LastChangeTooLow(this, curLift, newVal, prevVal); } try { + logger.warn("validateChange1 {} {} {}",isCheckTiming(),checkBlank(change2),checkBlank(actualLift)); if (isCheckTiming() && checkBlank(change2) && checkBlank(actualLift)) { checkChangeVsTimer(curLift, declaration, change1, change2); checkDeclarationWasMade(curLift, declaration); @@ -5216,6 +5217,7 @@ private void validateChange2(int curLift, String automaticProgression, String de throw new RuleViolationException.LastChangeTooLow(this, curLift, newVal, prevVal); } try { + logger.warn("validateChange2 {} {} {}",isCheckTiming(),checkBlank(actualLift)); if (isCheckTiming() && checkBlank(actualLift)) { checkChangeVsTimer(curLift, declaration, change1, change2); checkDeclarationWasMade(curLift, declaration); @@ -5250,6 +5252,7 @@ private void validateDeclaration(int curLift, String automaticProgression, Strin throw new RuleViolationException.DeclarationValueTooSmall(this, curLift, newVal, iAutomaticProgression); } try { + logger.warn("validateDeclaration {} {} {}",isCheckTiming(),checkBlank(change1),checkBlank(actualLift)); if (isCheckTiming() && (checkBlank(change1) && checkBlank(actualLift))) { checkChangeVsTimer(curLift, declaration, change1, change2); checkChangeVsLiftOrder(curLift, newVal); diff --git a/owlcms/src/test/java/app/owlcms/tests/MovingDownTest.java b/owlcms/src/test/java/app/owlcms/tests/MovingDownTest.java index 8c5559d8a..fa986ace0 100644 --- a/owlcms/src/test/java/app/owlcms/tests/MovingDownTest.java +++ b/owlcms/src/test/java/app/owlcms/tests/MovingDownTest.java @@ -129,7 +129,7 @@ public void cleanJerkCheckAttemptNumberWithClock() { schneiderF = groupAthletes.get(0); simpsonR = groupAthletes.get(1); allisonR = groupAthletes.get(2); - + // clean&jerk start simpsonR = declaration(simpsonR, "60", fopState); allisonR = declaration(allisonR, "61", fopState); @@ -178,7 +178,7 @@ public void cleanJerkCheckProgression() { schneiderF = groupAthletes.get(0); simpsonR = groupAthletes.get(1); allisonR = groupAthletes.get(2); - + // clean&jerk start schneiderF = declaration(schneiderF, "60", fopState); simpsonR = declaration(simpsonR, "62", fopState); @@ -348,7 +348,7 @@ public void cleanJerkCheckStartNumber() { schneiderF = groupAthletes.get(0); simpsonR = groupAthletes.get(1); allisonR = groupAthletes.get(2); - + // clean&jerk started simpsonR = declaration(simpsonR, "60", fopState); schneiderF = declaration(schneiderF, "64", fopState); @@ -733,6 +733,7 @@ private Athlete change1(final Athlete lifter, final String weight, FieldOfPlay f Athlete updated = JPAService.runInTransaction(em -> { int attempt = lifter.getAttemptsDone() + 1; logger.debug("***1 attempt {} change 1 for athlete {}: {}", attempt, lifter, weight); + lifter.setCheckTiming(true); switch (attempt) { case 1: lifter.setSnatch1Change1(weight); @@ -757,7 +758,6 @@ private Athlete change1(final Athlete lifter, final String weight, FieldOfPlay f lifter.getNextAttemptRequestedWeight()); return em.merge(lifter); }); - fopState.fopEventPost(new FOPEvent.WeightChange(this, updated, false)); return updated; } @@ -771,6 +771,7 @@ private Athlete change2(final Athlete lifter, final String weight, FieldOfPlay f Athlete updated = JPAService.runInTransaction(em -> { int attempt = lifter.getAttemptsDone() + 1; logger.debug("***1 attempt {} change 2 for athlete {}: {}", attempt, lifter, weight); + lifter.setCheckTiming(true); switch (attempt) { case 1: lifter.setSnatch1Change2(weight); @@ -808,6 +809,7 @@ private Athlete declaration(final Athlete lifter, final String weight, FieldOfPl Athlete updated = JPAService.runInTransaction(em -> { int attempt = lifter.getAttemptsDone() + 1; logger.info("*** attempt {} declaration for athlete {}: {}", attempt, lifter, weight); + lifter.setCheckTiming(true); switch (attempt) { case 1: lifter.setSnatch1Declaration(weight); @@ -942,7 +944,6 @@ private void testPrepAllSame(FieldOfPlay fopState, int nbAthletes) { fopState.testBefore(); fopState.loadGroup(gA, this, true); List groupAthletes = fopState.getDisplayOrder(); - setChecking(groupAthletes); // weigh-in JPAService.runInTransaction(em -> { @@ -960,12 +961,6 @@ private void testPrepAllSame(FieldOfPlay fopState, int nbAthletes) { fopState.loadGroup(gA, this, true); } - private void setChecking(List groupAthletes) { - for (Athlete a: groupAthletes) { - a.setCheckTiming(true); - } - } - private void testPrepSnatchCheckProgression(FieldOfPlay fopState, int nbAthletes) { OwlcmsSession.setFop(fopState); fopState.getLogger().setLevel(LoggerLevel); @@ -976,7 +971,6 @@ private void testPrepSnatchCheckProgression(FieldOfPlay fopState, int nbAthletes fopState.testBefore(); fopState.loadGroup(gA, this, true); List groupAthletes = fopState.getDisplayOrder(); - setChecking(groupAthletes); // weigh-in JPAService.runInTransaction(em -> {