Add missing test cases for DevicePersistTests and GroupPersistTests #408
Merged
tcdlpds
merged 1 commits from pramilaniroshan/device-mgt-core:add-missing-test-cases
into master
8 months ago
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'pramilaniroshan/device-mgt-core:add-missing-test-cases'
Deleting a branch is permanent. It CANNOT be undone. Continue?
https://roadmap.entgra.net/issues/11282
Device device = TestDataHolder.initialTestDevice;
try {
DeviceManagementDAOFactory.beginTransaction();
Device results = deviceDAO.getDevice(device.getDeviceIdentifier(),TestDataHolder.SUPER_TENANT_ID);
Format the source
try {
DeviceManagementDAOFactory.beginTransaction();
DeviceIdentifier deviceIdentifier = new DeviceIdentifier(device.getDeviceIdentifier(), device.getType());
Device results = deviceDAO.getDevice(deviceIdentifier,TestDataHolder.SUPER_TENANT_ID);
Format the source
DeviceIdentifier deviceIdentifier = new DeviceIdentifier(device.getDeviceIdentifier(), device.getType());
try {
DeviceManagementDAOFactory.beginTransaction();
Device results = deviceDAO.getDevice(deviceIdentifier,TestDataHolder.OWNER, TestDataHolder.SUPER_TENANT_ID);
Format the source
pr.setDeviceType(device.getType());
try {
DeviceManagementDAOFactory.beginTransaction();
List<Device> results = deviceDAO.getAppNotInstalledDevices(pr, TestDataHolder.SUPER_TENANT_ID,"com.google.calc" ,"1.0.0");
Format the source
pr.setDeviceType(device.getType());
try {
DeviceManagementDAOFactory.beginTransaction();
int results = deviceDAO.getCountOfAppNotInstalledDevices(pr, TestDataHolder.SUPER_TENANT_ID,"com.google.calc" ,"1.0.0");
Format the source
PaginationRequest pr = new PaginationRequest(0, 10);
try {
DeviceManagementDAOFactory.beginTransaction();
List<Device> results = deviceDAO.getDevicesByEncryptionStatus(pr, TestDataHolder.SUPER_TENANT_ID,false);
Format the source
public void getCountOfDevicesByEncryptionStatus() throws DeviceManagementDAOException, TransactionManagementException {
try {
DeviceManagementDAOFactory.beginTransaction();
int results = deviceDAO.getCountOfDevicesByEncryptionStatus(TestDataHolder.SUPER_TENANT_ID,true);
Format the source
GroupManagementDAOFactory.beginTransaction();
groupDAO.getAllDevicesOfGroup(deviceGroup.getName(), deviceStatus, TestDataHolder.SUPER_TENANT_ID);
GroupManagementDAOFactory.commitTransaction();
GroupManagementDAOFactory.closeConnection();
move the close connection into finally block
GroupManagementDAOFactory.beginTransaction();
groupDAO.getAllDevicesOfGroup(deviceGroup.getName(), TestDataHolder.SUPER_TENANT_ID);
GroupManagementDAOFactory.commitTransaction();
GroupManagementDAOFactory.closeConnection();
Move the close connection into finally block. Check in catch blocks as well.
GroupManagementDAOFactory.beginTransaction();
groupDAO.getGroupUnassignedDevices(pr, groupNames);
GroupManagementDAOFactory.commitTransaction();
GroupManagementDAOFactory.closeConnection();
Move the close connection into finally block.
GroupManagementDAOFactory.beginTransaction();
groupDAO.getOwnGroups(TestDataHolder.OWNER, TestDataHolder.SUPER_TENANT_ID);
GroupManagementDAOFactory.commitTransaction();
GroupManagementDAOFactory.closeConnection();
Move the close connection into finally block.
GroupManagementDAOFactory.beginTransaction();
groupDAO.getOwnGroupIds(TestDataHolder.OWNER, TestDataHolder.SUPER_TENANT_ID);
GroupManagementDAOFactory.commitTransaction();
GroupManagementDAOFactory.closeConnection();
Move the close connection into finally block
GroupManagementDAOFactory.beginTransaction();
groupDAO.getDeviceCount(deviceGroup.getGroupId(), TestDataHolder.SUPER_TENANT_ID);
GroupManagementDAOFactory.commitTransaction();
GroupManagementDAOFactory.closeConnection();
Move the close connection into finally block and check all the methods in this file and do the modifications.
} catch (GroupManagementDAOException e) {
GroupManagementDAOFactory.rollbackTransaction();
GroupManagementDAOFactory.closeConnection();
String msg = "Error occurred while getting group count for '" +TestDataHolder.SUPER_TENANT_ID+ "'.";
Format the source
} catch (GroupManagementDAOException e) {
GroupManagementDAOFactory.rollbackTransaction();
GroupManagementDAOFactory.closeConnection();
String msg = "Error occurred while getting group count for '" +TestDataHolder.SUPER_TENANT_ID+ "'.";
Format the source
} catch (GroupManagementDAOException e) {
GroupManagementDAOFactory.rollbackTransaction();
GroupManagementDAOFactory.closeConnection();
String msg = "Error occurred while getting groups for '" +TestDataHolder.SUPER_TENANT_ID+ "'.";
Format the source
178b249c04
tod443fef6e0
8 months agoe84a479c23
into master 8 months agoReviewers
e84a479c23
.