Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/21/10 19:28:29 (14 years ago)
Author:
ascheibe
Message:

Adapt test cases to slave - client communication. #1233

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests/SlaveTest.cs

    r5156 r5158  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using System.ServiceModel;
    2526using HeuristicLab.Clients.Common;
    2627using HeuristicLab.Services.Hive.Common;
     
    3334  public class SlaveTest {
    3435
     36    private static ServiceHost slaveComm;
     37    private static SlaveCommListener listener;
     38
    3539    // Use ClassInitialize to run code before running the first test in the class
    3640    [ClassInitialize]
     
    3842      PluginLoader.pluginAssemblies.Any();
    3943      ServiceLocator.Instance = new MockServiceLocator();
    40     }
     44      slaveComm = new ServiceHost(typeof(SlaveCommunicationService));
     45      slaveComm.Open();
     46      listener = new SlaveCommListener();
     47      listener.Open();
     48    }
     49
     50    [ClassCleanup]
     51    public static void MyClassCleanup() {
     52      listener.Close();
     53      slaveComm.Close();
     54    }
     55
    4156
    4257    private List<List<MessageContainer>> CreateMsgsForSingleJob() {
     
    4863
    4964      //do nothing
     65      msg = new List<MessageContainer>();
     66      allMsgs.Add(msg);
    5067      msg = new List<MessageContainer>();
    5168      allMsgs.Add(msg);
     
    6885      List<Job> jobList = new List<Job>();
    6986      jobList.Add(testJob);
    70       MockJob job = new MockJob(400, false);
     87      MockJob job = new MockJob(300, false);
    7188
    7289      using (Disposable<IHiveService> service = ServiceLocator.Instance.GetService()) {
     
    7491        ((MockHiveService)service.Obj).Messages = CreateMsgsForSingleJob();
    7592        ((MockHiveService)service.Obj).updateJobs(jobList, job);
    76 
    7793
    7894        HeuristicLab.Clients.Hive.Salve.Core core = new Salve.Core();
Note: See TracChangeset for help on using the changeset viewer.