diff --git a/TeamCity.ServiceMessages.Tests/Read/ServiceMessageParserPerformanceTest.cs b/TeamCity.ServiceMessages.Tests/Read/ServiceMessageParserPerformanceTest.cs index 932edc5..81ffcad 100644 --- a/TeamCity.ServiceMessages.Tests/Read/ServiceMessageParserPerformanceTest.cs +++ b/TeamCity.ServiceMessages.Tests/Read/ServiceMessageParserPerformanceTest.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/TeamCity.ServiceMessages.Tests/Read/ServiceMessageParserTest.cs b/TeamCity.ServiceMessages.Tests/Read/ServiceMessageParserTest.cs index f2e7fa5..9a65f6a 100644 --- a/TeamCity.ServiceMessages.Tests/Read/ServiceMessageParserTest.cs +++ b/TeamCity.ServiceMessages.Tests/Read/ServiceMessageParserTest.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/TeamCity.ServiceMessages.Tests/Read/StringWrapper.cs b/TeamCity.ServiceMessages.Tests/Read/StringWrapper.cs index 1727ff3..2ff325b 100644 --- a/TeamCity.ServiceMessages.Tests/Read/StringWrapper.cs +++ b/TeamCity.ServiceMessages.Tests/Read/StringWrapper.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/TeamCity.ServiceMessages.Tests/ServiceMessageReplacementsTest.cs b/TeamCity.ServiceMessages.Tests/ServiceMessageReplacementsTest.cs index 0052cd3..132d6d8 100644 --- a/TeamCity.ServiceMessages.Tests/ServiceMessageReplacementsTest.cs +++ b/TeamCity.ServiceMessages.Tests/ServiceMessageReplacementsTest.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/TeamCity.ServiceMessages.Tests/Write/ServiceMessageFormatterTest.cs b/TeamCity.ServiceMessages.Tests/Write/ServiceMessageFormatterTest.cs index ac25b01..9b0d5df 100644 --- a/TeamCity.ServiceMessages.Tests/Write/ServiceMessageFormatterTest.cs +++ b/TeamCity.ServiceMessages.Tests/Write/ServiceMessageFormatterTest.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityArtifactsWriterTest.cs b/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityArtifactsWriterTest.cs index f0ed811..17f039c 100644 --- a/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityArtifactsWriterTest.cs +++ b/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityArtifactsWriterTest.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityBlockWriterTest.cs b/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityBlockWriterTest.cs index 99f3b0e..8d11472 100644 --- a/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityBlockWriterTest.cs +++ b/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityBlockWriterTest.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityBuildStatusWriterTest.cs b/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityBuildStatusWriterTest.cs index d4b179d..3cc12e1 100644 --- a/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityBuildStatusWriterTest.cs +++ b/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityBuildStatusWriterTest.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityCompilationBlockWriterTest.cs b/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityCompilationBlockWriterTest.cs index 79c441b..c7e3293 100644 --- a/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityCompilationBlockWriterTest.cs +++ b/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityCompilationBlockWriterTest.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityFlowWriterBaseTest.cs b/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityFlowWriterBaseTest.cs index c8809aa..a830d73 100644 --- a/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityFlowWriterBaseTest.cs +++ b/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityFlowWriterBaseTest.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityFlowWriterTest.cs b/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityFlowWriterTest.cs index e45eaaf..8548a6e 100644 --- a/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityFlowWriterTest.cs +++ b/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityFlowWriterTest.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityMessageWriterTest.cs b/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityMessageWriterTest.cs index a303beb..312d3fd 100644 --- a/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityMessageWriterTest.cs +++ b/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityMessageWriterTest.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityTestWriterTest.cs b/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityTestWriterTest.cs index bae5093..a9e443b 100644 --- a/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityTestWriterTest.cs +++ b/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityTestWriterTest.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -75,5 +75,53 @@ public void TestStdOut() { DoTest(x => x.WriteStdOutput("outp4uz"), "##teamcity[testStdOut name='BadaBumBigBadaBum' out='outp4uz' tc:tags='tc:parseServiceMessagesInside']"); } + + [Test] + public void TestWriteTextValue() + { + DoTest(x => x.WriteValue("strVal", "myVal"), "##teamcity[testMetadata testName='BadaBumBigBadaBum' value='strVal' name='myVal']"); + } + + [Test] + [TestCase(1.0d, "1")] + [TestCase(0.0d, "0")] + [TestCase(-1.0d, "-1")] + [TestCase(1.33d, "1.33")] + [TestCase(-1.33d, "-1.33")] + [TestCase(0.33d, "0.33")] + public void TestWriteNumber(double value, string expectedValueInMessage) + { + DoTest(x => x.WriteValue(value, "myVal"), "##teamcity[testMetadata testName='BadaBumBigBadaBum' type='number' value='" + expectedValueInMessage + "' name='myVal']"); + } + + [Test] + public void TestWriteLink() + { + DoTest(x => x.WriteLink("http://abc.com", "abc"), "##teamcity[testMetadata testName='BadaBumBigBadaBum' type='link' value='http://abc.com' name='abc']"); + } + + [Test] + public void TestWriteFile() + { + DoTest(x => x.WriteFile("abc.txt", "abc"), "##teamcity[testMetadata testName='BadaBumBigBadaBum' type='artifact' value='abc.txt' name='abc']"); + } + + [Test] + public void TestWriteFileWithoutDescription() + { + DoTest(x => x.WriteFile("abc.txt"), "##teamcity[testMetadata testName='BadaBumBigBadaBum' type='artifact' value='abc.txt']"); + } + + [Test] + public void TestWriteImage() + { + DoTest(x => x.WriteImage("abc.jpg", "abc"), "##teamcity[testMetadata testName='BadaBumBigBadaBum' type='image' value='abc.jpg' name='abc']"); + } + + [Test] + public void TestWriteImageWithoutDescription() + { + DoTest(x => x.WriteImage("abc.jpg"), "##teamcity[testMetadata testName='BadaBumBigBadaBum' type='image' value='abc.jpg']"); + } } } \ No newline at end of file diff --git a/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityTestsWriterTest.cs b/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityTestsWriterTest.cs index 3859382..37b98f0 100644 --- a/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityTestsWriterTest.cs +++ b/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityTestsWriterTest.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityWriterBaseTest.cs b/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityWriterBaseTest.cs index af946f0..d9f2d08 100644 --- a/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityWriterBaseTest.cs +++ b/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityWriterBaseTest.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,11 +63,11 @@ private void DoTestImpl(Action action, Func replace, string[] var actualText = "\r\n" + string.Join("\r\n", actual); var expected = preprocess(string.Join("\r\n", golds)); - if (actual.Count() != expected.Count()) + if (actual.Length != expected.Length) Assert.Fail("Incorrect number of messages. Was: " + actualText); for (var i = 0; i < actual.Count(); i++) - Assert.AreEqual(actual[i], expected[i], "Message {0} does not match. Was: {1}", i, actualText); + Assert.AreEqual(expected[i], actual[i], "Message {0} does not match. Was: {1}", i, actualText); } protected class ToStringProcessor : IServiceMessageProcessor diff --git a/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityWriterFlowsTest.cs b/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityWriterFlowsTest.cs index 59c1f81..9122763 100644 --- a/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityWriterFlowsTest.cs +++ b/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityWriterFlowsTest.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityWriterMessageTest.cs b/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityWriterMessageTest.cs index 94015f6..7881077 100644 --- a/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityWriterMessageTest.cs +++ b/TeamCity.ServiceMessages.Tests/Write/Specials/TeamCityWriterMessageTest.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/TeamCity.ServiceMessages.Tests/Write/TeamCityServiceMessagesTest.cs b/TeamCity.ServiceMessages.Tests/Write/TeamCityServiceMessagesTest.cs index a971903..09e46f5 100644 --- a/TeamCity.ServiceMessages.Tests/Write/TeamCityServiceMessagesTest.cs +++ b/TeamCity.ServiceMessages.Tests/Write/TeamCityServiceMessagesTest.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/TeamCity.ServiceMessages.Tests/Write/Updaters/FlowMessageUpdaterTest.cs b/TeamCity.ServiceMessages.Tests/Write/Updaters/FlowMessageUpdaterTest.cs index a28c07a..82e9b07 100644 --- a/TeamCity.ServiceMessages.Tests/Write/Updaters/FlowMessageUpdaterTest.cs +++ b/TeamCity.ServiceMessages.Tests/Write/Updaters/FlowMessageUpdaterTest.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/TeamCity.ServiceMessages.Tests/Write/Updaters/TimestampMessageUpdaterTest.cs b/TeamCity.ServiceMessages.Tests/Write/Updaters/TimestampMessageUpdaterTest.cs index 5712ff9..87c772b 100644 --- a/TeamCity.ServiceMessages.Tests/Write/Updaters/TimestampMessageUpdaterTest.cs +++ b/TeamCity.ServiceMessages.Tests/Write/Updaters/TimestampMessageUpdaterTest.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/TeamCity.ServiceMessages.sln.DotSettings b/TeamCity.ServiceMessages.sln.DotSettings index 1355e50..5ffefd7 100644 --- a/TeamCity.ServiceMessages.sln.DotSettings +++ b/TeamCity.ServiceMessages.sln.DotSettings @@ -180,6 +180,8 @@ </Patterns> True <Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb" /> + True + True True True True diff --git a/TeamCity.ServiceMessages/Annotations.cs b/TeamCity.ServiceMessages/Annotations.cs index 0aa8ee5..d281b8d 100644 --- a/TeamCity.ServiceMessages/Annotations.cs +++ b/TeamCity.ServiceMessages/Annotations.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -157,7 +157,7 @@ public ValueProviderAttribute([NotNull] string name) /// /// void Foo(string param) { /// if (param == null) - /// throw new ArgumentNullException("par"); // Warning: Cannot resolve symbol + /// throw new ArgumentNullException("par"); // Warning: Cannot resolve symbol /// } /// [AttributeUsage(AttributeTargets.Parameter)] @@ -188,8 +188,8 @@ internal sealed class InvokerParameterNameAttribute : Attribute { } /// string _name; /// /// public string Name { - /// get { return _name; } - /// set { _name = value; NotifyChanged("LastName"); /* Warning */ } + /// get { return _name; } + /// set { _name = value; NotifyChanged("LastName"); /* Warning */ } /// } /// } /// @@ -310,11 +310,11 @@ public LocalizationRequiredAttribute(bool required) /// /// class UsesNoEquality { /// void Test() { - /// var ca1 = new NoEquality(); - /// var ca2 = new NoEquality(); - /// if (ca1 != null) { // OK - /// bool condition = ca1 == ca2; // Warning - /// } + /// var ca1 = new NoEquality(); + /// var ca2 = new NoEquality(); + /// if (ca1 != null) { // OK + /// bool condition = ca1 == ca2; // Warning + /// } /// } /// } /// @@ -500,8 +500,8 @@ public MustUseReturnValueAttribute([NotNull] string justification) /// [ProvidesContext] IBarService _barService = ...; /// /// void ProcessNode(INode node) { - /// DoSomething(node, node.GetGlobalServices().Bar); - /// // ^ Warning: use value of '_barService' field + /// DoSomething(node, node.GetGlobalServices().Bar); + /// // ^ Warning: use value of '_barService' field /// } /// } /// @@ -546,7 +546,7 @@ public PathReferenceAttribute([NotNull, PathReference] string basePath) /// [SourceTemplate] /// public static void forEach<T>(this IEnumerable<T> xs) { /// foreach (var x in xs) { - /// //$ $END$ + /// //$ $END$ /// } /// } /// @@ -569,7 +569,7 @@ internal sealed class SourceTemplateAttribute : Attribute { } /// [SourceTemplate, Macro(Target = "item", Expression = "suggestVariableName()")] /// public static void forEach<T>(this IEnumerable<T> collection) { /// foreach (var item in collection) { - /// //$ $END$ + /// //$ $END$ /// } /// } /// diff --git a/TeamCity.ServiceMessages/IServiceMessage.cs b/TeamCity.ServiceMessages/IServiceMessage.cs index 95e76fd..a591d35 100644 --- a/TeamCity.ServiceMessages/IServiceMessage.cs +++ b/TeamCity.ServiceMessages/IServiceMessage.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,31 +19,31 @@ namespace JetBrains.TeamCity.ServiceMessages using System.Collections.Generic; /// - /// Object representation of TeamCity service message + /// Object representation of TeamCity service message /// public interface IServiceMessage { /// - /// Service message name, i.e. messageName in ##teamcity[messageName 'ddd']. + /// Service message name, i.e. messageName in ##teamcity[messageName 'ddd']. /// [NotNull] string Name { get; } /// - /// For one-value service messages returns value, i.e. 'aaa' for ##teamcity[message 'aaa'] - /// or null otherwise, i.e. ##teamcity[message aa='aaa'] + /// For one-value service messages returns value, i.e. 'aaa' for ##teamcity[message 'aaa'] + /// or null otherwise, i.e. ##teamcity[message aa='aaa'] /// [CanBeNull] string DefaultValue { get; } /// - /// Emptry for one-value service messages, i.e. ##teamcity[message 'aaa'], returns all keys otherwise + /// Emptry for one-value service messages, i.e. ##teamcity[message 'aaa'], returns all keys otherwise /// [NotNull] IEnumerable Keys { get; } /// - /// Return a value for keys or null + /// Return a value for keys or null /// /// Key to check for value /// value of available or null diff --git a/TeamCity.ServiceMessages/Read/IServiceMessageParser.cs b/TeamCity.ServiceMessages/Read/IServiceMessageParser.cs index b677abe..9f84ad7 100644 --- a/TeamCity.ServiceMessages/Read/IServiceMessageParser.cs +++ b/TeamCity.ServiceMessages/Read/IServiceMessageParser.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,12 +20,12 @@ namespace JetBrains.TeamCity.ServiceMessages.Read using System.IO; /// - /// Provides service messages parsing from stream + /// Provides service messages parsing from stream /// public interface IServiceMessageParser { /// - /// Lazy parses service messages from string + /// Lazy parses service messages from string /// /// text to parse /// enumerable of service messages @@ -33,7 +33,7 @@ public interface IServiceMessageParser IEnumerable ParseServiceMessages([NotNull] string text); /// - /// Reads stream parsing service messages from it. + /// Reads stream parsing service messages from it. /// /// stream to parse. Stream will not be closed /// Iterator of service messages diff --git a/TeamCity.ServiceMessages/Read/ServiceMessage.cs b/TeamCity.ServiceMessages/Read/ServiceMessage.cs index b51641e..18155d6 100644 --- a/TeamCity.ServiceMessages/Read/ServiceMessage.cs +++ b/TeamCity.ServiceMessages/Read/ServiceMessage.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/TeamCity.ServiceMessages/Read/ServiceMessageParser.cs b/TeamCity.ServiceMessages/Read/ServiceMessageParser.cs index 69fa012..f272112 100644 --- a/TeamCity.ServiceMessages/Read/ServiceMessageParser.cs +++ b/TeamCity.ServiceMessages/Read/ServiceMessageParser.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,12 +22,12 @@ namespace JetBrains.TeamCity.ServiceMessages.Read using System.Text; /// - /// Provides service messages parsing from stream + /// Provides service messages parsing from stream /// public class ServiceMessageParser : IServiceMessageParser { /// - /// Lazy parses service messages from string + /// Lazy parses service messages from string /// /// text to parse /// enumerable of service messages @@ -38,7 +38,7 @@ public IEnumerable ParseServiceMessages(string text) } /// - /// Reads stream parsing service messages from it. + /// Reads stream parsing service messages from it. /// /// stream to parse. Stream will not be closed /// Iterator of service messages diff --git a/TeamCity.ServiceMessages/ServiceMessageConstants.cs b/TeamCity.ServiceMessages/ServiceMessageConstants.cs index 2196085..57f1f8f 100644 --- a/TeamCity.ServiceMessages/ServiceMessageConstants.cs +++ b/TeamCity.ServiceMessages/ServiceMessageConstants.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/TeamCity.ServiceMessages/ServiceMessageReplacements.cs b/TeamCity.ServiceMessages/ServiceMessageReplacements.cs index a008c70..e47d034 100644 --- a/TeamCity.ServiceMessages/ServiceMessageReplacements.cs +++ b/TeamCity.ServiceMessages/ServiceMessageReplacements.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ namespace JetBrains.TeamCity.ServiceMessages public class ServiceMessageReplacements { /// - /// Performs TeamCity-format escaping of a string. + /// Performs TeamCity-format escaping of a string. /// [NotNull] public static string Encode([NotNull] string value) @@ -67,7 +67,7 @@ public static string Encode([NotNull] string value) } /// - /// Performs TeamCity-format escaping of a string. + /// Performs TeamCity-format escaping of a string. /// [NotNull] public static string Decode([NotNull] string value) diff --git a/TeamCity.ServiceMessages/Write/IServiceMessageFormatter.cs b/TeamCity.ServiceMessages/Write/IServiceMessageFormatter.cs index 004f9d7..8d7be24 100644 --- a/TeamCity.ServiceMessages/Write/IServiceMessageFormatter.cs +++ b/TeamCity.ServiceMessages/Write/IServiceMessageFormatter.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,12 +19,12 @@ namespace JetBrains.TeamCity.ServiceMessages.Write using System.Collections.Generic; /// - /// Provides service messages serialization for most cases + /// Provides service messages serialization for most cases /// public interface IServiceMessageFormatter { /// - /// Serializes single value service message + /// Serializes single value service message /// /// message name /// value @@ -32,7 +32,7 @@ public interface IServiceMessageFormatter string FormatMessage([NotNull] string messageName, [NotNull] string singleValue); /// - /// Serializes single value service message + /// Serializes single value service message /// /// message name /// anonymous object containing all service message parameters @@ -41,7 +41,7 @@ public interface IServiceMessageFormatter string FormatMessage([NotNull] string messageName, [NotNull] object anonymousProperties); /// - /// Serializes single value service message + /// Serializes single value service message /// /// message name /// params array of service message properties @@ -50,7 +50,7 @@ public interface IServiceMessageFormatter string FormatMessage([NotNull] string messageName, [NotNull] params ServiceMessageProperty[] properties); /// - /// Serializes single value service message + /// Serializes single value service message /// /// message name /// params of service message properties @@ -59,7 +59,7 @@ public interface IServiceMessageFormatter string FormatMessage([NotNull] string messageName, [NotNull] IEnumerable properties); /// - /// Serializes service message + /// Serializes service message /// /// /// @@ -67,7 +67,7 @@ public interface IServiceMessageFormatter string FormatMessage([NotNull] IServiceMessage serviceMessage); /// - /// Serializes service message from IDictionary + /// Serializes service message from IDictionary /// /// service message name /// arguments diff --git a/TeamCity.ServiceMessages/Write/ServiceMessage.cs b/TeamCity.ServiceMessages/Write/ServiceMessage.cs index e61aac6..97d2266 100644 --- a/TeamCity.ServiceMessages/Write/ServiceMessage.cs +++ b/TeamCity.ServiceMessages/Write/ServiceMessage.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,8 +22,8 @@ namespace JetBrains.TeamCity.ServiceMessages.Write using System.Linq; /// - /// Helper class to create complex service message. Use object initilizer to simplify code, i.e. - /// + /// Helper class to create complex service message. Use object initilizer to simplify code, i.e. + /// /// new ServiceMessage("buildProblem") { { "identity", identity}, {"description", message}} /// /// @@ -32,7 +32,7 @@ public class ServiceMessage : IServiceMessage, IEnumerable _arguments = new Dictionary(); /// - /// Copy constructor + /// Copy constructor /// /// service message to copy from public ServiceMessage(IServiceMessage message) @@ -43,7 +43,7 @@ public ServiceMessage(IServiceMessage message) } /// - /// Simple constructor + /// Simple constructor /// /// service message name public ServiceMessage([NotNull] string name) diff --git a/TeamCity.ServiceMessages/Write/ServiceMessageFormatter.cs b/TeamCity.ServiceMessages/Write/ServiceMessageFormatter.cs index f0a7ab0..c98d530 100644 --- a/TeamCity.ServiceMessages/Write/ServiceMessageFormatter.cs +++ b/TeamCity.ServiceMessages/Write/ServiceMessageFormatter.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,12 +25,12 @@ namespace JetBrains.TeamCity.ServiceMessages.Write using System.Text; /// - /// Provides service messages serialization for most cases + /// Provides service messages serialization for most cases /// public class ServiceMessageFormatter : IServiceMessageFormatter { /// - /// Serializes single value service message + /// Serializes single value service message /// /// message name /// value @@ -44,7 +44,7 @@ public string FormatMessage([NotNull] string messageName, [NotNull] string singl } /// - /// Serializes single value service message + /// Serializes single value service message /// /// message name /// anonymous object containing all service message parameters @@ -66,7 +66,7 @@ public string FormatMessage([NotNull] string messageName, [NotNull] object anony } /// - /// Serializes single value service message + /// Serializes single value service message /// /// message name /// params array of service message properties @@ -79,7 +79,7 @@ public string FormatMessage([NotNull] string messageName, [NotNull] params Servi } /// - /// Serializes service message + /// Serializes service message /// /// parser service message /// @@ -95,7 +95,7 @@ public string FormatMessage(IServiceMessage serviceMessage) } /// - /// Serializes service message from IDictionary + /// Serializes service message from IDictionary /// /// service message name /// arguments @@ -108,7 +108,7 @@ public string FormatMessage(string name, IEnumerable - /// Serializes single value service message + /// Serializes single value service message /// /// message name /// params of service message properties diff --git a/TeamCity.ServiceMessages/Write/ServiceMessageProperty.cs b/TeamCity.ServiceMessages/Write/ServiceMessageProperty.cs index 6873711..37235e8 100644 --- a/TeamCity.ServiceMessages/Write/ServiceMessageProperty.cs +++ b/TeamCity.ServiceMessages/Write/ServiceMessageProperty.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,22 +19,22 @@ namespace JetBrains.TeamCity.ServiceMessages.Write using System; /// - /// Object to represent service message attributes + /// Object to represent service message attributes /// public struct ServiceMessageProperty { /// - /// Key + /// Key /// public readonly string Key; /// - /// Value + /// Value /// public readonly string Value; /// - /// Constructor of service message attribute + /// Constructor of service message attribute /// /// service message key, must not contain escapable symbols, not null /// value, notnull diff --git a/TeamCity.ServiceMessages/Write/Special/IFlowIdGenerator.cs b/TeamCity.ServiceMessages/Write/Special/IFlowIdGenerator.cs index 4b2ca12..7245cdf 100644 --- a/TeamCity.ServiceMessages/Write/Special/IFlowIdGenerator.cs +++ b/TeamCity.ServiceMessages/Write/Special/IFlowIdGenerator.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,12 +17,12 @@ namespace JetBrains.TeamCity.ServiceMessages.Write.Special { /// - /// Helper class to generate FlowIds + /// Helper class to generate FlowIds /// public interface IFlowIdGenerator { /// - /// Generates new unique FlowId + /// Generates new unique FlowId /// /// next generated flow id [NotNull] diff --git a/TeamCity.ServiceMessages/Write/Special/IFlowServiceMessageProcessor.cs b/TeamCity.ServiceMessages/Write/Special/IFlowServiceMessageProcessor.cs index 2024689..e3f47e4 100644 --- a/TeamCity.ServiceMessages/Write/Special/IFlowServiceMessageProcessor.cs +++ b/TeamCity.ServiceMessages/Write/Special/IFlowServiceMessageProcessor.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,17 +17,17 @@ namespace JetBrains.TeamCity.ServiceMessages.Write.Special { /// - /// FlowId aware implementation of ServiceMessagesProcessor + /// FlowId aware implementation of ServiceMessagesProcessor /// public interface IFlowServiceMessageProcessor : IServiceMessageProcessor { /// - /// Current flow Id + /// Current flow Id /// string FlowId { [NotNull] get; } /// - /// Creates new ServiceMessage updater that uses specified FlowId + /// Creates new ServiceMessage updater that uses specified FlowId /// /// [NotNull] diff --git a/TeamCity.ServiceMessages/Write/Special/IServiceMessageProcessor.cs b/TeamCity.ServiceMessages/Write/Special/IServiceMessageProcessor.cs index 2d74a98..78407cd 100644 --- a/TeamCity.ServiceMessages/Write/Special/IServiceMessageProcessor.cs +++ b/TeamCity.ServiceMessages/Write/Special/IServiceMessageProcessor.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,12 +17,12 @@ namespace JetBrains.TeamCity.ServiceMessages.Write.Special { /// - /// Abstract service message acceptor + /// Abstract service message acceptor /// public interface IServiceMessageProcessor { /// - /// Accepts new service message. Default implementation may simply prtint service message to console + /// Accepts new service message. Default implementation may simply prtint service message to console /// /// service message to process void AddServiceMessage([NotNull] IServiceMessage serviceMessage); diff --git a/TeamCity.ServiceMessages/Write/Special/IServiceMessageUpdater.cs b/TeamCity.ServiceMessages/Write/Special/IServiceMessageUpdater.cs index 5622434..9f5c917 100644 --- a/TeamCity.ServiceMessages/Write/Special/IServiceMessageUpdater.cs +++ b/TeamCity.ServiceMessages/Write/Special/IServiceMessageUpdater.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,12 +17,12 @@ namespace JetBrains.TeamCity.ServiceMessages.Write.Special { /// - /// Base interface for service message updaters + /// Base interface for service message updaters /// public interface IServiceMessageUpdater { /// - /// Thus method is called to update service message instance. + /// Thus method is called to update service message instance. /// /// service message /// updated service message diff --git a/TeamCity.ServiceMessages/Write/Special/ITeamCityArtifactsWriter.cs b/TeamCity.ServiceMessages/Write/Special/ITeamCityArtifactsWriter.cs index 54d1ad3..2eb2e8b 100644 --- a/TeamCity.ServiceMessages/Write/Special/ITeamCityArtifactsWriter.cs +++ b/TeamCity.ServiceMessages/Write/Special/ITeamCityArtifactsWriter.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,17 +17,17 @@ namespace JetBrains.TeamCity.ServiceMessages.Write.Special { /// - /// Service messages for dynamically publish artifacts. - /// http://confluence.jetbrains.net/display/TCD7/Build+Script+Interaction+with+TeamCity#BuildScriptInteractionwithTeamCity-PublishingArtifactswhiletheBuildisStillinProgress + /// Service messages for dynamically publish artifacts. + /// http://confluence.jetbrains.net/display/TCD18/Build+Script+Interaction+with+TeamCity#BuildScriptInteractionwithTeamCity-PublishingArtifactswhiletheBuildisStillinProgress /// /// - /// Implementation is not thread-safe. Create an instance for each thread instead. + /// Implementation is not thread-safe. Create an instance for each thread instead. /// public interface ITeamCityArtifactsWriter { /// - /// attaches new artifact publishing rules as described in - /// http://confluence.jetbrains.net/display/TCD7/Build+Artifact + /// attaches new artifact publishing rules as described in + /// http://confluence.jetbrains.net/display/TCD18/Build+Artifact /// /// void PublishArtifact([NotNull] string rules); diff --git a/TeamCity.ServiceMessages/Write/Special/ITeamCityBlockWriter.cs b/TeamCity.ServiceMessages/Write/Special/ITeamCityBlockWriter.cs index 1711999..afdcc8f 100644 --- a/TeamCity.ServiceMessages/Write/Special/ITeamCityBlockWriter.cs +++ b/TeamCity.ServiceMessages/Write/Special/ITeamCityBlockWriter.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,20 +19,20 @@ namespace JetBrains.TeamCity.ServiceMessages.Write.Special using System; /// - /// Generates pair of service messages to open/close block, for example: - ///
##teamcity[blockOpened name='<blockName>']
- /// and - ///
##teamcity[blockClosed name='<blockName>']
- /// http://confluence.jetbrains.net/display/TCD7/Build+Script+Interaction+with+TeamCity#BuildScriptInteractionwithTeamCity-BlocksofServiceMessages + /// Generates pair of service messages to open/close block, for example: + ///
##teamcity[blockOpened name='<blockName>']
+ /// and + ///
##teamcity[blockClosed name='<blockName>']
+ /// http://confluence.jetbrains.net/display/TCD18/Build+Script+Interaction+with+TeamCity#BuildScriptInteractionwithTeamCity-BlocksofServiceMessages ///
/// - /// Implementation is not thread-safe. Create an instance for each thread instead. + /// Implementation is not thread-safe. Create an instance for each thread instead. /// public interface ITeamCityBlockWriter where CloseBlock : IDisposable { /// - /// Generates open block message. To close the block, call Dispose to the given handle + /// Generates open block message. To close the block, call Dispose to the given handle /// /// block name to report /// diff --git a/TeamCity.ServiceMessages/Write/Special/ITeamCityBuildStatusWriter.cs b/TeamCity.ServiceMessages/Write/Special/ITeamCityBuildStatusWriter.cs index 9a802ec..75e11a7 100644 --- a/TeamCity.ServiceMessages/Write/Special/ITeamCityBuildStatusWriter.cs +++ b/TeamCity.ServiceMessages/Write/Special/ITeamCityBuildStatusWriter.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,43 +17,43 @@ namespace JetBrains.TeamCity.ServiceMessages.Write.Special { /// - /// Interface for writing build-related messages - /// http://confluence.jetbrains.net/display/TCD7/Build+Script+Interaction+with+TeamCity#BuildScriptInteractionwithTeamCity-ReportingBuildNumber + /// Interface for writing build-related messages + /// http://confluence.jetbrains.net/display/TCD18/Build+Script+Interaction+with+TeamCity#BuildScriptInteractionwithTeamCity-ReportingBuildNumber /// /// - /// Implementation is not thread-safe. Create an instance for each thread instead. + /// Implementation is not thread-safe. Create an instance for each thread instead. /// public interface ITeamCityBuildStatusWriter { /// - /// Generates service message to update build number. + /// Generates service message to update build number. /// /// void WriteBuildNumber([NotNull] string buildNumber); /// - /// Generates build problem service message + /// Generates build problem service message /// /// problem unique identity, no more than 60 chars /// problem message void WriteBuildProblem([NotNull] string identity, [NotNull] string description); /// - /// Generates service message to update build parameter - /// http://confluence.jetbrains.net/display/TCD7/Configuring+Build+Parameters + /// Generates service message to update build parameter + /// http://confluence.jetbrains.net/display/TCD18/Configuring+Build+Parameters /// /// - /// parameter name, could start with env. for environment, system. for system property, - /// otherwise it would be config parameter + /// parameter name, could start with env. for environment, system. for system property, + /// otherwise it would be config parameter /// /// value void WriteBuildParameter([NotNull] string parameterName, [NotNull] string parameterValue); /// - /// Generates service message to report build statistics values - /// http://confluence.jetbrains.net/display/TCD7/Customizing+Statistics+Charts#CustomizingStatisticsCharts-customCharts + /// Generates service message to report build statistics values + /// http://confluence.jetbrains.net/display/TCD18/Customizing+Statistics+Charts#CustomizingStatisticsCharts-customCharts /// /// statistics report key /// statistics report values diff --git a/TeamCity.ServiceMessages/Write/Special/ITeamCityCompilationBlockWriter.cs b/TeamCity.ServiceMessages/Write/Special/ITeamCityCompilationBlockWriter.cs index e5f64ca..2aaad19 100644 --- a/TeamCity.ServiceMessages/Write/Special/ITeamCityCompilationBlockWriter.cs +++ b/TeamCity.ServiceMessages/Write/Special/ITeamCityCompilationBlockWriter.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,20 +19,20 @@ namespace JetBrains.TeamCity.ServiceMessages.Write.Special using System; /// - /// Introduces compilation block. - ///
##teamcity[compilationStarted compiler='<compiler name>']
- /// and - ///
##teamcity[compilationFinished compiler='<compiler name>']
- /// http://confluence.jetbrains.net/display/TCD7/Build+Script+Interaction+with+TeamCity#BuildScriptInteractionwithTeamCity-ReportingCompilationMessages + /// Introduces compilation block. + ///
##teamcity[compilationStarted compiler='<compiler name>']
+ /// and + ///
##teamcity[compilationFinished compiler='<compiler name>']
+ /// http://confluence.jetbrains.net/display/TCD18/Build+Script+Interaction+with+TeamCity#BuildScriptInteractionwithTeamCity-ReportingCompilationMessages ///
/// - /// Implementation is not thread-safe. Create an instance for each thread instead. + /// Implementation is not thread-safe. Create an instance for each thread instead. /// public interface ITeamCityCompilationBlockWriter where CloseBlock : IDisposable { /// - /// Generates open compilation block. To close block call Dispose to the given handle + /// Generates open compilation block. To close block call Dispose to the given handle /// /// /// diff --git a/TeamCity.ServiceMessages/Write/Special/ITeamCityFlowWriter.cs b/TeamCity.ServiceMessages/Write/Special/ITeamCityFlowWriter.cs index e9d663a..75fa1dc 100644 --- a/TeamCity.ServiceMessages/Write/Special/ITeamCityFlowWriter.cs +++ b/TeamCity.ServiceMessages/Write/Special/ITeamCityFlowWriter.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,20 +19,20 @@ namespace JetBrains.TeamCity.ServiceMessages.Write.Special using System; /// - /// Starts another flowId reporting starting. This call would emmit - ///
##teamcity[flowStarted flowId='%lt;new flow id>' parent='current flow id']
- /// and - ///
##teamcity[flowFinished flowId='%lt;new flow id>']
- /// on writer dispose + /// Starts another flowId reporting starting. This call would emmit + ///
##teamcity[flowStarted flowId='%lt;new flow id>' parent='current flow id']
+ /// and + ///
##teamcity[flowFinished flowId='%lt;new flow id>']
+ /// on writer dispose ///
/// - /// Implementation is not thread-safe. Create an instance for each thread instead. + /// Implementation is not thread-safe. Create an instance for each thread instead. /// public interface ITeamCityFlowWriter where TCloseBlock : IDisposable { /// - /// Generates start flow message and returns disposable object to close flow + /// Generates start flow message and returns disposable object to close flow /// /// [NotNull] diff --git a/TeamCity.ServiceMessages/Write/Special/ITeamCityMessageWriter.cs b/TeamCity.ServiceMessages/Write/Special/ITeamCityMessageWriter.cs index e95c15c..e010306 100644 --- a/TeamCity.ServiceMessages/Write/Special/ITeamCityMessageWriter.cs +++ b/TeamCity.ServiceMessages/Write/Special/ITeamCityMessageWriter.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,31 +17,31 @@ namespace JetBrains.TeamCity.ServiceMessages.Write.Special { /// - /// Add a build log entry message - ///
-    ///         ##teamcity[message text='<message text>' errorDetails='<error details>' status='<status value>']
-    ///     
- /// http://confluence.jetbrains.net/display/TCD7/Build+Script+Interaction+with+TeamCity#BuildScriptInteractionwithTeamCity-ReportingMessagesForBuildLog + /// Add a build log entry message + ///
+    ///     ##teamcity[message text='<message text>' errorDetails='<error details>' status='<status value>']
+    /// 
+ /// http://confluence.jetbrains.net/display/TCD18/Build+Script+Interaction+with+TeamCity#BuildScriptInteractionwithTeamCity-ReportingMessagesForBuildLog ///
/// - /// Implementation is not thread-safe. Create an instance for each thread instead. + /// Implementation is not thread-safe. Create an instance for each thread instead. /// public interface ITeamCityMessageWriter { /// - /// Writes normal message + /// Writes normal message /// /// text void WriteMessage([NotNull] string text); /// - /// Writes warning message + /// Writes warning message /// /// text void WriteWarning([NotNull] string text); /// - /// Writes error message with details + /// Writes error message with details /// /// text /// error details diff --git a/TeamCity.ServiceMessages/Write/Special/ITeamCityServiceMessages.cs b/TeamCity.ServiceMessages/Write/Special/ITeamCityServiceMessages.cs index afe5e02..e682dcc 100644 --- a/TeamCity.ServiceMessages/Write/Special/ITeamCityServiceMessages.cs +++ b/TeamCity.ServiceMessages/Write/Special/ITeamCityServiceMessages.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,25 +19,25 @@ namespace JetBrains.TeamCity.ServiceMessages.Write.Special using System; /// - /// Factory interface for specialized service messages generation - /// Create instance of to get the implementation of the interface. + /// Factory interface for specialized service messages generation + /// Create instance of to get the implementation of the interface. /// public interface ITeamCityServiceMessages { /// - /// Created writer that generates service messages to a Console.Out + /// Created writer that generates service messages to a Console.Out /// /// - /// Implementation does not support multiple-threads. - /// If you need to log more me + /// Implementation does not support multiple-threads. + /// If you need to log more me /// /// [NotNull] ITeamCityWriter CreateWriter(); /// - /// Creates writer that translates service messages to the given - /// delegate. + /// Creates writer that translates service messages to the given + /// delegate. /// /// generated service messages processor /// @@ -45,7 +45,7 @@ public interface ITeamCityServiceMessages ITeamCityWriter CreateWriter(Action destination); /// - /// Adds user-specific service message updater to the list of service message updaters. + /// Adds user-specific service message updater to the list of service message updaters. /// /// updater instance void AddServiceMessageUpdater([NotNull] IServiceMessageUpdater updater); diff --git a/TeamCity.ServiceMessages/Write/Special/ITeamCityTestSuiteWriter.cs b/TeamCity.ServiceMessages/Write/Special/ITeamCityTestSuiteWriter.cs index 02fcf48..45c5035 100644 --- a/TeamCity.ServiceMessages/Write/Special/ITeamCityTestSuiteWriter.cs +++ b/TeamCity.ServiceMessages/Write/Special/ITeamCityTestSuiteWriter.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,15 +17,15 @@ namespace JetBrains.TeamCity.ServiceMessages.Write.Special { /// - /// TeamCity tests loggin in done in test suites. - /// To be able to logs tests you first need to open suite + /// TeamCity tests loggin in done in test suites. + /// To be able to logs tests you first need to open suite /// public interface ITeamCityTestSuiteWriter { /// - /// Opens tests suite with give name - ///
##teamcity[testSuiteStarted name='suite.name']
- /// To close suite, call Dispose method of a returned logger. + /// Opens tests suite with give name + ///
##teamcity[testSuiteStarted name='suite.name']
+ /// To close suite, call Dispose method of a returned logger. ///
/// suite name /// test logger. diff --git a/TeamCity.ServiceMessages/Write/Special/ITeamCityTestWriter.cs b/TeamCity.ServiceMessages/Write/Special/ITeamCityTestWriter.cs index b783704..ef7e5d7 100644 --- a/TeamCity.ServiceMessages/Write/Special/ITeamCityTestWriter.cs +++ b/TeamCity.ServiceMessages/Write/Special/ITeamCityTestWriter.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,50 +19,85 @@ namespace JetBrains.TeamCity.ServiceMessages.Write.Special using System; /// - /// Writer interface for generating test information service messages + /// Writer interface for generating test information service messages /// public interface ITeamCityTestWriter : IDisposable { /// - /// Attaches test output to the test + /// Attaches test output to the test /// /// test output void WriteStdOutput([NotNull] string text); /// - /// Attaches test error output to the test + /// Attaches test error output to the test /// /// error output void WriteErrOutput([NotNull] string text); /// - /// Marks test as ignored + /// Marks test as ignored /// /// test ignore reason void WriteIgnored([NotNull] string ignoreReason); /// - /// Marks test as ignored + /// Marks test as ignored /// void WriteIgnored(); /// - /// Marks test as failed. + /// Marks test as failed. /// /// short error message /// detailed error information, i.e. stacktrace /// - /// This method can be called only once. + /// This method can be called only once. /// void WriteFailed([NotNull] string errorMessage, [NotNull] string errorDetails); /// - /// Specifies test duration + /// Specifies test duration /// /// - /// TeamCity may compute test duration inself, to provide precise data, you may set the duration explicitly + /// TeamCity may compute test duration itself, to provide precise data, you may set the duration explicitly /// /// time of test void WriteDuration(TimeSpan duration); + + /// + /// Writes image as test metadata. Supported in TeamCity 2018.2+ https://confluence.jetbrains.com/display/TCD18/Reporting+Test+Metadata. + /// + /// The URI to the image in the build artifacts directory. Should be relative to the build artifacts directory. + /// The image description. When showing images, TeamCity shows both the ‘description’ and the filename of the referenced image. + void WriteImage([NotNull] string teamCityArtifactUri, [NotNull] string description = ""); + + /// + /// Writes file as test metadata. Supported in TeamCity 2018.2+ https://confluence.jetbrains.com/display/TCD18/Reporting+Test+Metadata. + /// + /// The URI to the file in the build artifacts directory. Should be relative to the build artifacts directory. + /// The file description. TeamCity shows both the ‘description’ and the filename of the referenced file. If a description was autogenerated, it is not shown. + void WriteFile([NotNull] string teamCityArtifactUri, [NotNull] string description = ""); + + /// + /// Writes number as test metadata. Supported in TeamCity 2018.2+ https://confluence.jetbrains.com/display/TCD18/Reporting+Test+Metadata. + /// + /// The metadata value. + /// The metadata name. + void WriteValue([NotNull] double value, [NotNull] string name); + + /// + /// Writes string value as test metadata. Supported in TeamCity 2018.2+ https://confluence.jetbrains.com/display/TCD18/Reporting+Test+Metadata. + /// + /// The metadata value. + /// The metadata name. + void WriteValue([NotNull] string value, [NotNull] string name); + + /// + /// Writes link as test metadata. Supported in TeamCity 2018.2+ https://confluence.jetbrains.com/display/TCD18/Reporting+Test+Metadata. + /// + /// The metadata URI. + /// The metadata name. + void WriteLink([NotNull] string linkUri, [NotNull] string name); } } \ No newline at end of file diff --git a/TeamCity.ServiceMessages/Write/Special/ITeamCityTestsWriter.cs b/TeamCity.ServiceMessages/Write/Special/ITeamCityTestsWriter.cs index dd6de74..c7639a8 100644 --- a/TeamCity.ServiceMessages/Write/Special/ITeamCityTestsWriter.cs +++ b/TeamCity.ServiceMessages/Write/Special/ITeamCityTestsWriter.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,20 +19,20 @@ namespace JetBrains.TeamCity.ServiceMessages.Write.Special using System; /// - /// This interface provides writers for test messages. - /// All, but test ignore messages are required to be reported from - ///
##teamcity[testStarted name='testname']
and - ///
##teamcity[testFinished name='testname' duration='<test_duration_in_milliseconds>']
- /// messages. - /// All tests reportings are done form this method. + /// This interface provides writers for test messages. + /// All, but test ignore messages are required to be reported from + ///
##teamcity[testStarted name='testname']
and + ///
##teamcity[testFinished name='testname' duration='<test_duration_in_milliseconds>']
+ /// messages. + /// All tests reportings are done form this method. ///
/// - /// Implementation is not thread-safe. Create an instance for each thread instead. + /// Implementation is not thread-safe. Create an instance for each thread instead. /// public interface ITeamCityTestsWriter : ITeamCityTestSuiteWriter { /// - /// To start reporting a test, call OpenTest method. To stop reporing test call Dispose on the given object + /// To start reporting a test, call OpenTest method. To stop reporing test call Dispose on the given object /// /// test name to be reported /// test output/status reporting handle @@ -41,7 +41,7 @@ public interface ITeamCityTestsWriter : ITeamCityTestSuiteWriter } /// - /// Sub inteface for created tests writer for some parent test suite. + /// Sub inteface for created tests writer for some parent test suite. /// public interface ITeamCityTestsSubWriter : ITeamCityTestsWriter, ITeamCityFlowWriter, IDisposable { diff --git a/TeamCity.ServiceMessages/Write/Special/ITeamCityWriter.cs b/TeamCity.ServiceMessages/Write/Special/ITeamCityWriter.cs index 1bbf07c..14724a1 100644 --- a/TeamCity.ServiceMessages/Write/Special/ITeamCityWriter.cs +++ b/TeamCity.ServiceMessages/Write/Special/ITeamCityWriter.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,18 +19,18 @@ namespace JetBrains.TeamCity.ServiceMessages.Write.Special using System; /// - /// Specialized service messages writer facade. Contains all methods for generating different service messages. - /// Do not forget to dispose this interface after you finished using it. - /// To get the instance of the interface, call - /// new JetBrains.TeamCity.ServiceMessages.Write.Special.TeamCityServiceMessages().CreateWriter + /// Specialized service messages writer facade. Contains all methods for generating different service messages. + /// Do not forget to dispose this interface after you finished using it. + /// To get the instance of the interface, call + /// new JetBrains.TeamCity.ServiceMessages.Write.Special.TeamCityServiceMessages().CreateWriter /// /// - /// Implementation is not thread-safe. Create an instance for each thread instead. + /// Implementation is not thread-safe. Create an instance for each thread instead. /// public interface ITeamCityWriter : ITeamCityBlockWriter, ITeamCityFlowWriter, ITeamCityMessageWriter, ITeamCityTestsWriter, ITeamCityCompilationBlockWriter, ITeamCityArtifactsWriter, ITeamCityBuildStatusWriter, IDisposable { /// - /// Allows sending bare service message + /// Allows sending bare service message /// /// message to send void WriteRawMessage([NotNull] IServiceMessage message); diff --git a/TeamCity.ServiceMessages/Write/Special/Impl/DefaultFlowIdGenerator.cs b/TeamCity.ServiceMessages/Write/Special/Impl/DefaultFlowIdGenerator.cs index 274c619..db66b9d 100644 --- a/TeamCity.ServiceMessages/Write/Special/Impl/DefaultFlowIdGenerator.cs +++ b/TeamCity.ServiceMessages/Write/Special/Impl/DefaultFlowIdGenerator.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,14 +20,14 @@ namespace JetBrains.TeamCity.ServiceMessages.Write.Special.Impl using System.Threading; /// - /// Helper class to generate FlowIds + /// Helper class to generate FlowIds /// public class DefaultFlowIdGenerator : IFlowIdGenerator { private static long ourIds; /// - /// Generates new unique FlowId + /// Generates new unique FlowId /// public string NewFlowId() { diff --git a/TeamCity.ServiceMessages/Write/Special/Impl/DisposableDelegate.cs b/TeamCity.ServiceMessages/Write/Special/Impl/DisposableDelegate.cs index 9070055..2f477f6 100644 --- a/TeamCity.ServiceMessages/Write/Special/Impl/DisposableDelegate.cs +++ b/TeamCity.ServiceMessages/Write/Special/Impl/DisposableDelegate.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/TeamCity.ServiceMessages/Write/Special/Impl/FlowServiceMessageWriter.cs b/TeamCity.ServiceMessages/Write/Special/Impl/FlowServiceMessageWriter.cs index 250bd55..242b78e 100644 --- a/TeamCity.ServiceMessages/Write/Special/Impl/FlowServiceMessageWriter.cs +++ b/TeamCity.ServiceMessages/Write/Special/Impl/FlowServiceMessageWriter.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ namespace JetBrains.TeamCity.ServiceMessages.Write.Special.Impl using Updater; /// - /// Servivce message acceptor implementation with support of IServiceMessageUpdater chains + /// Servivce message acceptor implementation with support of IServiceMessageUpdater chains /// public class FlowServiceMessageWriter : IFlowServiceMessageProcessor { @@ -31,7 +31,7 @@ public class FlowServiceMessageWriter : IFlowServiceMessageProcessor private readonly List _updaters; /// - /// Creates generic processor that calls messages updaters and sends output to provided deledate. + /// Creates generic processor that calls messages updaters and sends output to provided deledate. /// /// writer of service messages objects /// flow id generator that is called to create next flowId @@ -57,7 +57,7 @@ public void AddServiceMessage(IServiceMessage serviceMessage) public string FlowId => _updaters.OfType().First().FlowId; /// - /// Creates new ServiceMessage updater that uses specified FlowId + /// Creates new ServiceMessage updater that uses specified FlowId /// public IFlowServiceMessageProcessor ForNewFlow() { diff --git a/TeamCity.ServiceMessages/Write/Special/Impl/PatchedServiceMessage.cs b/TeamCity.ServiceMessages/Write/Special/Impl/PatchedServiceMessage.cs index c0cfabd..13bb238 100644 --- a/TeamCity.ServiceMessages/Write/Special/Impl/PatchedServiceMessage.cs +++ b/TeamCity.ServiceMessages/Write/Special/Impl/PatchedServiceMessage.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ namespace JetBrains.TeamCity.ServiceMessages.Write.Special.Impl using System.Linq; /// - /// Helper implementation of IServiceMessage + /// Helper implementation of IServiceMessage /// internal class PatchedServiceMessage : ServiceMessage { diff --git a/TeamCity.ServiceMessages/Write/Special/Impl/ServiceMessagesWriter.cs b/TeamCity.ServiceMessages/Write/Special/Impl/ServiceMessagesWriter.cs index 839db03..a48ebcd 100644 --- a/TeamCity.ServiceMessages/Write/Special/Impl/ServiceMessagesWriter.cs +++ b/TeamCity.ServiceMessages/Write/Special/Impl/ServiceMessagesWriter.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ namespace JetBrains.TeamCity.ServiceMessages.Write.Special.Impl using System; /// - /// Simple implementation of ServiceMessage + /// Simple implementation of ServiceMessage /// public class ServiceMessagesWriter : IServiceMessageProcessor { diff --git a/TeamCity.ServiceMessages/Write/Special/Impl/TeamCityWriterFacade.cs b/TeamCity.ServiceMessages/Write/Special/Impl/TeamCityWriterFacade.cs index a59b733..56f515c 100644 --- a/TeamCity.ServiceMessages/Write/Special/Impl/TeamCityWriterFacade.cs +++ b/TeamCity.ServiceMessages/Write/Special/Impl/TeamCityWriterFacade.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -129,7 +129,6 @@ public virtual void Dispose() public void PublishArtifact(string rules) { if (rules == null) throw new ArgumentNullException(nameof(rules)); - CheckConsistency(); _artifactsWriter.PublishArtifact(rules); } diff --git a/TeamCity.ServiceMessages/Write/Special/Impl/TeamCityWriterImpl.cs b/TeamCity.ServiceMessages/Write/Special/Impl/TeamCityWriterImpl.cs index 93c60fe..f43af2a 100644 --- a/TeamCity.ServiceMessages/Write/Special/Impl/TeamCityWriterImpl.cs +++ b/TeamCity.ServiceMessages/Write/Special/Impl/TeamCityWriterImpl.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/TeamCity.ServiceMessages/Write/Special/Impl/Updater/FlowMessageUpdater.cs b/TeamCity.ServiceMessages/Write/Special/Impl/Updater/FlowMessageUpdater.cs index 0ddaa86..7226eba 100644 --- a/TeamCity.ServiceMessages/Write/Special/Impl/Updater/FlowMessageUpdater.cs +++ b/TeamCity.ServiceMessages/Write/Special/Impl/Updater/FlowMessageUpdater.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,39 +19,33 @@ namespace JetBrains.TeamCity.ServiceMessages.Write.Special.Impl.Updater using System; /// - /// Service message updater that adds FlowId to service message according to - /// http://confluence.jetbrains.net/display/TCD7/Build+Script+Interaction+with+TeamCity + /// Service message updater that adds FlowId to service message according to + /// http://confluence.jetbrains.net/display/TCD18/Build+Script+Interaction+with+TeamCity /// public class FlowMessageUpdater : IServiceMessageUpdater { - private readonly IFlowIdGenerator _flowId; - /// - /// Custructs updater + /// Constructs updater /// /// flowId set to all messages public FlowMessageUpdater([NotNull] string flowId) { - if (flowId == null) throw new ArgumentNullException(nameof(flowId)); - FlowId = flowId; + FlowId = flowId ?? throw new ArgumentNullException(nameof(flowId)); } /// - /// Creates flow id from given generator instance + /// Creates flow id from given generator instance /// /// public FlowMessageUpdater([NotNull] IFlowIdGenerator flowId) : this(flowId.NewFlowId()) { - if (flowId == null) throw new ArgumentNullException(nameof(flowId)); - _flowId = flowId; } public string FlowId { [NotNull] get; } public IServiceMessage UpdateServiceMessage(IServiceMessage message) { - if (message.DefaultValue != null) return message; - return new PatchedServiceMessage(message) {{"flowId", FlowId}}; + return message.DefaultValue != null ? message : new PatchedServiceMessage(message) {{"flowId", FlowId}}; } } } \ No newline at end of file diff --git a/TeamCity.ServiceMessages/Write/Special/Impl/Updater/TimestampUpdater.cs b/TeamCity.ServiceMessages/Write/Special/Impl/Updater/TimestampUpdater.cs index d5c984e..de7117d 100644 --- a/TeamCity.ServiceMessages/Write/Special/Impl/Updater/TimestampUpdater.cs +++ b/TeamCity.ServiceMessages/Write/Special/Impl/Updater/TimestampUpdater.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,8 +20,8 @@ namespace JetBrains.TeamCity.ServiceMessages.Write.Special.Impl.Updater using System.Globalization; /// - /// Service message updater that adds Timestamp to service message according to - /// http://confluence.jetbrains.net/display/TCD7/Build+Script+Interaction+with+TeamCity + /// Service message updater that adds Timestamp to service message according to + /// http://confluence.jetbrains.net/display/TCD18/Build+Script+Interaction+with+TeamCity /// public class TimestampUpdater : IServiceMessageUpdater { @@ -29,8 +29,7 @@ public class TimestampUpdater : IServiceMessageUpdater public TimestampUpdater([NotNull] Func timeService) { - if (timeService == null) throw new ArgumentNullException(nameof(timeService)); - _timeService = timeService; + _timeService = timeService ?? throw new ArgumentNullException(nameof(timeService)); } public IServiceMessage UpdateServiceMessage(IServiceMessage message) diff --git a/TeamCity.ServiceMessages/Write/Special/Impl/ValueServiceMessage.cs b/TeamCity.ServiceMessages/Write/Special/Impl/ValueServiceMessage.cs index c654d72..8f930c4 100644 --- a/TeamCity.ServiceMessages/Write/Special/Impl/ValueServiceMessage.cs +++ b/TeamCity.ServiceMessages/Write/Special/Impl/ValueServiceMessage.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/TeamCity.ServiceMessages/Write/Special/Impl/Writer/BaseDisposableWriter.cs b/TeamCity.ServiceMessages/Write/Special/Impl/Writer/BaseDisposableWriter.cs index 259b29d..f89c775 100644 --- a/TeamCity.ServiceMessages/Write/Special/Impl/Writer/BaseDisposableWriter.cs +++ b/TeamCity.ServiceMessages/Write/Special/Impl/Writer/BaseDisposableWriter.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/TeamCity.ServiceMessages/Write/Special/Impl/Writer/BaseWriter.cs b/TeamCity.ServiceMessages/Write/Special/Impl/Writer/BaseWriter.cs index c2a39e4..e48cfac 100644 --- a/TeamCity.ServiceMessages/Write/Special/Impl/Writer/BaseWriter.cs +++ b/TeamCity.ServiceMessages/Write/Special/Impl/Writer/BaseWriter.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/TeamCity.ServiceMessages/Write/Special/Impl/Writer/IChildInfoProvider.cs b/TeamCity.ServiceMessages/Write/Special/Impl/Writer/IChildInfoProvider.cs index 5395702..2ee3e8d 100644 --- a/TeamCity.ServiceMessages/Write/Special/Impl/Writer/IChildInfoProvider.cs +++ b/TeamCity.ServiceMessages/Write/Special/Impl/Writer/IChildInfoProvider.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,13 +19,13 @@ namespace JetBrains.TeamCity.ServiceMessages.Write.Special.Impl.Writer using System; /// - /// Represents information about currently openned child blocks or tests or test suites. + /// Represents information about currently openned child blocks or tests or test suites. /// public interface ISubWriter : IDisposable { /// - /// This method performs check if no child blocks are opennd. - /// It is used to check if it is allowed to use current I*Writer + /// This method performs check if no child blocks are opennd. + /// It is used to check if it is allowed to use current I*Writer /// void AssertNoChildOpened(); } diff --git a/TeamCity.ServiceMessages/Write/Special/Impl/Writer/TeamCityArtifactsWriter.cs b/TeamCity.ServiceMessages/Write/Special/Impl/Writer/TeamCityArtifactsWriter.cs index 9c1b5c3..bd470dd 100644 --- a/TeamCity.ServiceMessages/Write/Special/Impl/Writer/TeamCityArtifactsWriter.cs +++ b/TeamCity.ServiceMessages/Write/Special/Impl/Writer/TeamCityArtifactsWriter.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/TeamCity.ServiceMessages/Write/Special/Impl/Writer/TeamCityBlockWriter.cs b/TeamCity.ServiceMessages/Write/Special/Impl/Writer/TeamCityBlockWriter.cs index abe1b42..df0c369 100644 --- a/TeamCity.ServiceMessages/Write/Special/Impl/Writer/TeamCityBlockWriter.cs +++ b/TeamCity.ServiceMessages/Write/Special/Impl/Writer/TeamCityBlockWriter.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/TeamCity.ServiceMessages/Write/Special/Impl/Writer/TeamCityBuildStatusWriter.cs b/TeamCity.ServiceMessages/Write/Special/Impl/Writer/TeamCityBuildStatusWriter.cs index 2ec5c12..6d2d10c 100644 --- a/TeamCity.ServiceMessages/Write/Special/Impl/Writer/TeamCityBuildStatusWriter.cs +++ b/TeamCity.ServiceMessages/Write/Special/Impl/Writer/TeamCityBuildStatusWriter.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/TeamCity.ServiceMessages/Write/Special/Impl/Writer/TeamCityCompilationBlockWriter.cs b/TeamCity.ServiceMessages/Write/Special/Impl/Writer/TeamCityCompilationBlockWriter.cs index fa404af..124e0bd 100644 --- a/TeamCity.ServiceMessages/Write/Special/Impl/Writer/TeamCityCompilationBlockWriter.cs +++ b/TeamCity.ServiceMessages/Write/Special/Impl/Writer/TeamCityCompilationBlockWriter.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/TeamCity.ServiceMessages/Write/Special/Impl/Writer/TeamCityFlowWriter.cs b/TeamCity.ServiceMessages/Write/Special/Impl/Writer/TeamCityFlowWriter.cs index 1d9f28d..216f68b 100644 --- a/TeamCity.ServiceMessages/Write/Special/Impl/Writer/TeamCityFlowWriter.cs +++ b/TeamCity.ServiceMessages/Write/Special/Impl/Writer/TeamCityFlowWriter.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/TeamCity.ServiceMessages/Write/Special/Impl/Writer/TeamCityMessageWriter.cs b/TeamCity.ServiceMessages/Write/Special/Impl/Writer/TeamCityMessageWriter.cs index 3342a16..f3a0966 100644 --- a/TeamCity.ServiceMessages/Write/Special/Impl/Writer/TeamCityMessageWriter.cs +++ b/TeamCity.ServiceMessages/Write/Special/Impl/Writer/TeamCityMessageWriter.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/TeamCity.ServiceMessages/Write/Special/Impl/Writer/TeamCityTestSuiteBlock.cs b/TeamCity.ServiceMessages/Write/Special/Impl/Writer/TeamCityTestSuiteBlock.cs index 88a9e36..1ad8501 100644 --- a/TeamCity.ServiceMessages/Write/Special/Impl/Writer/TeamCityTestSuiteBlock.cs +++ b/TeamCity.ServiceMessages/Write/Special/Impl/Writer/TeamCityTestSuiteBlock.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/TeamCity.ServiceMessages/Write/Special/Impl/Writer/TeamCityTestWriter.cs b/TeamCity.ServiceMessages/Write/Special/Impl/Writer/TeamCityTestWriter.cs index 2e1bd5b..afb0ae2 100644 --- a/TeamCity.ServiceMessages/Write/Special/Impl/Writer/TeamCityTestWriter.cs +++ b/TeamCity.ServiceMessages/Write/Special/Impl/Writer/TeamCityTestWriter.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,13 +24,12 @@ public class TeamCityTestWriter : BaseDisposableWriter private readonly string _testName; private TimeSpan? _duration; - public TeamCityTestWriter([NotNull] IServiceMessageProcessor target, [NotNull] string testName, [NotNull] IDisposable disposableHander) - : base(target, disposableHander) + public TeamCityTestWriter([NotNull] IServiceMessageProcessor target, [NotNull] string testName, [NotNull] IDisposable disposableHandler) + : base(target, disposableHandler) { if (target == null) throw new ArgumentNullException(nameof(target)); - if (testName == null) throw new ArgumentNullException(nameof(testName)); - if (disposableHander == null) throw new ArgumentNullException(nameof(disposableHander)); - _testName = testName; + if (disposableHandler == null) throw new ArgumentNullException(nameof(disposableHandler)); + _testName = testName ?? throw new ArgumentNullException(nameof(testName)); } public void WriteStdOutput(string text) @@ -70,6 +69,51 @@ public void WriteDuration(TimeSpan span) _duration = span; } + public void WriteImage(string teamCityArtifactUri, string description = "") + { + if (string.IsNullOrEmpty(teamCityArtifactUri)) throw new ArgumentException(nameof(teamCityArtifactUri)); + if (description == null) throw new ArgumentNullException(nameof(description)); + var message = new ServiceMessage("testMetadata") {{"testName", _testName}, {"type", "image"}, {"value", teamCityArtifactUri}}; + if (!string.IsNullOrEmpty(description)) + { + message.Add("name", description); + } + + PostMessage(message); + } + + public void WriteFile(string teamCityArtifactUri, string description = "") + { + if (string.IsNullOrEmpty(teamCityArtifactUri)) throw new ArgumentException(nameof(teamCityArtifactUri)); + if (description == null) throw new ArgumentNullException(nameof(description)); + var message = new ServiceMessage("testMetadata") {{"testName", _testName}, {"type", "artifact"}, {"value", teamCityArtifactUri}}; + if (!string.IsNullOrEmpty(description)) + { + message.Add("name", description); + } + + PostMessage(message); + } + + public void WriteValue(double value, string name) + { + if (string.IsNullOrEmpty(name)) throw new ArgumentException(nameof(name)); + PostMessage(new ServiceMessage("testMetadata") {{"testName", _testName}, {"type", "number"}, {"value", value.ToString(CultureInfo.InvariantCulture)}, {"name", name}}); + } + + public void WriteValue(string value, string name) + { + if (string.IsNullOrEmpty(name)) throw new ArgumentException(nameof(name)); + PostMessage(new ServiceMessage("testMetadata") {{"testName", _testName}, {"value", value}, {"name", name}}); + } + + public void WriteLink(string linkUri, string name) + { + if (string.IsNullOrEmpty(linkUri)) throw new ArgumentException(nameof(linkUri)); + if (string.IsNullOrEmpty(name)) throw new ArgumentException(nameof(name)); + PostMessage(new ServiceMessage("testMetadata") {{"testName", _testName}, {"type", "link"}, {"value", linkUri}, {"name", name}}); + } + public void OpenTest() { PostMessage(new ServiceMessage("testStarted") {{"name", _testName}, {"captureStandardOutput", "false"}}); diff --git a/TeamCity.ServiceMessages/Write/Special/TeamCityServiceMessages.cs b/TeamCity.ServiceMessages/Write/Special/TeamCityServiceMessages.cs index 049e9a7..bbc8464 100644 --- a/TeamCity.ServiceMessages/Write/Special/TeamCityServiceMessages.cs +++ b/TeamCity.ServiceMessages/Write/Special/TeamCityServiceMessages.cs @@ -1,5 +1,5 @@ /* - * Copyright 2007-2017 JetBrains s.r.o. + * Copyright 2007-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ namespace JetBrains.TeamCity.ServiceMessages.Write.Special using Impl.Updater; /// - /// Basic implementation of TeamCity service message generation facade + /// Basic implementation of TeamCity service message generation facade /// public class TeamCityServiceMessages : ITeamCityServiceMessages { @@ -35,7 +35,7 @@ public TeamCityServiceMessages() } /// - /// Most specific constructor. Could be used with DI + /// Most specific constructor. Could be used with DI /// public TeamCityServiceMessages( [NotNull] IServiceMessageFormatter formatter,