Package com.alu.e3.data.model.sub

Examples of com.alu.e3.data.model.sub.TdrGenerationRule


   * @throws Exception
   */
  @Test
  public void testCommonTdrRules() throws Exception{
    // Add some tdr rules to a Policy and make sure they make it into the billing tdr
    TdrGenerationRule genRule = getBasicTestRule();
    // Add another kind of tdr
    TdrGenerationRule quotaRule = new TdrGenerationRule();
    TDRDataService.addNewTdrGenerationRule(exchange, quotaRule, "apiRateLimit");

    // Add some rule that will apply to all TDRs
    genRule.getStaticRules().add(TestHelper.getStaticRule("COMMON-STATIC", "COMMON-STATIC-VALUE", null));
    exchange.getIn().setHeader("COMMON-DYN-HEAD", "COMMON-DYN-HEAD-VALUE");
View Full Code Here


   * @throws Exception
   */
  @Test
  public void testMissingStaticValueAndProperty() throws Exception{
    // Add some tdr rules to a Policy and make sure they make it into the billing tdr
    TdrGenerationRule genRule = getBasicTestRule();
    genRule.getStaticRules().add(TestHelper.getStaticRule("STATIC-NAME", null, null, "Billing"));
    api.setTdrGenerationRule(genRule);

    requestProcessor.process(exchange);
    exchange.setProperty(ExchangeConstantKeys.E3_GOT_SB_RESPONSE.toString(), Boolean.TRUE);

View Full Code Here

   * @throws Exception
   */
  @Test
  public void testDuplicateRunRequest() throws Exception{
    // Add some tdr rules to a Policy and make sure they make it into the billing tdr
    TdrGenerationRule genRule = getBasicTestRule();
    genRule.getStaticRules().add(TestHelper.getStaticRule("STATIC-NAME", null, null, "Billing"));
    api.setTdrGenerationRule(genRule);

    requestProcessor.process(exchange);
    testPostRequest();
    TDRDataService.clean(exchange);
View Full Code Here

   * This test should make sure that no request rules are activated on if it is a response
   */
  @Test
  public void testRunRequestProcOnResponse() throws Exception{
    // Add some tdr rules to a Policy and make sure they make it into the billing tdr
    TdrGenerationRule genRule = getBasicTestRule();
    genRule.getStaticRules().add(TestHelper.getStaticRule("STATIC-NAME", null, null, "Billing"));
    api.setTdrGenerationRule(genRule);
    exchange.setProperty(ExchangeConstantKeys.E3_GOT_SB_RESPONSE.toString(), Boolean.TRUE);

    requestProcessor.process(exchange);
    testRequestNotRun();
View Full Code Here

   * This test should make sure that no response rules are activated on if it is a request
   */
  @Test
  public void testRunResponseProcOnRequest()throws Exception{
    // Add some tdr rules to a Policy and make sure they make it into the billing tdr
    TdrGenerationRule genRule = getBasicTestRule();
    genRule.getStaticRules().add(TestHelper.getStaticRule("STATIC-NAME", null, null, "Billing"));
    api.setTdrGenerationRule(genRule);

    responseProcessor.process(exchange);

    testResponseNotRun();
View Full Code Here

   * @throws Exception
   */
  @Test
  public void testDuplicateRunResponse() throws Exception{
    // Add some tdr rules to a Policy and make sure they make it into the billing tdr
    TdrGenerationRule genRule = getBasicTestRule();
    genRule.getStaticRules().add(TestHelper.getStaticRule("STATIC-NAME", null, null, "Billing"));
    api.setTdrGenerationRule(genRule);

    exchange.setProperty(ExchangeConstantKeys.E3_GOT_SB_RESPONSE.toString(), Boolean.TRUE);
    responseProcessor.process(exchange);
    TDRDataService.clean(exchange);
View Full Code Here

    exchange.getIn().setHeader("REQUEST-HEAD", "REQUEST-HEAD-VAL");
    Map<String, String> props = new HashMap<String, String>();
    props.put("appId", "1234");
    exchange.setProperty(ExchangeConstantKeys.E3_MODEL_PROPERTIES.toString(), props);

    TdrGenerationRule genRule = new TdrGenerationRule();
    genRule.getDynamicRules().add(TestHelper.getDynamicRule("AUTH-DYN", "AUTH_HEAD", ExtractFromType.Response, "Billing"));
    genRule.getDynamicRules().add(TestHelper.getDynamicRule("DYN-REQUEST", "REQUEST-HEAD", ExtractFromType.Request, "Billing"));
    genRule.getStaticRules().add(TestHelper.getStaticRule("AUTH-STAT-VAL", "1234", null, "Billing"));
    genRule.getStaticRules().add(TestHelper.getStaticRule("AUTH-PROP-VAL", null, "appId", "Billing"));
    return genRule;
  }
View Full Code Here

    return t;
  }

  private static TdrStaticRule toDataModel(StaticTdr staticTdr) {
    if (staticTdr==null) throw new IllegalArgumentException("staticTdr must not be null");
    TdrStaticRule t = new TdrStaticRule();
    t.setTdrPropName  (staticTdr.getTdrPropName());
    t.setValue      (staticTdr.getValue());
    t.setPropertyName  (staticTdr.getPropertyName());

    if(staticTdr.getTypes() != nullt.getTypes().addAll  (staticTdr.getTypes().getType());

    return t;
  }
View Full Code Here

        }
      }
      speakersActive.add(inst);
    }
   
    fireInstanceAdded(new InstanceEvent(inst));
  }
View Full Code Here

   
    Iterator<Instance> itr = list.iterator();
    while (itr.hasNext()) {
      if (itr.next().getInternalIP().equals(inst.getInternalIP())) {
        itr.remove();
          fireInstanceRemoved(new InstanceEvent(inst));
        return true;
      }
    }
    return false;   
   
View Full Code Here

TOP

Related Classes of com.alu.e3.data.model.sub.TdrGenerationRule

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.