Free cookie consent management tool by TermsFeed Policy Generator

Changeset 5158


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

Adapt test cases to slave - client communication. #1233

Location:
branches/HeuristicLab.Hive-3.4/sources
Files:
2 added
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.ConsoleClient-3.4/HeuristicLab.Clients.Hive.Slave.ConsoleClient-3.4.csproj

    r5156 r5158  
    5858    <Compile Include="Program.cs" />
    5959    <Compile Include="Properties\AssemblyInfo.cs" />
    60     <Compile Include="SlaveCommListener.cs" />
    6160  </ItemGroup>
    6261  <ItemGroup>
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests/HeuristicLab.Clients.Hive.Slave.Tests-3.4.csproj

    r5062 r5158  
    298298    </Reference>
    299299    <Reference Include="System.Drawing" />
     300    <Reference Include="System.ServiceModel" />
    300301    <Reference Include="WeifenLuo.WinFormsUI.Docking-2.3.1">
    301302      <HintPath>..\..\..\..\..\..\Program Files\HeuristicLab 3.3\WeifenLuo.WinFormsUI.Docking-2.3.1.dll</HintPath>
     
    313314    <Compile Include="Properties\AssemblyInfo.cs" />
    314315    <Compile Include="Mocks\MockServiceLocator.cs" />
     316    <Compile Include="SlaveCommListener.cs" />
    315317    <Compile Include="SlaveTest.cs" />
    316318  </ItemGroup>
     
    333335    </ProjectReference>
    334336  </ItemGroup>
     337  <ItemGroup>
     338    <None Include="app.config" />
     339  </ItemGroup>
    335340  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
    336341  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
  • 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();
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Core.cs

    r5156 r5158  
    8282
    8383      DeRegisterServiceEvents();
    84 
    85       ClientCom.LogMessage("Program shutdown");
    8684    }
    8785
Note: See TracChangeset for help on using the changeset viewer.