use of org.ff4j.audit.EventBuilder in project ff4j by ff4j.
the class AuditBeanTest method testTimeSerieChart.
@Test
public void testTimeSerieChart() {
long top = System.currentTimeMillis();
TimeSeriesChart t1 = new TimeSeriesChart(top - 100000, top + 100000, TimeUnit.MINUTES);
new TimeSeriesChart(top - 100000, top + 100000, TimeUnit.HOURS);
new TimeSeriesChart(top - 100000, top + 100000, TimeUnit.DAYS);
new TimeSeriesChart(top - 100000, top + 100000, TimeUnit.SECONDS);
t1.addEvent(new EventBuilder().name("f1").build());
t1.addEvent(new EventBuilder().name("f2").build());
Assert.assertNotNull(t1.getSdf());
Assert.assertNotNull(t1.toString());
TimeSeriesChart tsc1 = new TimeSeriesChart();
tsc1.setSdf(new SimpleDateFormat("yyyy"));
tsc1.setTimeSlots(new ArrayList<String>());
tsc1.setSeries(new HashMap<String, Serie<Map<String, MutableHitCount>>>());
Assert.assertNotNull(tsc1);
}
use of org.ff4j.audit.EventBuilder in project ff4j by ff4j.
the class AuditBeanTest method testEventBuider.
@Test
public void testEventBuider() {
FF4j ff4j = new FF4j();
ff4j.setAuthorizationsManager(new DefinedPermissionSecurityManager("a", Util.set("1", "2")));
EventBuilder eb = new EventBuilder(ff4j);
eb.name("FeatureX");
Assert.assertEquals("a", eb.build().getUser());
}
use of org.ff4j.audit.EventBuilder in project ff4j by ff4j.
the class AuditBeanTest method testAverageDuration.
@Test
public void testAverageDuration() {
EventSeries es = new EventSeries();
es.add(new EventBuilder().duration(1).build());
es.add(new EventBuilder().duration(3).build());
Assert.assertEquals(new Double(2), new Double(es.getAverageDuration()));
}
Aggregations