Package org.cipango.sip

Examples of org.cipango.sip.SipFields$Field


    @Test
    public void record_error_for_field()
    {
        ValidationTracker tracker = mockValidationTracker();
        String message = "A recorded message.";
        Field field = mockField();

        tracker.recordError(field, message);

        replay();
View Full Code Here


  }
 
  void onValidateFromGenericField(String value) {
    if (value == null || !value.toLowerCase().startsWith("a")) {
      String fieldName = getFieldName(genericField.getControlName());
      Field fieldSnapshot = new FieldSnapshot(genericField);
      form.recordError(fieldSnapshot, fieldName + " must start with 'a'");
    }
  }
View Full Code Here

public class FieldTranslatorSourceImplTest extends InternalBaseTestCase
{
    @Test
    public void create_default_property_type_null()
    {
        Field field = mockField();
        Messages messages = mockMessages();
        Locale locale = Locale.ENGLISH;

        replay();
View Full Code Here

    }

    @Test
    public void create_default_translator_not_found_for_type()
    {
        Field field = mockField();
        Messages messages = mockMessages();
        Locale locale = Locale.ENGLISH;
        Class propertyType = Map.class;
        TranslatorSource ts = mockTranslatorSource();
        AnnotationProvider ap = mockAnnotationProvider(null);
View Full Code Here

    }

    @Test
    public void create_default_translator_with_name()
    {
        Field field = mockField();
        Messages messages = mockMessages();
        Locale locale = Locale.ENGLISH;
        Class propertyType = Map.class;
        TranslatorSource ts = mockTranslatorSource();
        FormSupport fs = mockFormSupport();
View Full Code Here

    }

    @Test
    public void create_default_translator_with_override_message()
    {
        Field field = mockField();
        Messages messages = mockMessages();
        Locale locale = Locale.ENGLISH;
        Class propertyType = Map.class;
        TranslatorSource ts = mockTranslatorSource();
        FormSupport fs = mockFormSupport();
View Full Code Here

    }

    @Test
    public void create_default_translator_with_per_form_override_message()
    {
        Field field = mockField();
        Messages messages = mockMessages();
        Locale locale = Locale.ENGLISH;
        Class propertyType = Map.class;
        TranslatorSource ts = mockTranslatorSource();
        FormSupport fs = mockFormSupport();
View Full Code Here

{
    @SuppressWarnings("unchecked")
    @Test
    public void null_value_skipped() throws Exception
    {
        Field field = mockField();
        MessageFormatter formatter = mockMessageFormatter();
        Validator validator = mockValidator();

        train_isRequired(validator, false);
View Full Code Here

   
    setCallSession(request.getCallSession());
    setTransaction(request.getTransaction());
    setSession(request.session());
   
    SipFields reqFields = request.getFields();
    _fields.copy(reqFields, SipHeaders.VIA_BUFFER);
    _fields.copy(reqFields, SipHeaders.FROM_BUFFER);
    _fields.copy(reqFields, SipHeaders.TO_BUFFER);
    _fields.copy(reqFields, SipHeaders.CALL_ID_BUFFER);
    _fields.copy(reqFields, SipHeaders.CSEQ_BUFFER);
View Full Code Here

      return request;
    }
   
    protected void setDialogHeaders(SipRequest request, long cseq)
    {
      SipFields fields = request.getFields();
     
      fields.setAddress(SipHeaders.FROM_BUFFER, _localParty);
      fields.setAddress(SipHeaders.TO_BUFFER, _remoteParty);
     
      if (_remoteTarget != null)
        request.setRequestURI((URI) _remoteTarget.clone());
      else if (request.getRequestURI() == null)
        request.setRequestURI(request.to().getURI());
     
      if (_routeSet != null)
      {
        fields.remove(SipHeaders.ROUTE_BUFFER);
       
        for (String route: _routeSet)
        {
          fields.addString(SipHeaders.ROUTE_BUFFER, route);
        }
      }
      fields.setString(SipHeaders.CALL_ID_BUFFER, _callId);
      fields.setString(SipHeaders.CSEQ_BUFFER, cseq + " " + request.getMethod());
      fields.setString(SipHeaders.MAX_FORWARDS_BUFFER, "70");
     
      if (request.needsContact())
        fields.setAddress(SipHeaders.CONTACT_BUFFER, getContact());
    }
View Full Code Here

TOP

Related Classes of org.cipango.sip.SipFields$Field

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.