Opened 14 years ago
Closed 14 years ago
#1431 closed enhancement (done)
Possibility to setup a plugin environment in code
Reported by: | cneumuel | Owned by: | gkronber |
---|---|---|---|
Priority: | medium | Milestone: | HeuristicLab 3.3.4 |
Component: | PluginInfrastructure | Version: | 3.3.4 |
Keywords: | Cc: | gkronber |
Description
For testing purposes it should be possible to set up an environment where all plugins are loaded as if HL was started, without actually starting it. This can be convenient for testing and development purposes.
An application should be useable like this:
class Program { static void Main(string[] args) { PluginManager pm = new PluginManager(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)); pm.DiscoverAndCheckPlugins(); pm.Run(pm.Applications.Where(x => x.Name == "TestApp").SingleOrDefault()); } } [Plugin("TestPlugin", "1.0.0.0")] [PluginFile("HeuristicLab.MetaOptimization.Test.exe", PluginFileType.Assembly)] public class TestPlugin : PluginBase { } [Application("TestApp")] public class TestApp : ApplicationBase { public override void Run() { // in here, all plugins are loaded and can be discovered var items = ApplicationManager.Manager.GetInstances<IItem>(); } }
Therefore visibility changes in PluginManager and ApplicationDescription are required. Also exe-files need to be discovered as plugins by the PluginManager.
Change History (5)
comment:1 Changed 14 years ago by cneumuel
- Status changed from new to accepted
comment:2 Changed 14 years ago by cneumuel
- Owner changed from cneumuel to gkronber
- Status changed from accepted to reviewing
comment:3 Changed 14 years ago by gkronber
- Status changed from reviewing to readytorelease
comment:4 Changed 14 years ago by gkronber
- Milestone changed from HeuristicLab Backlog to HeuristicLab 3.3.4
comment:5 Changed 14 years ago by swagner
- Resolution set to done
- Status changed from readytorelease to closed
- Version changed from 3.3.3 to 3.3.4
Note: See
TracTickets for help on using
tickets.
fixed in r5652