コード例 #1
0
        public static void Report(XDocument doc, IUnitTestLaunch launch, IEnumerable <Element> elements)
        {
            var testCases = Parse(doc);

            if (testCases == null)
            {
                return;
            }

            foreach (var element in elements.Flatten(x => x.Children.OfType <Element>()).OfType <JasmineSpecificationElement>())
            {
                var key = element.Id;
                if (!testCases.ContainsKey(key))
                {
                    continue;
                }

                var testCase = testCases[key];
                var task     = element.RemoteTask;

                if (testCase.Duration != null)
                {
                    launch.TaskDuration(task, testCase.Duration.Value);
                }
                launch.TaskFinished(task, testCase.Error, testCase.TaskResult);
            }
        }
コード例 #2
0
        public IRuntimeEnvironment GetRuntimeEnvironment(IUnitTestLaunch launch, IProject project, TargetFrameworkId targetFrameworkId,
                                                         IUnitTestElement element)
        {
            var targetPlatform = TargetPlatformCalculator.GetTargetPlatform(launch, project, targetFrameworkId);

            return(new UnityRuntimeEnvironment(targetPlatform));
        }
コード例 #3
0
 public override IList <UnitTestTask> GetTaskSequence(ICollection <IUnitTestElement> explicitElements,
                                                      IUnitTestLaunch launch)
 {
     return(RemoteTask.IfNotNull(x => new List <UnitTestTask>
     {
         new UnitTestTask(this, x)
     }));
 }
コード例 #4
0
 public RuntimeEnvironment GetRuntimeEnvironment(
     IUnitTestElement element,
     RuntimeEnvironment projectRuntimeEnvironment,
     TargetPlatform targetPlatform,
     IUnitTestLaunch launch)
 {
     return new RuntimeEnvironment { PlatformType = PlatformType.x86, PlatformVersion = PlatformVersion.v4_0 };
 }
コード例 #5
0
        public override ITaskRunnerHostController CreateHostController(IUnitTestLaunch launch)
        {
            var innerHostController = base.CreateHostController(launch);

            return(new UnityTaskRunnerHostController(innerHostController,
                                                     launch.Solution.GetComponent <IShellLocks>(),
                                                     launch.Solution.GetComponent <IUnityController>()));
        }
コード例 #6
0
        private static void CreateSilverlightSequence(IList <UnitTestTask> sequence, IUnitTestLaunch launch, UnitTestManager manager, IProject silverlightProject)
        {
            var silverlightRun = launch.GetOrCreateSilverlightRun(silverlightProject.PlatformID);

            sequence.AddSilverlightUnitTestTask(silverlightProject, manager);
            sequence.RemoveAssemblyLoadTasks();

            silverlightRun.AddTaskSequence(sequence);
        }
コード例 #7
0
        private static void CreateSilverlightSequence(IList<UnitTestTask> sequence, IUnitTestLaunch launch, UnitTestManager manager, IProject silverlightProject)
        {
            var silverlightRun = launch.GetOrCreateSilverlightRun(silverlightProject.PlatformID);

            sequence.AddSilverlightUnitTestTask(silverlightProject, manager);
            sequence.RemoveAssemblyLoadTasks();

            silverlightRun.AddTaskSequence(sequence);
        }
コード例 #8
0
        public static void RemoveEmptyRuns(this IUnitTestLaunch launch)
        {
            var runs      = launch.GetRuns();
            var emptyRuns = runs.Values.Where(run => !run.GetSequences().Any()).ToArray();

            foreach (var run in emptyRuns)
            {
                runs.Remove(run.ID);
            }
        }
コード例 #9
0
        public static RemoteTaskRunnerInfo GetTaskRunnerInfo(IUnitTestLaunch launch)
        {
            var runnerType = Assembly.LoadFrom(GetRunnerCodeBase()).GetType(RunnerTypeName);

            var additionalPaths = launch.Runs.SelectMany(r => r.GetAllTasks())
                .Select(t => t.Task.GetType().Assembly).Distinct()
                .Where(a => !a.FullName.StartsWith("JetBrains"))
                .Select(a => Path.GetDirectoryName(new Uri(a.CodeBase, UriKind.RelativeOrAbsolute).LocalPath))
                .ToArray();

            return new RemoteTaskRunnerInfo(RunnerId, runnerType, additionalPaths);
        }
コード例 #10
0
        public void Run(
            Lifetime lifetime,
            ITaskRunnerHostController runController,
            IUnitTestRun run,
            IUnitTestLaunch launch,
            Action continuation)
        {
            launch.EnsureSilverlightPlatformSupport(ref run, this.provider, runController);

            this.strategy = new OutOfProcessUnitTestRunStrategy(SilverlightUnitTestProvider.GetTaskRunnerInfo(launch));
            this.strategy.Run(lifetime, runController, run, launch, continuation);
        }
コード例 #11
0
        public static RemoteTaskRunnerInfo GetTaskRunnerInfo(IUnitTestLaunch launch)
        {
            var runnerType = Assembly.LoadFrom(GetRunnerCodeBase()).GetType(RunnerTypeName);

            var additionalPaths = launch.Runs.SelectMany(r => r.GetAllTasks())
                                  .Select(t => t.Task.GetType().Assembly).Distinct()
                                  .Where(a => !a.FullName.StartsWith("JetBrains"))
                                  .Select(a => Path.GetDirectoryName(new Uri(a.CodeBase, UriKind.RelativeOrAbsolute).LocalPath))
                                  .ToArray();

            return(new RemoteTaskRunnerInfo(RunnerId, runnerType, additionalPaths));
        }
コード例 #12
0
        private static void ConvertToSilverlightSequenceIfNecessary(IList<UnitTestTask> sequence, UnitTestRun run, IUnitTestLaunch launch, UnitTestManager manager)
        {
            if (!sequence.IsSilverlightSequence())
            {
                var requiredSilverlightPlatform = sequence.GetRequiredSilverlightPlatform();
                if (requiredSilverlightPlatform != null)
                {
                    run.GetSequences().Remove(sequence);

                    CreateSilverlightSequence(sequence, launch, manager, requiredSilverlightPlatform);
                }
            }
        }
コード例 #13
0
        public void Run(Lifetime lifetime, ITaskRunnerHostController runController, IUnitTestRun run, IUnitTestLaunch launch,
			Action continuation)
        {
            foreach (var project in run.Elements.OfType<Element>().GroupBy(x => x.ProjectFolder))
            {
                var projectFolder = project.Key;
                foreach (var set in project.GroupBy(x => x.IsE2E))
                {
                    KarmaTestRunner.Run(launch, projectFolder, set, set.Key);
                }
            }
            launch.Finished();
        }
コード例 #14
0
        private static void ConvertToSilverlightSequenceIfNecessary(IList<UnitTestTask> sequence, UnitTestRun run, IUnitTestLaunch launch, UnitTestManager manager)
        {
            if (!sequence.IsSilverlightSequence())
            {
                var silverlightProject = sequence.GetSilverlightProject();
                if (silverlightProject != null)
                {
                    run.GetSequences().Remove(sequence);

                    CreateSilverlightSequence(sequence, launch, manager, silverlightProject);
                }
            }
        }
コード例 #15
0
        private void SubscribeToLaunchState(Lifetime launchLifetime,
                                            IUnitTestSession session,
                                            IUnitTestLaunch unitTestLaunch)
        {
            var aborted = false;

            unitTestLaunch.Status.Change.Advise(
                launchLifetime,
                args =>
            {
                if (args.HasNew)
                {
                    switch (args.New)
                    {
                    case UnitTestLaunchStatus.Building:
                    case UnitTestLaunchStatus.Starting:
                    case UnitTestLaunchStatus.Running:
                        aborted = false;
                        break;

                    case UnitTestLaunchStatus.Stopping:
                        // This will happen if the build failed.
                        if (session.Launch.Value == null)
                        {
                            break;
                        }
                        // These need to be declared here because session.Launch.Value is null by
                        // the time the Dispatcher executes the action.
                        var relevantTestElements = session.Launch.Value.Elements.Where(e => !e.Children.Any());
                        var launchTime           = session.Launch.Value.StartedOn;
                        _threading.Dispatcher.BeginOrInvoke(
                            "KaVE::TestStopping",
                            () =>
                        {
                            ReadLockCookie.GuardedExecute(
                                () =>
                            {
                                var results = _resultManager.GetResults(relevantTestElements, session);

                                CreateAndFireTestRunEvent(launchTime, aborted, results);
                            });
                        });
                        break;

                    case UnitTestLaunchStatus.Aborting:
                        aborted = true;
                        break;
                    }
                }
            });
        }
コード例 #16
0
        public static void EnsureSilverlightPlatformSupport(this IUnitTestLaunch launch, UnitTestProviders providers, ITaskRunnerHostController hostController)
        {
            var runs = launch.GetRuns();

            foreach (var run in runs.Values.Select(r => r.Value).ToArray())
            {
                foreach (var sequence in run.GetRootTasks().ToArray())
                {
                    ConvertToSilverlightSequenceIfNecessary(sequence, run, launch, providers, hostController);
                }
            }

            launch.RemoveEmptyRuns();
        }
コード例 #17
0
        public static void EnsureSilverlightPlatformSupport(this IUnitTestLaunch launch, UnitTestManager manager)
        {
            var runs = launch.GetRuns();

            foreach (var run in runs.Values.ToArray())
            {
                foreach (var sequence in run.GetSequences().ToArray())
                {
                    ConvertToSilverlightSequenceIfNecessary(sequence, run, launch, manager);
                }
            }

            launch.RemoveEmptyRuns();
        }
コード例 #18
0
        public override IList <UnitTestTask> GetTaskSequence(ICollection <IUnitTestElement> explicitElements,
                                                             IUnitTestLaunch launch)
        {
            var project = GetProject();

            if (project == null)
            {
                return(null);
            }

            return(new List <UnitTestTask>
            {
                new UnitTestTask(this, new TestTask(ShortName, ProjectFolder, true))
            });
        }
コード例 #19
0
        public static UnitTestRun GetOrCreateSilverlightRun(this IUnitTestLaunch launch, PlatformID silverlightPlatform)
        {
            var runs           = launch.GetRuns();
            var silverlightRun = runs.Values.FirstOrDefault(run => run.GetSilverlightPlatformVersion() == silverlightPlatform.Version);

            if (silverlightRun == null)
            {
                var runtimeEnvironment = new RuntimeEnvironment {
                    PlatformType = PlatformType.x86, PlatformVersion = PlatformVersion.v4_0
                };
                silverlightRun = new UnitTestRun((UnitTestLaunch)launch, runtimeEnvironment);
                runs.Add(silverlightRun.ID, silverlightRun);
            }

            return(silverlightRun);
        }
コード例 #20
0
        public static void Report(XDocument doc, IUnitTestLaunch launch, IEnumerable<Element> elements)
        {
            var testCases = Parse(doc);
            if (testCases == null) return;

            foreach (var element in elements.Flatten(x => x.Children.OfType<Element>()).OfType<JasmineSpecificationElement>())
            {
                var key = element.Id;
                if (!testCases.ContainsKey(key)) continue;

                var testCase = testCases[key];
                var task = element.RemoteTask;

                if (testCase.Duration != null)
                {
                    launch.TaskDuration(task, testCase.Duration.Value);
                }
                launch.TaskFinished(task, testCase.Error, testCase.TaskResult);
            }
        }
コード例 #21
0
        private static void ConvertToSilverlightSequenceIfNecessary(RemoteTaskPacket sequence, ref IUnitTestRun run, IUnitTestLaunch launch, IUnitTestProvider provider, ITaskRunnerHostController hostController)
        {
            if (!sequence.IsSilverlightSequence())
            {
                var silverlightProject = sequence.GetSilverlightProject(run);
                if (silverlightProject != null)
                {
                    var silverlightRun = launch.GetOrCreateSilverlightRun(silverlightProject.PlatformID, provider, hostController);

                    var silverlightElement = new SilverlightUnitTestElement(new UnitTestElementId(provider, run.Elements.First().Id.PersistentProjectId, Guid.NewGuid().ToString()), silverlightRun.Key.RunStrategy);

                    var remoteTask = new SilverlightUnitTestTask(silverlightProject.PlatformID.Version, silverlightProject.GetXapPath(), silverlightProject.GetDllPath());

                    var silverlightSequence = new RemoteTaskPacket(remoteTask) { TaskPackets = { sequence } };

                    run.GetRootTasks().Remove(sequence);
                    silverlightRun.Value.AddTaskSequence(silverlightSequence, silverlightElement, run);
                    run = silverlightRun.Value;
                }
            }
        }
コード例 #22
0
        public static void Run(IUnitTestLaunch launch, string projectFolder, IEnumerable<Element> elements, bool isE2E)
        {
            Action job = () =>
            {
                var elementList = elements.ToList();
                var testFiles = (from e in elementList.Flatten(x => x.Children.OfType<Element>())
                    let pf = e.GetProjectFile()
                    where pf != null
                    select pf.Location.FullPath)
                    .Distinct(StringComparer.CurrentCultureIgnoreCase);

                var confFile = KarmaConfig.Build(projectFolder, testFiles, isE2E);
                if (!StartKarma(projectFolder, confFile)) return;

                // notify task server
                var doc = LoadResults(projectFolder, isE2E);
                JUnitReporter.Report(doc, launch, elementList);
            };

            job.BeginInvoke(null, null);
        }
コード例 #23
0
        private static void ConvertToSilverlightSequenceIfNecessary(RemoteTaskPacket sequence, IUnitTestRun run, IUnitTestLaunch launch, UnitTestProviders providers, ITaskRunnerHostController hostController)
        {
            if (!sequence.IsSilverlightSequence())
            {
                var silverlightProject = sequence.GetSilverlightProject(run);
                if (silverlightProject != null)
                {
                    var silverlightRun = launch.GetOrCreateSilverlightRun(silverlightProject.PlatformID, providers, hostController);

                    var provider = providers.GetProvider(SilverlightUnitTestProvider.RunnerId);
                    var silverlightElement = new SilverlightUnitTestElement(provider, silverlightRun.Key.RunStrategy);

                    var remoteTask = new SilverlightUnitTestTask(silverlightProject.PlatformID.Version, silverlightProject.GetXapPath(), silverlightProject.GetDllPath());

                    var silverlightSequence = new RemoteTaskPacket(remoteTask) { TaskPackets = { sequence } };

                    run.GetRootTasks().Remove(sequence);
                    silverlightRun.Value.AddTaskSequence(silverlightSequence, silverlightElement, run);
                }
            }
        }
コード例 #24
0
        protected void Execute(UnitTestSessionTestImpl session, List<IList<UnitTestTask>> sequences, Lifetime lt, TextWriter output, IUnitTestLaunch launch)
        {
            var msgListener = Solution.GetComponent<TestRemoteChannelMessageListener>();
            msgListener.Output = output;
            session.Sequences = sequences;
            msgListener.Run = session;
            msgListener.Strategy = new OutOfProcessUnitTestRunStrategy(GetRemoteTaskRunnerInfo());

            var runController = CreateTaskRunnerHostController(Solution.GetComponent<IUnitTestLaunchManager>(), Solution.GetComponent<IUnitTestResultManager>(), Solution.GetComponent<IUnitTestAgentManager>(), launch, Solution.GetComponent<IUnitTestSessionManager>(), GetServerPortNumber());
            msgListener.RunController = runController;
            var finished = new AutoResetEvent(false);
            session.OnFinish(() =>
            {
                var channel = GetRemoteChannel();
                if (channel != null)
                    channel.OnFinish(() => finished.Set());
                else
                    finished.Set();
            });
            session.Run(lt, runController, msgListener.Strategy);
            finished.WaitOne(30000);
        }
コード例 #25
0
        public static void Run(IUnitTestLaunch launch, string projectFolder, IEnumerable <Element> elements, bool isE2E)
        {
            Action job = () =>
            {
                var elementList = elements.ToList();
                var testFiles   = (from e in elementList.Flatten(x => x.Children.OfType <Element>())
                                   let pf = e.GetProjectFile()
                                            where pf != null
                                            select pf.Location.FullPath)
                                  .Distinct(StringComparer.CurrentCultureIgnoreCase);

                var confFile = KarmaConfig.Build(projectFolder, testFiles, isE2E);
                if (!StartKarma(projectFolder, confFile))
                {
                    return;
                }

                // notify task server
                var doc = LoadResults(projectFolder, isE2E);
                JUnitReporter.Report(doc, launch, elementList);
            };

            job.BeginInvoke(null, null);
        }
コード例 #26
0
    public IList<UnitTestTask> GetTaskSequence(ICollection<IUnitTestElement> explicitElements, IUnitTestLaunch launch)
    {
      if (this is ContextSpecificationElement)
      {
        var contextSpecification = this as ContextSpecificationElement;
        var context = contextSpecification.Context;

        return new List<UnitTestTask>
               {
                 _taskFactory.CreateRunAssemblyTask(context),
                 _taskFactory.CreateContextTask(context),
                 _taskFactory.CreateContextSpecificationTask(context, contextSpecification)
               };
      }

      if (this is BehaviorSpecificationElement)
      {
        var behaviorSpecification = this as BehaviorSpecificationElement;
        var behavior = behaviorSpecification.Behavior;
        var context = behavior.Context;

        return new List<UnitTestTask>
               {
                 _taskFactory.CreateRunAssemblyTask(context),
                 _taskFactory.CreateContextTask(context),
                 _taskFactory.CreateBehaviorSpecificationTask(context, behaviorSpecification)
               };
      }

      if (this is ContextElement || this is BehaviorElement)
      {
        return EmptyArray<UnitTestTask>.Instance;
      }

      throw new ArgumentException(String.Format("Element is not a Machine.Specifications element: '{0}'", this));
    }
コード例 #27
0
 public ExtendedDebugTaskRunnerHostController(IUnitTestSessionManager sessionManager, util::JetBrains.Util.Lazy.Lazy <IVsDebugger2> debugger2, DTE dte, IThreading threading, IUnitTestLaunch launch, string remotingAddress)
     : base(sessionManager, debugger2, dte, threading, launch, remotingAddress)
 {
 }
コード例 #28
0
 public static Dictionary <string, UnitTestRun> GetRuns(this IUnitTestLaunch launch)
 {
     return(launch.GetField <Dictionary <string, UnitTestRun> >("myRuns"));
 }
コード例 #29
0
 private IList<XElement> ExecuteWithCapture(UnitTestSessionTestImpl session,
     List<IList<UnitTestTask>> sequences, Lifetime lt, IUnitTestLaunch launch)
 {
     using (var output = new StringWriter())
     {
         Execute(session, sequences, lt, output, launch);
         var messages = output.ToString();
         System.Console.WriteLine(messages);
         return CaptureMessages(messages);
     }
 }
コード例 #30
0
 public IList <UnitTestTask> GetTaskSequence(ICollection <IUnitTestElement> explicitElements, IUnitTestLaunch launch)
 {
     return(new List <UnitTestTask>());
 }
コード例 #31
0
 public RuntimeEnvironment GetRuntimeEnvironment(IUnitTestElement element, RuntimeEnvironment projectRuntimeEnvironment, IUnitTestLaunch launch)
 {
     return(RuntimeEnvironment.Automatic);
 }
コード例 #32
0
 protected override ITaskRunnerHostController CreateWrappedHostController(ISolution solution, IUnitTestLaunchManager launchManager, IUnitTestAgentManager agentManager, IUnitTestLaunch launch)
 {
     return(new ExtendedDebugTaskRunnerHostController(launchManager, agentManager, debugger2, dte, threading, launch, solution.GetComponent <UnitTestServer>().PortNumber));
 }
コード例 #33
0
 public IList<UnitTestTask> GetTaskSequence(ICollection<IUnitTestElement> explicitElements, IUnitTestLaunch launch)
 {
     throw new InvalidOperationException("Test from abstract fixture is not runnable itself");
 }
コード例 #34
0
 public IList<UnitTestTask> GetTaskSequence(ICollection<IUnitTestElement> explicitElements, IUnitTestLaunch launch)
 {
     return GetTaskSequence(explicitElements);
 }
コード例 #35
0
 protected virtual ITaskRunnerHostController CreateWrappedHostController(UnitTestManager manager, UnitTestSessionManager sessionManager, IUnitTestLaunch launch, string remotingAddress)
 {
     return(WrappedHostProvider.CreateHostController(manager, sessionManager, launch, remotingAddress));
 }
コード例 #36
0
        public ITaskRunnerHostController CreateHostController(UnitTestManager manager, UnitTestSessionManager sessionManager, IUnitTestLaunch launch, string remotingAddress)
        {
            launch.EnsureSilverlightPlatformSupport(manager);

            return(CreateWrappedHostController(manager, sessionManager, launch, remotingAddress));
        }
コード例 #37
0
 protected ITaskRunnerHostController CreateTaskRunnerHostController(IUnitTestLaunchManager launchManager, IUnitTestResultManager resultManager, IUnitTestAgentManager agentManager, IUnitTestLaunch launch, IUnitTestSessionManager sessionManager, int port)
 {
     return new ProcessTaskRunnerHostController(port, sessionManager, launchManager, resultManager, agentManager, launch, Logger.GetLogger(typeof(UnitTestTaskRunnerTestBase)));
 }
コード例 #38
0
        public IList <UnitTestTask> GetTaskSequence(ICollection <IUnitTestElement> explicitElements, IUnitTestLaunch launch)
        {
            if (this is ContextSpecificationElement)
            {
                var contextSpecification = this as ContextSpecificationElement;
                var context = contextSpecification.Context;

                return(new List <UnitTestTask>
                {
                    _taskFactory.CreateRunAssemblyTask(context),
                    _taskFactory.CreateContextTask(context),
                    _taskFactory.CreateContextSpecificationTask(context, contextSpecification)
                });
            }

            if (this is BehaviorSpecificationElement)
            {
                var behaviorSpecification = this as BehaviorSpecificationElement;
                var behavior = behaviorSpecification.Behavior;
                var context  = behavior.Context;

                return(new List <UnitTestTask>
                {
                    _taskFactory.CreateRunAssemblyTask(context),
                    _taskFactory.CreateContextTask(context),
                    _taskFactory.CreateBehaviorSpecificationTask(context, behaviorSpecification)
                });
            }

            if (this is ContextElement || this is BehaviorElement)
            {
                return(EmptyArray <UnitTestTask> .Instance);
            }

            throw new ArgumentException(String.Format("Element is not a Machine.Specifications element: '{0}'", this));
        }
コード例 #39
0
 public IList<UnitTestTask> GetTaskSequence(ICollection<IUnitTestElement> explicitElements, IUnitTestLaunch launch)
 {
     return new List<UnitTestTask> { new UnitTestTask(this, new RunMethodTask(MethodRunnerProvider.Id, myClassName, myMethodName, myIsClassStatic, myIsMethodStatic)) };
 }
コード例 #40
0
 protected abstract void Execute(IProjectFile projectFile, UnitTestSessionTestImpl session,
                                 List <IList <UnitTestTask> > sequences, Lifetime lt, IUnitTestLaunch launch);
コード例 #41
0
 public ExtendedDebugTaskRunnerHostController(ILogger logger, IUnitTestLaunchManager launchManager, IUnitTestResultManager resultManager, IUnitTestAgentManager agentManager, IVsDebuggerFacade debuggerFacade, DTE dte, IUnitTestLaunch launch, int portNumber)
     : base(logger, launchManager, resultManager, agentManager, debuggerFacade, dte, launch, portNumber)
 {
 }
コード例 #42
0
        protected void Execute(UnitTestSessionTestImpl session, List <IList <UnitTestTask> > sequences, Lifetime lt, TextWriter output, IUnitTestLaunch launch)
        {
            var msgListener = Solution.GetComponent <TestRemoteChannelMessageListener>();

            msgListener.Output   = output;
            session.Sequences    = sequences;
            msgListener.Run      = session;
            msgListener.Strategy = new OutOfProcessUnitTestRunStrategy(GetRemoteTaskRunnerInfo());

            var runController = CreateTaskRunnerHostController(Solution.GetComponent <IUnitTestLaunchManager>(), Solution.GetComponent <IUnitTestResultManager>(), Solution.GetComponent <IUnitTestAgentManager>(), launch, Solution.GetComponent <IUnitTestSessionManager>(), GetServerPortNumber());

            msgListener.RunController = runController;
            var finished = new AutoResetEvent(false);

            session.OnFinish(() =>
            {
                var channel = GetRemoteChannel();
                if (channel != null)
                {
                    channel.OnFinish(() => finished.Set());
                }
                else
                {
                    finished.Set();
                }
            });
            session.Run(lt, runController, msgListener.Strategy);
            finished.WaitOne(30000);
        }
コード例 #43
0
 public void Run(Lifetime lifetime, ITaskRunnerHostController runController, IUnitTestRun run, IUnitTestLaunch launch,
                 Action continuation)
 {
     foreach (var project in run.Elements.OfType <Element>().GroupBy(x => x.ProjectFolder))
     {
         var projectFolder = project.Key;
         foreach (var set in project.GroupBy(x => x.IsE2E))
         {
             KarmaTestRunner.Run(launch, projectFolder, set, set.Key);
         }
     }
     launch.Finished();
 }
コード例 #44
0
ファイル: SilverlightServices.cs プロジェクト: icnocop/AgUnit
 public string GetRunConfigurationFilename(IUnitTestLaunch launch)
 {
     return this.wrappedServices.GetRunConfigurationFilename(launch);
 }
コード例 #45
0
 public ExtendedDebugTaskRunnerHostController(IUnitTestLaunchManager launchManager, IUnitTestAgentManager agentManager, util::JetBrains.Util.Lazy.Lazy<IVsDebugger2> debugger2, DTE dte, IThreading threading, IUnitTestLaunch launch, int port)
     : base(launchManager, agentManager, debugger2, dte, threading, launch, port)
 {
     this.port = port;
 }
コード例 #46
0
 protected ITaskRunnerHostController CreateTaskRunnerHostController(IUnitTestLaunchManager launchManager, IUnitTestResultManager resultManager, IUnitTestAgentManager agentManager, IUnitTestLaunch launch, IUnitTestSessionManager sessionManager, int port)
 {
     return(new ProcessTaskRunnerHostController(port, sessionManager, launchManager, resultManager, agentManager, launch, Logger.GetLogger(typeof(UnitTestTaskRunnerTestBase))));
 }
コード例 #47
0
 protected override void Execute(IProjectFile projectFile, UnitTestSessionTestImpl session, List<IList<UnitTestTask>> sequences, Lifetime lt, IUnitTestLaunch launch)
 {
     execute(projectFile, session, sequences, lt, launch);
 }
コード例 #48
0
 public RuntimeEnvironment GetRuntimeEnvironment(IUnitTestElement element, RuntimeEnvironment projectRuntimeEnvironment, IUnitTestLaunch launch)
 {
     return RuntimeEnvironment.Automatic;
 }
コード例 #49
0
 public ExtendedDebugTaskRunnerHostController(UnitTestManager manager, UnitTestSessionManager sessionManager, util::JetBrains.Util.Lazy.Lazy<IVsDebugger2> debugger2, DTE dte, IThreading threading, IUnitTestLaunch launch, string remotingAddress)
     : base(manager, sessionManager, debugger2, dte, threading, launch, remotingAddress)
 { }
コード例 #50
0
ファイル: HostProviderWrapper.cs プロジェクト: raittd/AgUnit
        public ITaskRunnerHostController CreateHostController(ISolution solution, IUnitTestSessionManager sessionManager, IUnitTestLaunch launch, string remotingAddress)
        {
            var providers = solution.GetComponent <UnitTestProviders>();

            launch.EnsureSilverlightPlatformSupport(providers);

            return(CreateWrappedHostController(solution, sessionManager, launch, remotingAddress));
        }
コード例 #51
0
        public override IList<UnitTestTask> GetTaskSequence(ICollection<IUnitTestElement> explicitElements, IUnitTestLaunch launch)
        {
            if (TestClass == null)
                return new List<UnitTestTask>();

            var sequence = TestClass.GetTaskSequence(explicitElements, launch);
            sequence.Add(new UnitTestTask(this, new TestMethodTask(TestClass.AssemblyLocation, TestClass.TypeName.FullName, ShortName, IsParameterized)));
            return sequence;
        }
コード例 #52
0
 protected abstract void Execute(IProjectFile projectFile, UnitTestSessionTestImpl session,
     List<IList<UnitTestTask>> sequences, Lifetime lt, IUnitTestLaunch launch);
コード例 #53
0
 public override IList <UnitTestTask> GetTaskSequence(ICollection <IUnitTestElement> explicitElements, IUnitTestLaunch launch)
 {
     return(new List <UnitTestTask>
     {
         new UnitTestTask(null, new XunitTestAssemblyTask(AssemblyLocation)),
         new UnitTestTask(this, new XunitTestClassTask(AssemblyLocation, TypeName.FullName, explicitElements.Contains(this)))
     });
 }
コード例 #54
0
        public override IList <UnitTestTask> GetTaskSequence(ICollection <IUnitTestElement> explicitElements, IUnitTestLaunch launch)
        {
            var sequence = TestClass.GetTaskSequence(explicitElements, launch);

            sequence.Add(new UnitTestTask(this, new XunitTestMethodTask(TestClass.AssemblyLocation, TestClass.TypeName.FullName, ShortName, explicitElements.Contains(this), IsDynamic)));
            return(sequence);
        }
コード例 #55
0
 public IList<UnitTestTask> GetTaskSequence(ICollection<IUnitTestElement> explicitElements, IUnitTestLaunch unitTestLaunch)
コード例 #56
0
        private void ExecuteWithGold(IProjectFile projectFile, UnitTestSessionTestImpl session,
            List<IList<UnitTestTask>> sequences, Lifetime lt, IUnitTestLaunch launch)
        {
            ExecuteWithGold(projectFile.Location.FullPath, output =>
            {
                using (var stringWriter = new StringWriter())
                {
                    Execute(session, sequences, lt, stringWriter, launch);

                    // ReSharper 8.2 uses CDATA, but ReSharper 9.0 doesn't. Normalise by removing
                    var text = stringWriter.ToString();
                    text = text.Replace("<![CDATA[", string.Empty).Replace("]]>", string.Empty);
                    output.Write(text);
                }
            });
        }
コード例 #57
0
 public override IList<UnitTestTask> GetTaskSequence(ICollection<IUnitTestElement> explicitElements, IUnitTestLaunch launch)
 {
     var sequence = Parent.GetTaskSequence(explicitElements, launch);
     sequence.Add(new UnitTestTask(this, new TestCaseTask(ShortName, ((BaseElement)Parent).AssemblyLocation)));
     return sequence;
 }
コード例 #58
0
 public IList<UnitTestTask> GetTaskSequence(ICollection<IUnitTestElement> explicitElements, IUnitTestLaunch launch)
 {
     return new List<UnitTestTask> { new UnitTestTask(this, new RunMethodTask(MethodRunnerProvider.Id, ((IProject)myProjectEnvoy.GetValidProjectElement()).GetOutputFilePath().FullPath, myClassName.FullName, myMethodName, myIsClassStatic, myIsMethodStatic)) };
 }
コード例 #59
0
 public abstract IList <UnitTestTask> GetTaskSequence(ICollection <IUnitTestElement> explicitElements, IUnitTestLaunch launch);
コード例 #60
0
 protected override ITaskRunnerHostController CreateWrappedHostController(ISolution solution, IUnitTestSessionManager sessionManager, IUnitTestLaunch launch, string remotingAddress)
 {
     return(new ExtendedDebugTaskRunnerHostController(sessionManager, debugger2, dte, threading, launch, remotingAddress));
 }