Last change
on this file since 5533 was
5095,
checked in by cneumuel, 14 years ago
|
#1233
- fixed config merge process
- worked on hive server test setup
|
File size:
1.2 KB
|
Rev | Line | |
---|
[5078] | 1 | using System;
|
---|
| 2 | using System.Text;
|
---|
| 3 | using System.Collections.Generic;
|
---|
| 4 | using System.Linq;
|
---|
| 5 | using Microsoft.VisualStudio.TestTools.UnitTesting;
|
---|
[5095] | 6 | using HeuristicLab.Services.Hive.Common.DataTransfer;
|
---|
| 7 | using HeuristicLab.Services.Hive.Common.ServiceContracts;
|
---|
| 8 | using HeuristicLab.Clients.Hive.Slave.Tests;
|
---|
| 9 | using HeuristicLab.Clients.Hive;
|
---|
[5078] | 10 |
|
---|
| 11 | namespace HeuristicLab.Services.Hive.Tests {
|
---|
| 12 | [TestClass]
|
---|
| 13 | public class ServerTest {
|
---|
| 14 |
|
---|
| 15 | [ClassInitialize]
|
---|
| 16 | public static void MyClassInitialize(TestContext testContext) {
|
---|
| 17 | PluginLoader.pluginAssemblies.Any();
|
---|
[5095] | 18 | ServiceLocator.Instance = new MockServiceLocator(ServiceLocator.Instance);
|
---|
[5078] | 19 | }
|
---|
[5095] | 20 |
|
---|
| 21 | private IHiveService GetService() {
|
---|
| 22 | return new HiveService();
|
---|
| 23 | }
|
---|
[5078] | 24 |
|
---|
| 25 | [TestMethod]
|
---|
| 26 | public void TestMethod1() {
|
---|
[5095] | 27 | var service = GetService();
|
---|
| 28 |
|
---|
| 29 | Job job = new Job() {
|
---|
| 30 | CoresNeeded = 1,
|
---|
| 31 | MemoryNeeded = 0,
|
---|
| 32 | Priority = 0
|
---|
| 33 | };
|
---|
| 34 |
|
---|
| 35 | JobData jobData = new JobData() {
|
---|
| 36 | Data = PersistenceUtil.Serialize(new MockJob(500))
|
---|
| 37 | };
|
---|
| 38 |
|
---|
| 39 | Guid jobId = service.AddJob(job, jobData);
|
---|
| 40 |
|
---|
| 41 | Job newJob = service.GetJob(jobId);
|
---|
| 42 | Assert.AreEqual(job, newJob);
|
---|
[5078] | 43 | }
|
---|
| 44 | }
|
---|
| 45 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.