- Timestamp:
- 06/20/11 14:16:53 (13 years ago)
- Location:
- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/DaoTests.cs
r6431 r6452 70 70 plugin1.UserId = Guid.Empty; 71 71 plugin1.DateCreated = DateTime.Now; 72 plugin1.Hash = new byte[] { 1, 2, 3 }; 72 73 73 74 DT.PluginData pluginData1 = new DT.PluginData(); … … 135 136 Assert.AreEqual(null, dao.GetJobData(job1.Id)); 136 137 Assert.AreEqual(null, dao.GetHiveExperiment(he.Id)); 138 139 dao.DeletePlugin(plugin1.Id); 140 Assert.AreEqual(null, dao.GetPlugin(plugin1.Id)); 137 141 } 138 142 … … 177 181 plugin1.Version = new Version("1.0.0.0"); 178 182 plugin1.UserId = Guid.Empty; 183 plugin1.Hash = new byte[] { 1, 2, 3 }; 179 184 180 185 plugin1.Id = dao.AddPlugin(plugin1); … … 186 191 Assert.AreEqual(plugin1.UserId, plugin1loaded.UserId); 187 192 Assert.AreEqual(plugin1.DateCreated.ToString(), plugin1loaded.DateCreated.ToString()); 193 Assert.IsTrue(plugin1.Hash.SequenceEqual(plugin1loaded.Hash)); 188 194 189 195 DT.PluginData pluginData1 = new DT.PluginData(); -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/Mocks/MockLifecycleManager.cs
r6372 r6452 20 20 #endregion 21 21 22 23 22 namespace HeuristicLab.Services.Hive.Tests.Mocks { 24 23 public class MockLifecycleManager : ILifecycleManager { -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/Mocks/MockServiceLocator.cs
r6431 r6452 44 44 45 45 public ILifecycleManager LifecycleManager { 46 get { 47 return defaultServiceLocator.LifecycleManager; 48 } 46 get { return defaultServiceLocator.LifecycleManager; } 47 } 48 public ITransactionManager TransactionManager { 49 get { return defaultServiceLocator.TransactionManager; } 49 50 } 50 51 51 52 public HeartbeatManager HeartbeatManager { 52 get { 53 return defaultServiceLocator.HeartbeatManager; 54 } 53 get { return defaultServiceLocator.HeartbeatManager; } 55 54 } 56 57 55 } 58 56 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/ServiceTests.cs
r6431 r6452 66 66 }; 67 67 68 // delete plugin first (otherwise the system would not allow it because of the same hash code 69 var hash = new byte[] { 1, 2, 3 }; 70 var p = service.GetPluginByHash(hash); 71 if (p != null) service.DeletePlugin(p.Id); 72 68 73 // create plugin 69 74 DT.Plugin plugin1 = new DT.Plugin(); … … 72 77 plugin1.UserId = Guid.Empty; 73 78 plugin1.DateCreated = DateTime.Now; 74 79 plugin1.Hash = hash; 80 75 81 DT.PluginData pluginData1 = new DT.PluginData(); 76 82 pluginData1.FileName = "Tests.MyPlugin-1.0.dll"; … … 167 173 Assert.AreEqual(job.Id, actions[0].JobId); 168 174 169 // create appointmentwhich should make slave unavailable for calculation170 Guid appointmentId = service.AddAppointment(new Appointment{ ResourceId = slave.Id, StartDate = DateTime.Now - TimeSpan.FromMinutes(1), EndDate = DateTime.Now + TimeSpan.FromMinutes(1), Recurring = false });175 // create downtime which should make slave unavailable for calculation 176 Guid downtimeId = service.AddDowntime(new Downtime { ResourceId = slave.Id, StartDate = DateTime.Now - TimeSpan.FromMinutes(1), EndDate = DateTime.Now + TimeSpan.FromMinutes(1), Recurring = false }); 171 177 172 178 progress.Clear(); … … 177 183 Assert.AreEqual(Guid.Empty, actions[0].JobId); 178 184 179 service.Delete Appointment(appointmentId);185 service.DeleteDowntime(downtimeId); 180 186 181 187 // delete
Note: See TracChangeset
for help on using the changeset viewer.