public void testGetTransforms() {
   Transform[] transforms = m_out.getTransforms();
   assertEquals(1, transforms.length);
   assertTrue(transforms[0] instanceof FullTransform);
   FullTransform fullTransform = (FullTransform) transforms[0];
   assertEquals(VOICEMAIL_USER, fullTransform.getUser());
   assertEquals(1, fullTransform.getFieldParams().length);
   assertEquals(FIELD_PARAMS, fullTransform.getFieldParams()[0]);
 }
Пример #2
0
 @Override
 public Transform[] getTransforms() {
   CallPattern patternNormal = new CallPattern(StringUtils.EMPTY, CallDigits.VARIABLE_DIGITS);
   String user = patternNormal.calculatePattern();
   List<Gateway> gateways = getGateways();
   List<Transform> transforms = new ArrayList<Transform>(gateways.size());
   ForkQueueValue q = new ForkQueueValue(gateways.size());
   for (Gateway gateway : gateways) {
     FullTransform transform = new FullTransform();
     transform.setUser(gateway.getCallPattern(user));
     transform.setHost(gateway.getGatewayAddress());
     String transport = gateway.getGatewayTransportUrlParam();
     if (transport != null) {
       transform.setUrlParams(transport);
     }
     String[] fieldParams = new String[] {q.getSerial()};
     transform.setFieldParams(fieldParams);
     transforms.add(transform);
   }
   return transforms.toArray(new Transform[transforms.size()]);
 }