Package net.anotheria.moskito.core.registry

Examples of net.anotheria.moskito.core.registry.ProducerRegistryAPIFactory


    //and this payment failed
    counter.pay("cc", false);

    //As you see we had a total of 4 payments, one credit card payment, 2 ec payments and one paypal. Let's test it:
    //this code is just to test the results, you don't need to repeat it in your code, the counters will show up in the webui.
    IProducerRegistryAPI registry = new ProducerRegistryAPIFactory().createProducerRegistryAPI();

    //check successes
    OnDemandStatsProducer<CounterStats> successProducer = (OnDemandStatsProducer<CounterStats>)registry.getProducer("PaymentCounterByParameter.success");
    assertNotNull(successProducer);
    assertEquals(4, successProducer.getDefaultStats().get());
View Full Code Here


    counter.pay("cc");
    counter.pay("paypal");

    //As you see we had a total of 4 payments, one credit card payment, 2 ec payments and one paypal. Let's test it:
    //this code is just to test the results, you don't need to repeat it in your code, the counters will show up in the webui.
    IProducerRegistryAPI registry = new ProducerRegistryAPIFactory().createProducerRegistryAPI();
    IStatsProducer<CounterStats> producer = registry.getProducer("PaymentCounterMethodBased");
    assertNotNull(producer);
    //total stats is always at first place in producer which is an instance of an on-demand-producer.
    assertEquals(4, producer.getStats().get(0).get());
    //other stats follow in order they are first called.
View Full Code Here

TOP

Related Classes of net.anotheria.moskito.core.registry.ProducerRegistryAPIFactory

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.