1 | #region License Information
|
---|
2 | /* HeuristicLab
|
---|
3 | * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
|
---|
4 | *
|
---|
5 | * This file is part of HeuristicLab.
|
---|
6 | *
|
---|
7 | * HeuristicLab is free software: you can redistribute it and/or modify
|
---|
8 | * it under the terms of the GNU General Public License as published by
|
---|
9 | * the Free Software Foundation, either version 3 of the License, or
|
---|
10 | * (at your option) any later version.
|
---|
11 | *
|
---|
12 | * HeuristicLab is distributed in the hope that it will be useful,
|
---|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
15 | * GNU General Public License for more details.
|
---|
16 | *
|
---|
17 | * You should have received a copy of the GNU General Public License
|
---|
18 | * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
|
---|
19 | */
|
---|
20 | #endregion
|
---|
21 |
|
---|
22 | using System;
|
---|
23 | using System.Linq;
|
---|
24 | using HeuristicLab.Services.Hive.Common.ServiceContracts;
|
---|
25 | using Microsoft.VisualStudio.TestTools.UnitTesting;
|
---|
26 | using HeuristicLab.Clients.Hive.Slave.Tests;
|
---|
27 | using HeuristicLab.Clients.Hive.Jobs;
|
---|
28 | using HeuristicLab.Algorithms.GeneticAlgorithm;
|
---|
29 | using HeuristicLab.Problems.TestFunctions;
|
---|
30 | using HeuristicLab.Optimization;
|
---|
31 | using HeuristicLab.Core;
|
---|
32 | using System.Threading;
|
---|
33 | using HeuristicLab.PluginInfrastructure.Manager;
|
---|
34 | using System.IO;
|
---|
35 | using System.Reflection;
|
---|
36 |
|
---|
37 | namespace HeuristicLab.Clients.Hive.Tests {
|
---|
38 | [TestClass]
|
---|
39 | public class ExperimentManagerTests {
|
---|
40 |
|
---|
41 |
|
---|
42 | [ClassInitialize]
|
---|
43 | public static void MyClassInitialize(TestContext testContext) {
|
---|
44 | //PluginLoader.pluginAssemblies.Any();
|
---|
45 | ServiceLocator.Instance = new MockServiceLocator();
|
---|
46 | }
|
---|
47 |
|
---|
48 | [TestMethod]
|
---|
49 | public void TestExperimentUpload() {
|
---|
50 | HiveExperimentClient hec = new HiveExperimentClient();
|
---|
51 | var optimizer = CreateOptimizer();
|
---|
52 | hec.HiveJob = new HiveJob(optimizer);
|
---|
53 |
|
---|
54 | hec.Start();
|
---|
55 |
|
---|
56 | while (hec.ExecutionState != ExecutionState.Stopped) {
|
---|
57 | Thread.Sleep(500);
|
---|
58 | }
|
---|
59 |
|
---|
60 | }
|
---|
61 |
|
---|
62 | private IOptimizer CreateOptimizer() {
|
---|
63 | var ga = new GeneticAlgorithm();
|
---|
64 | ga.Engine = new SequentialEngine.SequentialEngine();
|
---|
65 | ga.Problem = new SingleObjectiveTestFunctionProblem();
|
---|
66 | return ga;
|
---|
67 | }
|
---|
68 |
|
---|
69 | }
|
---|
70 | }
|
---|