Search in sources :

Example 11 with Field

use of com.google.firestore.admin.v1.Field in project tapestry-5 by apache.

the class ValidationTrackerImplTest method newFieldWithControlName.

private final Field newFieldWithControlName(String controlName) {
    Field field = mockField();
    // Fields generated this way, for the purposes of this test, do not
    // ever change their controlName. In real life, elementNames can change.
    expect(field.getControlName()).andReturn(controlName).atLeastOnce();
    return field;
}
Also used : Field(org.apache.tapestry5.Field)

Example 12 with Field

use of com.google.firestore.admin.v1.Field in project tapestry-5 by apache.

the class ValidationTrackerImplTest method unsassoicated_errors_listed_first.

@Test
public void unsassoicated_errors_listed_first() {
    ValidationTracker tracker = new ValidationTrackerImpl();
    Field field = newFieldWithControlName("field");
    replay();
    tracker.recordError(field, "one");
    tracker.recordError("two");
    assertEquals(tracker.getErrors(), Arrays.asList("two", "one"));
    assertEquals(tracker.getUnassociatedErrors(), Arrays.asList("two"));
    verify();
}
Also used : Field(org.apache.tapestry5.Field) ValidationTracker(org.apache.tapestry5.ValidationTracker) ValidationTrackerImpl(org.apache.tapestry5.ValidationTrackerImpl) Test(org.testng.annotations.Test)

Example 13 with Field

use of com.google.firestore.admin.v1.Field in project tapestry-5 by apache.

the class EmailTest method input_mismatch.

@Test
public void input_mismatch() throws Exception {
    Field field = mockField();
    MessageFormatter formatter = mockMessageFormatter();
    Html5Support html5Support = mockHtml5Support();
    replay();
    Email validator = new Email(null, html5Support);
    try {
        validator.validate(field, null, formatter, "invalid_email");
        unreachable();
    } catch (ValidationException ex) {
    }
    try {
        validator.validate(field, null, formatter, "@mail.com");
        unreachable();
    } catch (ValidationException ex) {
    }
    // TAP5-2282
    try {
        validator.validate(field, null, formatter, "aaa@bbb/cc");
        unreachable();
    } catch (ValidationException ex) {
    }
    verify();
}
Also used : Field(org.apache.tapestry5.Field) Html5Support(org.apache.tapestry5.services.Html5Support) ValidationException(org.apache.tapestry5.ValidationException) MessageFormatter(org.apache.tapestry5.commons.MessageFormatter) Test(org.testng.annotations.Test)

Example 14 with Field

use of com.google.firestore.admin.v1.Field in project tapestry-5 by apache.

the class MaxLengthTest method short_enough.

@Test
public void short_enough() throws Exception {
    Field field = mockField();
    MessageFormatter formatter = mockMessageFormatter();
    String value = "Now the student has become the master.";
    replay();
    MaxLength validator = new MaxLength(null);
    validator.validate(field, value.length(), formatter, value);
    verify();
}
Also used : Field(org.apache.tapestry5.Field) MessageFormatter(org.apache.tapestry5.commons.MessageFormatter) Test(org.testng.annotations.Test)

Example 15 with Field

use of com.google.firestore.admin.v1.Field in project tapestry-5 by apache.

the class MaxTest method small_enough.

@Test
public void small_enough() throws Exception {
    Field field = mockField();
    MessageFormatter formatter = mockMessageFormatter();
    Long constraint = 50L;
    Max validator = new Max(null, mockHtml5Support());
    replay();
    for (int value = 48; value <= 50; value++) validator.validate(field, constraint, formatter, value);
    verify();
}
Also used : Field(org.apache.tapestry5.Field) MessageFormatter(org.apache.tapestry5.commons.MessageFormatter) Test(org.testng.annotations.Test)

Aggregations

Field (io.atlasmap.v2.Field)221 FieldGroup (io.atlasmap.v2.FieldGroup)86 Test (org.junit.jupiter.api.Test)67 SimpleField (io.atlasmap.v2.SimpleField)62 Field (org.apache.tapestry5.Field)46 JavaField (io.atlasmap.java.v2.JavaField)45 ArrayList (java.util.ArrayList)42 Mapping (io.atlasmap.v2.Mapping)39 Test (org.testng.annotations.Test)39 AtlasPath (io.atlasmap.core.AtlasPath)29 ConstantField (io.atlasmap.v2.ConstantField)29 JavaEnumField (io.atlasmap.java.v2.JavaEnumField)26 AtlasException (io.atlasmap.api.AtlasException)25 JsonField (io.atlasmap.json.v2.JsonField)25 MessageFormatter (org.apache.tapestry5.commons.MessageFormatter)25 PropertyField (io.atlasmap.v2.PropertyField)22 AtlasMapping (io.atlasmap.v2.AtlasMapping)21 KafkaConnectField (io.atlasmap.kafkaconnect.v2.KafkaConnectField)19 AtlasInternalSession (io.atlasmap.spi.AtlasInternalSession)19 Head (io.atlasmap.spi.AtlasInternalSession.Head)18