Fix test failures

merge-requests/725/head
Pahansith 4 years ago
parent 0cbcd747d5
commit 2fa4a6167e

@ -46,13 +46,11 @@ import java.util.concurrent.Executors;
public class EventConfigurationProviderServiceImpl implements EventConfigurationProviderService { public class EventConfigurationProviderServiceImpl implements EventConfigurationProviderService {
private static final Log log = LogFactory.getLog(EventConfigurationProviderServiceImpl.class); private static final Log log = LogFactory.getLog(EventConfigurationProviderServiceImpl.class);
private final EventConfigDAO eventConfigDAO; private final EventConfigDAO eventConfigDAO;
private final ExecutorService executorService;
public EventConfigurationProviderServiceImpl() { public EventConfigurationProviderServiceImpl() {
eventConfigDAO = DeviceManagementDAOFactory.getEventConfigDAO(); eventConfigDAO = DeviceManagementDAOFactory.getEventConfigDAO();
EventOperationTaskConfiguration eventConfig = DeviceConfigurationManager.getInstance() EventOperationTaskConfiguration eventConfig = DeviceConfigurationManager.getInstance()
.getDeviceManagementConfig().getEventOperationTaskConfiguration(); .getDeviceManagementConfig().getEventOperationTaskConfiguration();
this.executorService = Executors.newFixedThreadPool(eventConfig.getPoolSize());
} }
@Override @Override
@ -251,6 +249,7 @@ public class EventConfigurationProviderServiceImpl implements EventConfiguration
List<Integer> groupIds) { List<Integer> groupIds) {
GeoFenceEventOperationManager geoFenceEventOperationManager = new GeoFenceEventOperationManager(eventType, tenantId, null); GeoFenceEventOperationManager geoFenceEventOperationManager = new GeoFenceEventOperationManager(eventType, tenantId, null);
EventOperationExecutor executor = geoFenceEventOperationManager.getEventOperationExecutor(groupIds, eventMeta); EventOperationExecutor executor = geoFenceEventOperationManager.getEventOperationExecutor(groupIds, eventMeta);
this.executorService.submit(executor); ExecutorService executorService = Executors.newFixedThreadPool(50);
executorService.submit(executor);
} }
} }

@ -32,13 +32,4 @@ public class EventOperationTaskConfiguration {
public void setEnabled(boolean enabled) { public void setEnabled(boolean enabled) {
this.isEnabled = enabled; this.isEnabled = enabled;
} }
@XmlElement(name = "PoolSize", required = true)
public int getPoolSize() {
return poolSize;
}
public void setPoolSize(int poolSize) {
this.poolSize = poolSize;
}
} }

@ -66,7 +66,6 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
private final GroupDAO groupDAO; private final GroupDAO groupDAO;
private final DeviceDAO deviceDAO; private final DeviceDAO deviceDAO;
private final ExecutorService executorService;
/** /**
* Set groupDAO from GroupManagementDAOFactory when class instantiate. * Set groupDAO from GroupManagementDAOFactory when class instantiate.
@ -74,9 +73,6 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
public GroupManagementProviderServiceImpl() { public GroupManagementProviderServiceImpl() {
this.groupDAO = GroupManagementDAOFactory.getGroupDAO(); this.groupDAO = GroupManagementDAOFactory.getGroupDAO();
this.deviceDAO = DeviceManagementDAOFactory.getDeviceDAO(); this.deviceDAO = DeviceManagementDAOFactory.getDeviceDAO();
EventOperationTaskConfiguration eventConfig = DeviceConfigurationManager.getInstance()
.getDeviceManagementConfig().getEventOperationTaskConfiguration();
this.executorService = Executors.newFixedThreadPool(eventConfig.getPoolSize());
} }
/** /**
@ -1072,6 +1068,7 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
GeoFenceEventOperationManager eventManager = new GeoFenceEventOperationManager(eventOperationCode, tenantId, null); GeoFenceEventOperationManager eventManager = new GeoFenceEventOperationManager(eventOperationCode, tenantId, null);
GroupAssignmentEventOperationExecutor eventOperationExecutor = eventManager GroupAssignmentEventOperationExecutor eventOperationExecutor = eventManager
.getGroupAssignmentEventExecutor(groupId, deviceIdentifiers); .getGroupAssignmentEventExecutor(groupId, deviceIdentifiers);
ExecutorService executorService = Executors.newFixedThreadPool(50);
if (eventOperationExecutor != null) { if (eventOperationExecutor != null) {
executorService.submit(eventOperationExecutor); executorService.submit(eventOperationExecutor);
} else { } else {

@ -97,6 +97,9 @@
server environment--> server environment-->
<Capacity>10000</Capacity> <Capacity>10000</Capacity>
</GeoFenceCacheConfiguration> </GeoFenceCacheConfiguration>
<EventOperationTaskConfiguration>
<Enable>true</Enable>
</EventOperationTaskConfiguration>
<CertificateCacheConfiguration> <CertificateCacheConfiguration>
<Enable>false</Enable> <Enable>false</Enable>
<ExpiryTime>86400</ExpiryTime> <ExpiryTime>86400</ExpiryTime>

@ -121,6 +121,9 @@
<GeoLocationConfiguration> <GeoLocationConfiguration>
<Enabled>false</Enabled> <Enabled>false</Enabled>
</GeoLocationConfiguration> </GeoLocationConfiguration>
<EventOperationTaskConfiguration>
<Enable>true</Enable>
</EventOperationTaskConfiguration>
<OperationAnalyticsConfiguration> <OperationAnalyticsConfiguration>
<PublishLocationResponse>false</PublishLocationResponse> <PublishLocationResponse>false</PublishLocationResponse>
<PublishDeviceInfoResponse>false</PublishDeviceInfoResponse> <PublishDeviceInfoResponse>false</PublishDeviceInfoResponse>

@ -96,8 +96,6 @@
</GeoFenceCacheConfiguration> </GeoFenceCacheConfiguration>
<EventOperationTaskConfiguration> <EventOperationTaskConfiguration>
<Enable>true</Enable> <Enable>true</Enable>
<!-- Event operation creation thread pool size -->
<PoolSize>50</PoolSize>
</EventOperationTaskConfiguration> </EventOperationTaskConfiguration>
<CertificateCacheConfiguration> <CertificateCacheConfiguration>
<Enable>true</Enable> <Enable>true</Enable>

Loading…
Cancel
Save