Skip to content

Commit

Permalink
revert de election test para correccion de error
Browse files Browse the repository at this point in the history
  • Loading branch information
RodrigoZambrana committed Dec 27, 2024
1 parent 2603bbe commit cb81bb3
Showing 1 changed file with 159 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
Expand All @@ -25,29 +26,176 @@ public static Test suite() {
public void testElection() {
AssertAnnotations.assertType(Election.class, Entity.class);

// Grouped Fields
// fields
AssertAnnotations.assertField(Election.class, "electionId", Id.class, GeneratedValue.class, SequenceGenerator.class, Column.class);
AssertAnnotations.assertField(Election.class, "migrationId, category, migrated, startDate, endDate, creationDate, titleSpanish, titleEnglish, titlePortuguese, linkSpanish, linkEnglish, linkPortuguese, descriptionSpanish, descriptionEnglish, descriptionPortuguese, maxCandidates, votingLinkAvailable, resultLinkAvailable, auditorLinkAvailable, revisionRequest, onlySp, resultToken, defaultSender, electorsSet, candidatesSet, auditorsSet, randomOrderCandidates, diffUTC, closed, closedDate", Column.class);
AssertAnnotations.assertField(Election.class, "auxStartDate, auxStartHour, auxEndDate, auxEndHour", Transient.class);
AssertAnnotations.assertField(Election.class, "candidates, userVoters, auditors, electionTemplates, votes, email", OneToMany.class);
AssertAnnotations.assertField(Election.class, "migrationId", Column.class);
AssertAnnotations.assertField(Election.class, "category", Column.class, Enumerated.class);
AssertAnnotations.assertField(Election.class, "migrated", Column.class);
AssertAnnotations.assertField(Election.class, "startDate", Column.class);
AssertAnnotations.assertField(Election.class, "endDate", Column.class);
AssertAnnotations.assertField(Election.class, "creationDate", Column.class);
AssertAnnotations.assertField(Election.class, "titleSpanish", Column.class);
AssertAnnotations.assertField(Election.class, "titleEnglish", Column.class);
AssertAnnotations.assertField(Election.class, "titlePortuguese", Column.class);
AssertAnnotations.assertField(Election.class, "linkSpanish", Column.class);
AssertAnnotations.assertField(Election.class, "linkEnglish", Column.class);
AssertAnnotations.assertField(Election.class, "linkPortuguese", Column.class);
AssertAnnotations.assertField(Election.class, "descriptionSpanish", Column.class);
AssertAnnotations.assertField(Election.class, "descriptionEnglish", Column.class);
AssertAnnotations.assertField(Election.class, "descriptionPortuguese", Column.class);
AssertAnnotations.assertField(Election.class, "maxCandidates", Column.class);
AssertAnnotations.assertField(Election.class, "votingLinkAvailable", Column.class);
AssertAnnotations.assertField(Election.class, "resultLinkAvailable", Column.class);
AssertAnnotations.assertField(Election.class, "auditorLinkAvailable", Column.class);
AssertAnnotations.assertField(Election.class, "revisionRequest", Column.class);
AssertAnnotations.assertField(Election.class, "onlySp", Column.class);
AssertAnnotations.assertField(Election.class, "resultToken", Column.class);
AssertAnnotations.assertField(Election.class, "defaultSender", Column.class);
AssertAnnotations.assertField(Election.class, "electorsSet", Column.class);
AssertAnnotations.assertField(Election.class, "candidatesSet", Column.class);
AssertAnnotations.assertField(Election.class, "auditorsSet", Column.class);
AssertAnnotations.assertField(Election.class, "randomOrderCandidates", Column.class);
AssertAnnotations.assertField(Election.class, "diffUTC", Column.class);
AssertAnnotations.assertField(Election.class, "candidates", OneToMany.class);
AssertAnnotations.assertField(Election.class, "userVoters", OneToMany.class);
AssertAnnotations.assertField(Election.class, "auditors", OneToMany.class);
AssertAnnotations.assertField(Election.class, "electionTemplates", OneToMany.class);
AssertAnnotations.assertField(Election.class, "votes", OneToMany.class);
AssertAnnotations.assertField(Election.class, "email", OneToMany.class);
AssertAnnotations.assertField(Election.class, "auxStartDate", Transient.class);
AssertAnnotations.assertField(Election.class, "auxStartHour", Transient.class);
AssertAnnotations.assertField(Election.class, "auxEndDate", Transient.class);
AssertAnnotations.assertField(Election.class, "auxEndHour", Transient.class);
AssertAnnotations.assertField(Election.class, "closed", Column.class);
AssertAnnotations.assertField(Election.class, "closedDate", Column.class);

// Grouped Methods
AssertAnnotations.assertMethod(Election.class, "getElectionId, getStartDate, getEndDate, getMaxCandidates, isVotingLinkAvailable, getCandidates, getCreationDate, getUserVoters, getVotes, isResultLinkAvailable, getTitleSpanish, getTitleEnglish, getTitlePortuguese, getDescriptionSpanish, getDescriptionEnglish, getDescriptionPortuguese, getResultToken, getAuditors, getLinkSpanish, getLinkEnglish, getLinkPortuguese, getAuxStartDate, getAuxStartHour, getAuxEndDate, getAuxEndHour, isOnlySp, isAuditorLinkAvailable, isElectorsSet, isCandidatesSet, isAuditorsSet, getElectionTemplates, getDefaultSender, getResultLink, isRandomOrderCandidates, getStartDateString, getDiffUTC, isRevisionRequest, isFinished, isStarted, isEnabledToVote, isMigrated, getCategory, isClosed, getClosedDate");
// metodos
AssertAnnotations.assertMethod(Election.class, "getElectionId");
AssertAnnotations.assertMethod(Election.class, "getStartDate");
AssertAnnotations.assertMethod(Election.class, "getEndDate");
AssertAnnotations.assertMethod(Election.class, "getMaxCandidates");
AssertAnnotations.assertMethod(Election.class, "isVotingLinkAvailable");
AssertAnnotations.assertMethod(Election.class, "getCandidates");
AssertAnnotations.assertMethod(Election.class, "getCreationDate");
AssertAnnotations.assertMethod(Election.class, "getUserVoters");
AssertAnnotations.assertMethod(Election.class, "getVotes");
AssertAnnotations.assertMethod(Election.class, "isResultLinkAvailable");
AssertAnnotations.assertMethod(Election.class, "getTitleSpanish");
AssertAnnotations.assertMethod(Election.class, "getTitleEnglish");
AssertAnnotations.assertMethod(Election.class, "getTitlePortuguese");
AssertAnnotations.assertMethod(Election.class, "getDescriptionSpanish");
AssertAnnotations.assertMethod(Election.class, "getDescriptionEnglish");
AssertAnnotations.assertMethod(Election.class, "getDescriptionPortuguese");
AssertAnnotations.assertMethod(Election.class, "getResultToken");
AssertAnnotations.assertMethod(Election.class, "getAuditors");
AssertAnnotations.assertMethod(Election.class, "getLinkSpanish");
AssertAnnotations.assertMethod(Election.class, "getLinkEnglish");
AssertAnnotations.assertMethod(Election.class, "getLinkPortuguese");
AssertAnnotations.assertMethod(Election.class, "getAuxStartDate");
AssertAnnotations.assertMethod(Election.class, "getAuxStartHour");
AssertAnnotations.assertMethod(Election.class, "getAuxEndHour");
AssertAnnotations.assertMethod(Election.class, "getAuxEndHour");
AssertAnnotations.assertMethod(Election.class, "isOnlySp");
AssertAnnotations.assertMethod(Election.class, "isAuditorLinkAvailable");
AssertAnnotations.assertMethod(Election.class, "isElectorsSet");
AssertAnnotations.assertMethod(Election.class, "isCandidatesSet");
AssertAnnotations.assertMethod(Election.class, "isAuditorsSet");
AssertAnnotations.assertMethod(Election.class, "getElectionTemplates");
AssertAnnotations.assertMethod(Election.class, "getDefaultSender");
AssertAnnotations.assertMethod(Election.class, "getResultLink");
AssertAnnotations.assertMethod(Election.class, "isRandomOrderCandidates");
AssertAnnotations.assertMethod(Election.class, "getStartDateString");
AssertAnnotations.assertMethod(Election.class, "getDiffUTC");
AssertAnnotations.assertMethod(Election.class, "isRevisionRequest");
AssertAnnotations.assertMethod(Election.class, "isFinished");
AssertAnnotations.assertMethod(Election.class, "isStarted");
AssertAnnotations.assertMethod(Election.class, "isEnabledToVote");
AssertAnnotations.assertMethod(Election.class, "isMigrated");
AssertAnnotations.assertMethod(Election.class, "getCategory");
AssertAnnotations.assertMethod(Election.class, "isClosed");
AssertAnnotations.assertMethod(Election.class, "getClosedDate");

// Class Annotations
// class annotations
Entity a = ReflectTool.getClassAnnotation(Election.class, Entity.class);
assertEquals("", a.name());

// Specific Annotations
Column c = ReflectTool.getFieldAnnotation(Election.class, "electionId", Column.class);
Column c;
OneToMany oa;
c = ReflectTool.getFieldAnnotation(Election.class, "electionId", Column.class);
assertEquals("election_id", c.name());
c = ReflectTool.getFieldAnnotation(Election.class, "migrationId", Column.class);
assertEquals("migration_id", c.name());
OneToMany oa = ReflectTool.getFieldAnnotation(Election.class, "candidates", OneToMany.class);
c = ReflectTool.getFieldAnnotation(Election.class, "category", Column.class);
assertEquals("", c.name());
c = ReflectTool.getFieldAnnotation(Election.class, "migrated", Column.class);
assertEquals("", c.name());
c = ReflectTool.getFieldAnnotation(Election.class, "startDate", Column.class);
assertEquals("", c.name());
c = ReflectTool.getFieldAnnotation(Election.class, "endDate", Column.class);
assertEquals("", c.name());
c = ReflectTool.getFieldAnnotation(Election.class, "creationDate", Column.class);
assertEquals("", c.name());
c = ReflectTool.getFieldAnnotation(Election.class, "titleSpanish", Column.class);
assertEquals("", c.name());
c = ReflectTool.getFieldAnnotation(Election.class, "titleEnglish", Column.class);
assertEquals("", c.name());
c = ReflectTool.getFieldAnnotation(Election.class, "titlePortuguese", Column.class);
assertEquals("", c.name());
c = ReflectTool.getFieldAnnotation(Election.class, "linkSpanish", Column.class);
assertEquals("", c.name());
c = ReflectTool.getFieldAnnotation(Election.class, "linkEnglish", Column.class);
assertEquals("", c.name());
c = ReflectTool.getFieldAnnotation(Election.class, "linkPortuguese", Column.class);
assertEquals("", c.name());
c = ReflectTool.getFieldAnnotation(Election.class, "descriptionSpanish", Column.class);
assertEquals("", c.name());
c = ReflectTool.getFieldAnnotation(Election.class, "descriptionEnglish", Column.class);
assertEquals("", c.name());
c = ReflectTool.getFieldAnnotation(Election.class, "descriptionPortuguese", Column.class);
assertEquals("", c.name());
c = ReflectTool.getFieldAnnotation(Election.class, "maxCandidates", Column.class);
assertEquals("", c.name());
c = ReflectTool.getFieldAnnotation(Election.class, "votingLinkAvailable", Column.class);
assertEquals("", c.name());
c = ReflectTool.getFieldAnnotation(Election.class, "resultLinkAvailable", Column.class);
assertEquals("", c.name());
c = ReflectTool.getFieldAnnotation(Election.class, "auditorLinkAvailable", Column.class);
assertEquals("", c.name());
c = ReflectTool.getFieldAnnotation(Election.class, "revisionRequest", Column.class);
assertEquals("", c.name());
c = ReflectTool.getFieldAnnotation(Election.class, "onlySp", Column.class);
assertEquals("", c.name());
c = ReflectTool.getFieldAnnotation(Election.class, "resultToken", Column.class);
assertEquals("", c.name());
c = ReflectTool.getFieldAnnotation(Election.class, "defaultSender", Column.class);
assertEquals("", c.name());
c = ReflectTool.getFieldAnnotation(Election.class, "electorsSet", Column.class);
assertEquals("", c.name());
c = ReflectTool.getFieldAnnotation(Election.class, "candidatesSet", Column.class);
assertEquals("", c.name());
c = ReflectTool.getFieldAnnotation(Election.class, "auditorsSet", Column.class);
assertEquals("", c.name());
c = ReflectTool.getFieldAnnotation(Election.class, "randomOrderCandidates", Column.class);
assertEquals("", c.name());
c = ReflectTool.getFieldAnnotation(Election.class, "diffUTC", Column.class);
assertEquals("", c.name());
oa = ReflectTool.getFieldAnnotation(Election.class, "candidates", OneToMany.class);
assertEquals("election", oa.mappedBy());
oa = ReflectTool.getFieldAnnotation(Election.class, "auditors", OneToMany.class);
assertEquals("election", oa.mappedBy());
oa = ReflectTool.getFieldAnnotation(Election.class, "userVoters", OneToMany.class);
assertEquals("election", oa.mappedBy());
oa = ReflectTool.getFieldAnnotation(Election.class, "electionTemplates", OneToMany.class);
assertEquals("election", oa.mappedBy());
oa = ReflectTool.getFieldAnnotation(Election.class, "votes", OneToMany.class);
assertEquals("election", oa.mappedBy());
oa = ReflectTool.getFieldAnnotation(Election.class, "email", OneToMany.class);
assertEquals("election", oa.mappedBy());
c = ReflectTool.getFieldAnnotation(Election.class, "closed", Column.class);
assertEquals("", c.name());
c = ReflectTool.getFieldAnnotation(Election.class, "closedDate", Column.class);
assertEquals("", c.name());

}

}
}

0 comments on commit cb81bb3

Please sign in to comment.