@@ -67,21 +67,6 @@ public ClientAgentCommunicationTests(
6767 //_machineName = $"Machine{_fixture.CurrentAgentPort}";
6868
6969 var devicesFile = "devices.xml" ;
70-
71- var configuration = new ShdrAgentConfiguration
72- {
73- Port = _fixture . CurrentAgentPort ,
74- Adapters = new List < ShdrAdapterClientConfiguration > ( )
75- {
76- new ( )
77- {
78- DeviceKey = _machineName ,
79- Hostname = "localhost" ,
80- Port = _fixture . CurrentAdapterPort
81- }
82- }
83- } ;
84-
8570 GenerateDevicesXml (
8671 _machineId ,
8772 _machineName ,
@@ -93,10 +78,20 @@ public ClientAgentCommunicationTests(
9378
9479 AddCuttingTools ( ) ;
9580
96- _agent = new MTConnectAgentBroker ( configuration ) ;
81+ _agent = new MTConnectAgentBroker ( ) ;
9782 //_agent.Version = new Version(1, 8);
9883 _agent . Start ( ) ;
9984
85+ var adapters = new List < ShdrAdapterClientConfiguration > ( )
86+ {
87+ new ( )
88+ {
89+ DeviceKey = _machineName ,
90+ Hostname = "localhost" ,
91+ Port = _fixture . CurrentAdapterPort
92+ }
93+ } ;
94+
10095 // Add Adapter Clients
10196 var devices = DeviceConfiguration . FromFile ( devicesFile , DocumentFormat . XML ) . ToList ( ) ;
10297 if ( ! devices . IsNullOrEmpty ( ) )
@@ -107,7 +102,7 @@ public ClientAgentCommunicationTests(
107102 _agent . AddDevice ( device ) ;
108103 }
109104
110- foreach ( var adapterConfiguration in configuration . Adapters )
105+ foreach ( var adapterConfiguration in adapters )
111106 {
112107 var device = devices . FirstOrDefault ( o => o . Name == adapterConfiguration . DeviceKey ) ;
113108 if ( device != null )
@@ -119,6 +114,10 @@ public ClientAgentCommunicationTests(
119114 }
120115 }
121116
117+ var configuration = new HttpServerConfiguration
118+ {
119+ Port = _fixture . CurrentAgentPort
120+ } ;
122121 _server = new MTConnectHttpServer ( configuration , _agent ) ;
123122 _server . Start ( ) ;
124123 }
0 commit comments