Package org.apache.openejb.core.timer

Examples of org.apache.openejb.core.timer.CalendarTimerData


        assertEqualsByReflection(timer, timerDeserialized, "retryAttempts");
    }

    @Test
    public void serializationOfCalendarData() throws Exception {
        final CalendarTimerData data = timerData();

        final byte[] serial = serialize(data);
        final CalendarTimerData dataDeserialized = (CalendarTimerData) deserialize(serial);

        assertThat(dataDeserialized, instanceOf(CalendarTimerData.class));

        assertEqualsByReflection(data, dataDeserialized, "id");
        assertEqualsByReflection(data, dataDeserialized, "deploymentId");
View Full Code Here


        assertEqualsByReflection(data, dataDeserialized, "info");
    }

    @Test
    public void jobDataMapSerial() throws Exception {
        final CalendarTimerData data = timerData();
        final EjbTimerServiceImpl timerService = (EjbTimerServiceImpl) timerService();

        data.setScheduler(timerService.getScheduler());
        // small hack for the test
        final Field preventSynch = TimerData.class.getDeclaredField("synchronizationRegistered");
        preventSynch.setAccessible(true);
        preventSynch.set(data, true);
        data.newTimer();

        final AbstractTrigger<?> trigger = (AbstractTrigger<?>) data.getTrigger();
        trigger.setJobName("my-job");
        trigger.setJobGroup("my-group");

        final JobDataMap triggerDataMap = trigger.getJobDataMap();
        triggerDataMap.put(EjbTimeoutJob.EJB_TIMERS_SERVICE, timerService);
View Full Code Here

    public static CalendarTimerData timerData() throws Exception {
        final BeanContext context = SystemInstance.get().getComponent(ContainerSystem.class).getBeanContext("EJBWithTimer");
        final EjbTimerService timer = context.getEjbTimerService();
        final MethodContext ctx = context.getMethodContext(EJBWithTimer.class.getMethod("doSthg"));
        final ScheduleData sd = ctx.getSchedules().iterator().next();
        return new CalendarTimerData(1, (EjbTimerServiceImpl) timer, context.getDeploymentID().toString(), null, ctx.getBeanMethod(), sd.getConfig(), sd.getExpression(), false);
    }
View Full Code Here

        assertEqualsByReflection(timer, timerDeserialized, "retryAttempts");
    }

    @Test
    public void serializationOfCalendarData() throws Exception {
        final CalendarTimerData data = timerData();

        final byte[] serial = serialize(data);
        final CalendarTimerData dataDeserialized = (CalendarTimerData) deserialize(serial);

        assertThat(dataDeserialized, instanceOf(CalendarTimerData.class));

        assertEqualsByReflection(data, dataDeserialized, "id");
        assertEqualsByReflection(data, dataDeserialized, "deploymentId");
View Full Code Here

        assertEqualsByReflection(data, dataDeserialized, "info");
    }

    @Test
    public void jobDataMapSerial() throws Exception {
        final CalendarTimerData data = timerData();
        final EjbTimerServiceImpl timerService = (EjbTimerServiceImpl) timerService();

        data.setScheduler(timerService.getScheduler());
        // small hack for the test
        final Field preventSynch = TimerData.class.getDeclaredField("synchronizationRegistered");
        preventSynch.setAccessible(true);
        preventSynch.set(data, true);
        data.newTimer();

        final AbstractTrigger<?> trigger = (AbstractTrigger<?>) data.getTrigger();
        trigger.setJobName("my-job");
        trigger.setJobGroup("my-group");

        final JobDataMap triggerDataMap = trigger.getJobDataMap();
        triggerDataMap.put(EjbTimeoutJob.EJB_TIMERS_SERVICE, timerService);
View Full Code Here

    public static CalendarTimerData timerData() throws Exception {
        final BeanContext context = SystemInstance.get().getComponent(ContainerSystem.class).getBeanContext("EJBWithTimer");
        final EjbTimerService timer = context.getEjbTimerService();
        final MethodContext ctx = context.getMethodContext(EJBWithTimer.class.getMethod("doSthg"));
        final ScheduleData sd = ctx.getSchedules().iterator().next();
        return new CalendarTimerData(1, (EjbTimerServiceImpl) timer, context.getDeploymentID().toString(), null, ctx.getBeanMethod(), sd.getConfig(), sd.getExpression(), false);
    }
View Full Code Here

        assertEqualsByReflection(timer, timerDeserialized, "retryAttempts");
    }

    @Test
    public void serializationOfCalendarData() throws Exception {
        final CalendarTimerData data = timerData();

        final byte[] serial = serialize(data);
        final CalendarTimerData dataDeserialized = (CalendarTimerData) deserialize(serial);

        assertThat(dataDeserialized, instanceOf(CalendarTimerData.class));

        assertEqualsByReflection(data, dataDeserialized, "id");
        assertEqualsByReflection(data, dataDeserialized, "deploymentId");
View Full Code Here

        assertEqualsByReflection(data, dataDeserialized, "info");
    }

    @Test
    public void jobDataMapSerial() throws Exception {
        final CalendarTimerData data = timerData();
        final EjbTimerServiceImpl timerService = (EjbTimerServiceImpl) timerService();

        data.setScheduler(timerService.getScheduler());
        // small hack for the test
        final Field preventSynch = TimerData.class.getDeclaredField("synchronizationRegistered");
        preventSynch.setAccessible(true);
        preventSynch.set(data, true);
        data.newTimer();

        final AbstractTrigger<?> trigger = (AbstractTrigger<?>) data.getTrigger();
        trigger.setJobName("my-job");
        trigger.setJobGroup("my-group");

        final JobDataMap triggerDataMap = trigger.getJobDataMap();
        triggerDataMap.put(EjbTimeoutJob.EJB_TIMERS_SERVICE, timerService);
View Full Code Here

    public static CalendarTimerData timerData() throws Exception {
        final BeanContext context = SystemInstance.get().getComponent(ContainerSystem.class).getBeanContext("EJBWithTimer");
        final EjbTimerService timer = context.getEjbTimerService();
        final MethodContext ctx = context.getMethodContext(EJBWithTimer.class.getMethod("doSthg"));
        final ScheduleData sd = ctx.getSchedules().iterator().next();
        return new CalendarTimerData(1, (EjbTimerServiceImpl) timer, context.getDeploymentID().toString(), null, ctx.getBeanMethod(), sd.getConfig(), sd.getExpression(), false);
    }
View Full Code Here

        assertEqualsByReflection(timer, timerDeserialized, "retryAttempts");
    }

    @Test
    public void serializationOfCalendarData() throws Exception {
        final CalendarTimerData data = timerData();

        final byte[] serial = serialize(data);
        final CalendarTimerData dataDeserialized = (CalendarTimerData) deserialize(serial);

        assertThat(dataDeserialized, instanceOf(CalendarTimerData.class));

        assertEqualsByReflection(data, dataDeserialized, "id");
        assertEqualsByReflection(data, dataDeserialized, "deploymentId");
View Full Code Here

TOP

Related Classes of org.apache.openejb.core.timer.CalendarTimerData

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.