public void TestPassed() { var sitecoreConfiguration = new SitecoreInstance { InstanceName = "cd1", ServerRoles = new[] { ServerRole.ContentDelivery }, Version = new SitecoreVersion(8, 2, 2), Configuration = new XmlDocument() .Create( "/configuration/sitecore/"), IncludeFiles = new Map <ConfigurationFile>(x => x.FilePath) { { new ConfigurationFile("App_Config/Include/ListManagement/Sitecore.Helpers.config", "<configuration><sitecore></sitecore></configuration>") }, { new ConfigurationFile("App_Config/Include/ListManagement/Sitecore.Services.config", "<configuration><sitecore></sitecore></configuration>") }, }, InstalledModules = new Map <IReleaseInfo>(x => x.Release.ProductName) { { new ReleaseInfo(ServiceClientBuilder.Create().Build().Products["Email Experience Manager"].Versions["3.4.1"]) } }, }; new SolutionUnitTestContext() .AddInstance(sitecoreConfiguration) .Process(this) .Done(); }
public void TestPassed() { var sitecoreConfiguration = new SitecoreInstance { InstanceName = "cd1", ServerRoles = new[] { ServerRole.ContentDelivery }, Configuration = new XmlDocument().Create("/configuration/sitecore/settings/setting[@name='Analytics.DefaultDefinitionDatabase' and @value='web']"), Version = new SitecoreVersion(8, 2, 3), InstalledModules = new Map <IReleaseInfo>(x => x.Release.ProductName) { { new ReleaseInfo(ServiceClientBuilder.Create().Build().Products["Email Experience Manager"].Versions["3.4.1"]) } }, }; new SolutionUnitTestContext() .AddInstance(sitecoreConfiguration) .Process(this) .Done(); }
public void TestFailed() { var sitecoreConfiguration = new SitecoreInstance { InstanceName = "cd1", ServerRoles = new[] { ServerRole.ContentDelivery }, Configuration = new XmlDocument().Create("/configuration/sitecore/settings"), //no setting means "master" database is used. Version = new SitecoreVersion(8, 2, 2), InstalledModules = new Map <IReleaseInfo>(x => x.Release.ProductName) { { new ReleaseInfo(ServiceClientBuilder.Create().Build().Products["Email Experience Manager"].Versions["3.4.1"]) } }, }; new SolutionUnitTestContext() .AddInstance(sitecoreConfiguration) .Process(this) .MustReturn(new TestOutput(TestResultState.Warning, ErrorMessage)) .Done(); }
public static void Main(string[] args) { var endPoint = ProtocolEndPointBase.CreateEndPoint("tcp://127.0.0.1:6900"); _client = new TestClientImplementation(); _serviceClient = ServiceClientBuilder.CreateClient <ITestServerService>(endPoint, _client); _serviceClient.Connected += ClientOnConnected; _serviceClient.Disconnected += ClientOnDisconnected; _serviceClient.Connect(); do { var cmd = Console.ReadLine(); if (cmd == "exit") { _serviceClient.Disconnect(); } if (cmd == "void") { _serviceClient.ServiceProxy.RemoteVoid(); } if (cmd == "magic") { var poco = new SimplePoco { Id = 1, Title = "My POCO obj" }; _serviceClient.ServiceProxy.SomeRemoteMagic(poco); } if (cmd == "ex") { _serviceClient.ServiceProxy.RaiseTheException(); } } while (_serviceClient.CommunicationState == CommunicationStates.Connected); Console.WriteLine("Press any key to exit."); Console.Read(); }
public void TestFailed() { var sitecoreConfiguration = new SitecoreInstance { InstanceName = "cd1", ServerRoles = new[] { ServerRole.ContentDelivery }, Version = new SitecoreVersion(8, 2, 2), Configuration = new XmlDocument(), IncludeFiles = new Map <ConfigurationFile>(x => x.FilePath) { { new ConfigurationFile("App_Config/Include/ListManagement/Sitecore.ListManagement.config", "<configuration><sitecore></sitecore></configuration>") }, { new ConfigurationFile("App_Config/Include/ListManagement/Sitecore.ListManagement.Services.config", "<configuration><sitecore></sitecore></configuration>") }, }, InstalledModules = new Map <IReleaseInfo>(x => x.Release.ProductName) { { new ReleaseInfo(ServiceClientBuilder.Create().Build().Products["Email Experience Manager"].Versions["3.4.1"]) } }, }; new SolutionUnitTestContext() .AddInstance(sitecoreConfiguration) .Process(this) .MustReturn(new TestOutput(TestResultState.Warning, ErrorMessage(), data: GetMessage( new List <string>() { "App_Config/Include/ListManagement/Sitecore.ListManagement.config", "App_Config/Include/ListManagement/Sitecore.ListManagement.Services.config" }))) .Done(); }
public static void Main(string[] args) { var serverConfiguration = Factory.Create <Provider>("conf/client.xml"); var dynamicConfig = serverConfiguration.FirstAsExpando().configuration; string address = string.Format("tcp://{0}:{1}", dynamicConfig.zeus.host, dynamicConfig.zeus.port); var endPoint = ProtocolEndPointBase.CreateEndPoint(address); _service = ServiceClientBuilder.CreateClient <IClientService>(endPoint); _service.Connected += (o, a) => Console.WriteLine("Connection to auth-server successfull!"); _service.Disconnected += (o, a) => Console.WriteLine("Connection to inter-server lost."); _service.ConnectTimeout = 30; _service.Connect(); do { var cmd = Console.ReadLine(); if (cmd == "exit") { _service.Disconnect(); } if (cmd == "login") { var account = _service.ServiceProxy.ClientLogin("test", "test"); Console.WriteLine("Got account info: {0}", account); } if (cmd == "servers") { var servers = _service.ServiceProxy.GetServerDescriptions(); Console.WriteLine("Got server info:"); servers.ToList().ForEach(s => Console.WriteLine("\t{0}", s)); } } while (_service.CommunicationState == CommunicationStates.Connected); Console.WriteLine("Press any key to exit."); Console.Read(); }
public static void Main(string[] args) { // Try access a config var serverConfiguration = Factory.Create <Provider>("conf/server.xml"); var dynamicConfig = serverConfiguration.FirstAsExpando().configuration; // Prepare console for a large output #if WINDOWS var width = Math.Min(100, Console.LargestWindowWidth - 2); Console.CursorVisible = false; Console.Clear(); Console.WindowLeft = Console.WindowTop = 0; if (Console.WindowWidth < width) { Console.WindowWidth = width; } #endif var ver = Assembly.GetExecutingAssembly().GetName().Version; Console.Title = string.Format("Zeus auth-server v{0}.{1}", ver.Major, ver.Minor); ServerConsole.StatusLine(Console.Title); // Create inter-server listener service string interServerEndPointAddress = string.Format("tcp://{0}:{1}", dynamicConfig.network.inter_server.host, dynamicConfig.network.inter_server.port); var interServerEndPoint = ProtocolEndPointBase.CreateEndPoint(interServerEndPointAddress); ServerConsole.Info("Start connecting to inter-server.."); // @TODO: Is any action coming from inter-server to auth-server? // @TODO: Create inter -> auth service (character goes back to char select) _interClient = ServiceClientBuilder.CreateClient <IAuthService>(interServerEndPoint, new ServerServiceImplementation()); _interClient.Connected += (o, a) => { ServerConsole.WriteLine(ServerConsoleColor.Status, " successfull!"); // AuthServerLogin _interClient.ServiceProxy.AuthServerLogin((string)dynamicConfig.network.inter_server.password); }; _interClient.Disconnected += delegate { ServerConsole.ErrorLine("Connection to inter-server lost."); // @TODO: Reconnect? }; _interClient.ConnectTimeout = 30; _interClient.Connect(); // Create a client listener service string endPointAddress = string.Format("tcp://{0}:{1}", dynamicConfig.network.host, dynamicConfig.network.port); _clientService = ServiceBuilder.CreateService(ProtocolEndPointBase.CreateEndPoint(endPointAddress)); _clientService.ClientConnected += (sender, clientEventArgs) => ServerConsole.DebugLine("Client connected #{0}", clientEventArgs.Client.ClientId); _clientService.ClientDisconnected += (sender, clientEventArgs) => ServerConsole.DebugLine("Client disconnected #{0}", clientEventArgs.Client.ClientId); // Add interface for client connections var clientService = new ClientServiceImplementation(_interClient.ServiceProxy); _clientService.AddService <IClientService, ClientServiceImplementation>(clientService); // Start listener service _clientService.Start(); ServerConsole.StatusLine("Auth-server is listening to: {0}", endPointAddress); do { var cmd = Console.ReadLine(); if (cmd == "exit") { _clientService.Stop(); } } while (_clientService.Connected); ServerConsole.WarningLine("Press any key to exit."); Console.Read(); }