Refactoring

4.x.x
megala21 7 years ago
parent ca8f98e131
commit 461361ba2d

@ -90,6 +90,15 @@ public class DeviceTypeManagerTest {
if (resourceUrl != null) { if (resourceUrl != null) {
androidConfiguration = new File(resourceUrl.getFile()); androidConfiguration = new File(resourceUrl.getFile());
} }
datasourceField = DeviceTypeDAOHandler.class.getDeclaredField("dataSource");
datasourceField.setAccessible(true);
currentConnection = DeviceTypeDAOHandler.class.getDeclaredField("currentConnection");
currentConnection.setAccessible(true);
deviceTypePluginDAOField = DeviceTypePluginDAOManager.class.getDeclaredField("deviceTypePluginDAO");
deviceTypePluginDAOField.setAccessible(true);
deviceTypeDAOHandlerField = DeviceTypePluginDAOManager.class.getDeclaredField("deviceTypeDAOHandler");
deviceTypeDAOHandlerField.setAccessible(true);
DeviceTypeConfiguration androidDeviceConfiguration = Utils.getDeviceTypeConfiguration(androidConfiguration); DeviceTypeConfiguration androidDeviceConfiguration = Utils.getDeviceTypeConfiguration(androidConfiguration);
androidDeviceTypeManager = Mockito.mock(DeviceTypeManager.class, Mockito.CALLS_REAL_METHODS); androidDeviceTypeManager = Mockito.mock(DeviceTypeManager.class, Mockito.CALLS_REAL_METHODS);
customDeviceTypeManager = Mockito.mock(DeviceTypeManager.class, Mockito.CALLS_REAL_METHODS); customDeviceTypeManager = Mockito.mock(DeviceTypeManager.class, Mockito.CALLS_REAL_METHODS);
@ -108,15 +117,6 @@ public class DeviceTypeManagerTest {
Field deviceType = DeviceTypeManager.class.getDeclaredField("deviceType"); Field deviceType = DeviceTypeManager.class.getDeclaredField("deviceType");
deviceType.setAccessible(true); deviceType.setAccessible(true);
datasourceField = DeviceTypeDAOHandler.class.getDeclaredField("dataSource");
datasourceField.setAccessible(true);
currentConnection = DeviceTypeDAOHandler.class.getDeclaredField("currentConnection");
currentConnection.setAccessible(true);
deviceTypePluginDAOField = DeviceTypePluginDAOManager.class.getDeclaredField("deviceTypePluginDAO");
deviceTypePluginDAOField.setAccessible(true);
deviceTypeDAOHandlerField = DeviceTypePluginDAOManager.class.getDeclaredField("deviceTypeDAOHandler");
deviceTypeDAOHandlerField.setAccessible(true);
deviceType.set(androidDeviceTypeManager, androidDeviceType); deviceType.set(androidDeviceTypeManager, androidDeviceType);
propertiesExist.set(androidDeviceTypeManager, true); propertiesExist.set(androidDeviceTypeManager, true);
createAndroidDevice(); createAndroidDevice();

@ -106,7 +106,6 @@ public class Utils {
dataSource.setUser("sa"); dataSource.setUser("sa");
dataSource.setPassword("sa"); dataSource.setPassword("sa");
File file = new File(scriptFilePath); File file = new File(scriptFilePath);
final String LOAD_DATA_QUERY = "RUNSCRIPT FROM '" + file.getCanonicalPath() + "'"; final String LOAD_DATA_QUERY = "RUNSCRIPT FROM '" + file.getCanonicalPath() + "'";

Loading…
Cancel
Save