Skip to content
Snippets Groups Projects
Commit 6a24db47 authored by srosse's avatar srosse
Browse files

no-jira: wording, enhance unit test

parent aaabadf1
No related branches found
No related tags found
No related merge requests found
...@@ -23,7 +23,7 @@ Contributors and copy right holders of openolat.org codebase since 2011: ...@@ -23,7 +23,7 @@ Contributors and copy right holders of openolat.org codebase since 2011:
Michael Enz, Christian Franck, Florian Gnägi, Roman Haag, Joël Krähemann, Matthai Kurian, Stéphane Rossé, Michael Enz, Christian Franck, Florian Gnägi, Roman Haag, Joël Krähemann, Matthai Kurian, Stéphane Rossé,
Kirsten Scherer, Sergio Trentini Kirsten Scherer, Sergio Trentini
- BPS Bildungsportal Sachsen GmbH, Germany [http://www.bildungsportal.sachsen.de]: - BPS Bildungsportal Sachsen GmbH, Germany [http://www.bildungsportal.sachsen.de]:
Armin Blawitzki, Stefan Köber, Sven Morgener Armin Blawitzki, Stefan Köber, Sven Morgner
- VCRP Virtueller Campus Rheinland-Pfalz [http://www.vcrp.de] - VCRP Virtueller Campus Rheinland-Pfalz [http://www.vcrp.de]
Stephan Clemenz Stephan Clemenz
- Rain and Hail Agricultural Insurance [http://www.rainhail.com] - Rain and Hail Agricultural Insurance [http://www.rainhail.com]
......
...@@ -32,7 +32,7 @@ Contributors and copy right holders of openolat.org codebase since 2011: ...@@ -32,7 +32,7 @@ Contributors and copy right holders of openolat.org codebase since 2011:
Michael Enz, Christian Franck, Florian Gnägi, Roman Haag, Joël Krähemann, Matthai Kurian, Stéphane Rossé, Michael Enz, Christian Franck, Florian Gnägi, Roman Haag, Joël Krähemann, Matthai Kurian, Stéphane Rossé,
Kirsten Scherer, Sergio Trentini Kirsten Scherer, Sergio Trentini
- BPS Bildungsportal Sachsen GmbH, Germany [http://www.bildungsportal.sachsen.de]: - BPS Bildungsportal Sachsen GmbH, Germany [http://www.bildungsportal.sachsen.de]:
Armin Blawitzki, Stefan Köber, Sven Morgener Armin Blawitzki, Stefan Köber, Sven Morgner
- VCRP Virtueller Campus Rheinland-Pfalz [http://www.vcrp.de] - VCRP Virtueller Campus Rheinland-Pfalz [http://www.vcrp.de]
Stephan Clemenz Stephan Clemenz
......
...@@ -70,7 +70,7 @@ no=Non ...@@ -70,7 +70,7 @@ no=Non
notifications.entry=Message "{0}" \u00E9tabli par {1} notifications.entry=Message "{0}" \u00E9tabli par {1}
notifications.entry.modified=Message "{0}" de {1} a \u00E9t\u00E9 modifi\u00E9 notifications.entry.modified=Message "{0}" de {1} a \u00E9t\u00E9 modifi\u00E9
notifications.header=Il y a des nouveaux messages dans un des forums que vous avez abonn\u00E9s\: notifications.header=Il y a des nouveaux messages dans un des forums que vous avez abonn\u00E9s\:
notifications.header.course=Formu dans le cours "{0}" notifications.header.course=Forum dans le cours "{0}"
notifications.header.group=Forum dans groupe "{0}" notifications.header.group=Forum dans groupe "{0}"
open.thread=Ouvrir discussion open.thread=Ouvrir discussion
reallydeleteAtt=Voulez-vous vraiment supprimer ce(s) fichier(s)? reallydeleteAtt=Voulez-vous vraiment supprimer ce(s) fichier(s)?
......
...@@ -65,16 +65,16 @@ ...@@ -65,16 +65,16 @@
</bean> </bean>
<bean id="acReservationCleanupJob" class="org.springframework.scheduling.quartz.SimpleTriggerBean"> <bean id="acReservationCleanupJob" class="org.springframework.scheduling.quartz.SimpleTriggerBean">
<property name="jobDetail"> <property name="jobDetail" ref="acReservationCleanupJobDetail"/>
<bean class="org.springframework.scheduling.quartz.JobDetailBean">
<property name="jobClass" value="org.olat.resource.accesscontrol.manager.ReservationsJob" />
</bean>
</property>
<!-- 60 seconds --> <!-- 60 seconds -->
<property name="repeatInterval" value="60000"/> <property name="repeatInterval" value="60000"/>
<property name="startDelay" value="30000" /> <property name="startDelay" value="30000" />
</bean> </bean>
<bean id="acReservationCleanupJobDetail" class="org.springframework.scheduling.quartz.JobDetailBean">
<property name="jobClass" value="org.olat.resource.accesscontrol.manager.ReservationsJob" />
</bean>
<bean id="acOfferManager" class="org.olat.resource.accesscontrol.manager.ACOfferManagerImpl"> <bean id="acOfferManager" class="org.olat.resource.accesscontrol.manager.ACOfferManagerImpl">
<property name="dbInstance" ref="database"/> <property name="dbInstance" ref="database"/>
</bean> </bean>
......
...@@ -26,10 +26,9 @@ import java.util.UUID; ...@@ -26,10 +26,9 @@ import java.util.UUID;
import junit.framework.Assert; import junit.framework.Assert;
import org.junit.After; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.olat.core.commons.persistence.DB; import org.olat.core.commons.persistence.DB;
import org.olat.core.commons.persistence.DBFactory;
import org.olat.core.id.Identity; import org.olat.core.id.Identity;
import org.olat.core.logging.OLog; import org.olat.core.logging.OLog;
import org.olat.core.logging.Tracing; import org.olat.core.logging.Tracing;
...@@ -38,6 +37,8 @@ import org.olat.resource.accesscontrol.manager.ACReservationDAO; ...@@ -38,6 +37,8 @@ import org.olat.resource.accesscontrol.manager.ACReservationDAO;
import org.olat.resource.accesscontrol.model.ResourceReservation; import org.olat.resource.accesscontrol.model.ResourceReservation;
import org.olat.test.JunitTestHelper; import org.olat.test.JunitTestHelper;
import org.olat.test.OlatTestCase; import org.olat.test.OlatTestCase;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
/** /**
...@@ -48,18 +49,19 @@ public class ACReservationDAOTest extends OlatTestCase { ...@@ -48,18 +49,19 @@ public class ACReservationDAOTest extends OlatTestCase {
private final OLog log = Tracing.createLoggerFor(ACReservationDAOTest.class); private final OLog log = Tracing.createLoggerFor(ACReservationDAOTest.class);
@Autowired
private Scheduler scheduler;
@Autowired @Autowired
private DB dbInstance; private DB dbInstance;
@Autowired @Autowired
private ACReservationDAO acReservationDao; private ACReservationDAO acReservationDao;
@After @Before
public void tearDown() throws Exception { public void interruptReservationJob() {
try { try {
DBFactory.getInstance().commitAndCloseSession(); scheduler.pauseJob("acReservationCleanupJobDetail", Scheduler.DEFAULT_GROUP);
} catch (Exception e) { } catch (SchedulerException e) {
log.error("Exception in tearDown(): " + e); log.error("Cannot intterupt the reservation job.", e);
throw e;
} }
} }
...@@ -156,7 +158,7 @@ public class ACReservationDAOTest extends OlatTestCase { ...@@ -156,7 +158,7 @@ public class ACReservationDAOTest extends OlatTestCase {
cal.add(Calendar.SECOND, -2); cal.add(Calendar.SECOND, -2);
Date date = cal.getTime(); Date date = cal.getTime();
List<ResourceReservation> oldReservations = acReservationDao.loadExpiredReservation(date); List<ResourceReservation> oldReservations = acReservationDao.loadExpiredReservation(date);
Assert.assertNotNull(oldReservations); Assert.assertNotNull("Old reservations cannot be null", oldReservations);
Assert.assertFalse(oldReservations.isEmpty()); Assert.assertFalse(oldReservations.isEmpty());
Assert.assertTrue(oldReservations.contains(reservation1)); Assert.assertTrue(oldReservations.contains(reservation1));
Assert.assertTrue(oldReservations.contains(reservation2)); Assert.assertTrue(oldReservations.contains(reservation2));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment