Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/03/11 14:18:29 (14 years ago)
Author:
ascheibe
Message:

#1233

  • rename 'Slave' namespace to 'SlaveCore' (and assemblies etc) to avoid problems with 'Slave' class
  • use svcutil (OKB-style)
Location:
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests
Files:
8 edited

Legend:

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

    r5404 r5599  
    1010    <OutputType>Library</OutputType>
    1111    <AppDesignerFolder>Properties</AppDesignerFolder>
    12     <RootNamespace>HeuristicLab.Clients.Hive.Slave.Tests</RootNamespace>
     12    <RootNamespace>HeuristicLab.Clients.Hive.SlaveCore.Tests</RootNamespace>
    1313    <AssemblyName>HeuristicLab.Clients.Hive.Slave.Tests-3.4</AssemblyName>
    1414    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
     
    330330    </Reference>
    331331    <Reference Include="System.Drawing" />
     332    <Reference Include="System.Runtime.Serialization" />
    332333    <Reference Include="System.ServiceModel" />
    333334    <Reference Include="WeifenLuo.WinFormsUI.Docking-2.3.1">
     
    362363      <Name>HeuristicLab.Hive-3.4</Name>
    363364    </ProjectReference>
    364     <ProjectReference Include="..\HeuristicLab.Services.Hive.Common\3.4\HeuristicLab.Services.Hive.Common-3.4.csproj">
    365       <Project>{14424A16-48D4-445E-80BF-DDF617548BBB}</Project>
    366       <Name>HeuristicLab.Services.Hive.Common-3.4</Name>
    367     </ProjectReference>
    368365    <ProjectReference Include="..\HeuristicLab.Services.Hive\3.4\HeuristicLab.Services.Hive-3.4.csproj">
    369366      <Project>{CF9DA321-AC1B-4FD3-9EC3-67BC6B861BDE}</Project>
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests/Mocks/MockHiveService.cs

    r5593 r5599  
    2626using HeuristicLab.PluginInfrastructure;
    2727using HeuristicLab.PluginInfrastructure.Manager;
    28 using HeuristicLab.Services.Hive.Common;
    29 using HeuristicLab.Services.Hive.Common.DataTransfer;
    30 using HeuristicLab.Services.Hive.Common.ServiceContracts;
    31 
    32 namespace HeuristicLab.Clients.Hive.Slave.Tests {
     28
     29namespace HeuristicLab.Clients.Hive.SlaveCore.Tests {
    3330  internal class MockHiveService : IHiveService {
    3431    private static List<Job> jobs;
    3532    private static List<JobData> jobDatas;
    36     private static List<HeuristicLab.Services.Hive.Common.DataTransfer.HiveExperiment> hiveExperiments;
     33    private static List<HiveExperiment> hiveExperiments;
    3734    private static List<Plugin> plugins = null;
    3835    public List<Job> ResultJobs { get; set; }
    3936    public List<JobData> ResultJobDatas { get; set; }
    40     private static IEnumerable<PluginDescription> pDescs = null;
     37    private static List<PluginDescription> pDescs = null;
    4138    private static int cnt = 0;
    4239
     
    8279      }
    8380
    84       hiveExperiments = new List<HeuristicLab.Services.Hive.Common.DataTransfer.HiveExperiment>();
    85       hiveExperiments.Add(new HeuristicLab.Services.Hive.Common.DataTransfer.HiveExperiment() { Id = Guid.NewGuid(), Name = "Hive Exp 1", Description = "", RootJobId = jobs[0].Id });
     81      hiveExperiments = new List<HiveExperiment>();
     82      hiveExperiments.Add(new HiveExperiment() { Id = Guid.NewGuid(), Name = "Hive Exp 1", Description = "", RootJobId = jobs[0].Id });
    8683
    8784      ResultJobDatas = new List<JobData>();
     
    9289      PluginManager pm = new PluginManager(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "PluginCacheServer"));
    9390      pm.DiscoverAndCheckPlugins();
    94       pDescs = pm.Plugins;
     91      pDescs = pm.Plugins.ToList();
    9592      plugins = new List<Plugin>();
    9693      foreach (PluginDescription d in pDescs) {
     
    106103
    107104    #region Job Methods
    108     public Guid AddJob(Job job, JobData jobData, IEnumerable<Guid> slaveGroupIds) {
     105    public Guid AddJob(Job job, JobData jobData, List<Guid> slaveGroupIds) {
    109106      job.Id = Guid.NewGuid();
    110107      jobData.JobId = job.Id;
     
    136133    }
    137134
    138     public IEnumerable<Job> GetJobs() {
     135    public List<Job> GetJobs() {
    139136      return jobs;
    140137    }
    141138
    142     public IEnumerable<LightweightJob> GetLightweightJobs(IEnumerable<Guid> jobIds) {
    143       return jobs.Select(j => new LightweightJob(j)); // not real
    144     }
    145 
    146     public IEnumerable<LightweightJob> GetLightweightChildJobs(Guid? parentJobId, bool recursive, bool includeParent) {
    147       return jobs.Where(j => j.ParentJobId.HasValue).Select(j => new LightweightJob(j));
     139    public List<LightweightJob> GetLightweightJobs(List<Guid> jobIds) {
     140      return jobs.Select(j => new LightweightJob(j)).ToList(); // not real
     141    }
     142
     143    public List<LightweightJob> GetLightweightChildJobs(Guid? parentJobId, bool recursive, bool includeParent) {
     144      return jobs.Where(j => j.ParentJobId.HasValue).Select(j => new LightweightJob(j)).ToList();
    148145    }
    149146
     
    196193
    197194    #region HiveExperiment Methods
    198     public HeuristicLab.Services.Hive.Common.DataTransfer.HiveExperiment GetHiveExperiment(Guid id) {
     195    public HiveExperiment GetHiveExperiment(Guid id) {
    199196      return hiveExperiments.Where(he => he.Id == id).SingleOrDefault();
    200197    }
    201198
    202     public IEnumerable<HeuristicLab.Services.Hive.Common.DataTransfer.HiveExperiment> GetHiveExperiments() {
     199    public List<HiveExperiment> GetHiveExperiments() {
    203200      return hiveExperiments;
    204201    }
    205202
    206     public Guid AddHiveExperiment(HeuristicLab.Services.Hive.Common.DataTransfer.HiveExperiment hiveExperimentDto) {
     203    public Guid AddHiveExperiment(HiveExperiment hiveExperimentDto) {
    207204      hiveExperimentDto.Id = Guid.NewGuid();
    208205      hiveExperiments.Add(hiveExperimentDto);
     
    210207    }
    211208
    212     public void UpdateHiveExperiment(HeuristicLab.Services.Hive.Common.DataTransfer.HiveExperiment hiveExperimentDto) {
     209    public void UpdateHiveExperiment(HiveExperiment hiveExperimentDto) {
    213210      // do nothing
    214211    }
     
    220217
    221218    #region Login Methods
    222     public void Hello(HeuristicLab.Services.Hive.Common.DataTransfer.Slave slaveInfo) {
     219    public void Hello(Slave slaveInfo) {
    223220      // do nothing
    224221    }
     
    257254    }
    258255
    259     public IEnumerable<Plugin> GetPlugins() {
     256    public List<Plugin> GetPlugins() {
    260257      if (plugins == null)
    261258        plugins = ReadPluginsFromServerCache();
     
    263260    }
    264261
    265     public IEnumerable<PluginData> GetPluginDatas(List<Guid> pluginIds) {
     262    public List<PluginData> GetPluginDatas(List<Guid> pluginIds) {
    266263      List<PluginData> pluginDatas = new List<PluginData>();
    267264
     
    286283
    287284    #region Slave Methods
    288     public Guid AddSlave(Services.Hive.Common.DataTransfer.Slave slave) {
     285    public Guid AddSlave(Slave slave) {
    289286      throw new NotImplementedException();
    290287    }
     
    294291    }
    295292
    296     public Services.Hive.Common.DataTransfer.Slave GetSlave(Guid slaveId) {
     293    public Slave GetSlave(Guid slaveId) {
    297294      throw new NotImplementedException();
    298295    }
     
    302299    }
    303300
    304     public IEnumerable<Services.Hive.Common.DataTransfer.Slave> GetSlaves() {
    305       throw new NotImplementedException();
    306     }
    307 
    308     public IEnumerable<SlaveGroup> GetSlaveGroups() {
    309       throw new NotImplementedException();
    310     }
    311 
    312     public void UpdateSlave(Services.Hive.Common.DataTransfer.Slave slave) {
     301    public List<Slave> GetSlaves() {
     302      throw new NotImplementedException();
     303    }
     304
     305    public List<SlaveGroup> GetSlaveGroups() {
     306      throw new NotImplementedException();
     307    }
     308
     309    public void UpdateSlave(Slave slave) {
    313310      throw new NotImplementedException();
    314311    }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests/Mocks/MockJob.cs

    r5450 r5599  
    2929using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3030
    31 namespace HeuristicLab.Clients.Hive.Slave.Tests {
     31namespace HeuristicLab.Clients.Hive.SlaveCore.Tests {
    3232  [Item("Mock Job", "Represents mocked Job which just SpinWaits.")]
    3333  [StorableClass]
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests/Mocks/MockServiceLocator.cs

    r5526 r5599  
    2121
    2222using System;
    23 using HeuristicLab.Services.Hive.Common.ServiceContracts;
    2423
    25 namespace HeuristicLab.Clients.Hive.Slave.Tests {
     24namespace HeuristicLab.Clients.Hive.SlaveCore.Tests {
    2625  public class MockServiceLocator : IServiceLocator {
    2726    private MockHiveService service;
     
    3837      set { password = value; }
    3938    }
    40    
     39
    4140    public IHiveService GetService() {
    4241      if (service == null)
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests/PluginLoader.cs

    r5156 r5599  
    2727using HeuristicLab.PluginInfrastructure;
    2828
    29 namespace HeuristicLab.Clients.Hive.Slave.Tests {
     29namespace HeuristicLab.Clients.Hive.SlaveCore.Tests {
    3030  internal static class PluginLoader {
    3131    public const string AssemblyExtension = ".dll";
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests/SlaveCommListener.cs

    r5314 r5599  
    2222using System;
    2323using System.ServiceModel;
    24 using HeuristicLab.Clients.Hive.Slave.ServiceContracts;
     24using HeuristicLab.Clients.Hive.SlaveCore.ServiceContracts;
    2525
    26 namespace HeuristicLab.Clients.Hive.Slave.Tests {
     26namespace HeuristicLab.Clients.Hive.SlaveCore.Tests {
    2727
    2828  /// <summary>
     
    5050    }
    5151
    52     public void OnStatusChanged(Slave.StatusCommons status) {
     52    public void OnStatusChanged(SlaveCore.StatusCommons status) {
    5353      System.Console.WriteLine("SlaveCommListener: " + status);
    5454    }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests/SlaveTest.cs

    r5526 r5599  
    2323using System.Collections.Generic;
    2424using System.Linq;
    25 using HeuristicLab.Services.Hive.Common;
    26 using HeuristicLab.Services.Hive.Common.DataTransfer;
    2725using Microsoft.VisualStudio.TestTools.UnitTesting;
    2826
    29 namespace HeuristicLab.Clients.Hive.Slave.Tests {
     27namespace HeuristicLab.Clients.Hive.SlaveCore.Tests {
    3028  [TestClass]
    3129  public class SlaveTest {
     
    8583        ((MockHiveService)service).updateJobs(jobList, job);
    8684
    87         HeuristicLab.Clients.Hive.Slave.Core core = new Slave.Core();
     85        HeuristicLab.Clients.Hive.SlaveCore.Core core = new SlaveCore.Core();
    8886        core.Start();
    8987
     
    124122
    125123
    126         HeuristicLab.Clients.Hive.Slave.Core core = new Slave.Core();
     124        HeuristicLab.Clients.Hive.SlaveCore.Core core = new SlaveCore.Core();
    127125        core.Start();
    128126      });
     
    188186
    189187
    190         HeuristicLab.Clients.Hive.Slave.Core core = new Slave.Core();
     188        HeuristicLab.Clients.Hive.SlaveCore.Core core = new SlaveCore.Core();
    191189        core.Start();
    192190        Assert.AreEqual<int>(2, ms.ResultJobs.Count);
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests/app.config

    r5158 r5599  
    44  <system.serviceModel>
    55    <services>
    6       <service name="HeuristicLab.Clients.Hive.Slave.SlaveCommunicationService">       
    7         <endpoint address="net.pipe://localhost/HeuristicLabSlaveCom" binding="netNamedPipeBinding" contract="HeuristicLab.Clients.Hive.Slave.ServiceContracts.ISlaveCommunication"/>
     6      <service name="HeuristicLab.Clients.Hive.SlaveCore.SlaveCommunicationService">
     7        <endpoint address="net.pipe://localhost/HeuristicLabSlaveCom"
     8          binding="netNamedPipeBinding" contract="HeuristicLab.Clients.Hive.SlaveCore.ServiceContracts.ISlaveCommunication" />
    89      </service>
    910    </services>
Note: See TracChangeset for help on using the changeset viewer.