Skip to content

Commit b2fce0b

Browse files
committed
Added client classes to the Telemetry System exercise, to better simulate real-life scenarios with dependencies on classes to be refactored.
1 parent 3a36e6e commit b2fce0b

File tree

4 files changed

+79
-0
lines changed

4 files changed

+79
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package tddmicroexercises.telemetrysystem.somedependencies;
2+
3+
import tddmicroexercises.telemetrysystem.TelemetryClient;
4+
5+
public class TelemetryClientClient
6+
{
7+
// A class with the only goal of simulating a dependency on TelemetryClient
8+
// that has impact on the refactoring.
9+
10+
public TelemetryClientClient()
11+
{
12+
TelemetryClient tc = new TelemetryClient();
13+
if (!tc.getOnlineStatus())
14+
tc.connect("a connection string");
15+
16+
tc.send("some message");
17+
18+
String response = tc.receive();
19+
20+
tc.disconnect();
21+
22+
}
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package tddmicroexercises.telemetrysystem.somedependencies;
2+
3+
import tddmicroexercises.telemetrysystem.TelemetryDiagnosticControls;
4+
5+
public class TelemetryDiagnosticControlsClient1
6+
{
7+
// A class with the only goal of simulating a dependency on TelemetryDiagnosticControls
8+
// that has impact on the refactoring.
9+
10+
public TelemetryDiagnosticControlsClient1() throws Exception {
11+
12+
TelemetryDiagnosticControls teleDiagnostic = new TelemetryDiagnosticControls();
13+
14+
teleDiagnostic.checkTransmission();
15+
16+
String result = teleDiagnostic.getDiagnosticInfo();
17+
}
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package tddmicroexercises.telemetrysystem.somedependencies;
2+
3+
import tddmicroexercises.telemetrysystem.TelemetryDiagnosticControls;
4+
5+
public class TelemetryDiagnosticControlsClient2
6+
{
7+
// A class with the only goal of simulating a dependency on TelemetryDiagnosticControls
8+
// that has impact on the refactoring.
9+
10+
public TelemetryDiagnosticControlsClient2() throws Exception {
11+
12+
TelemetryDiagnosticControls teleDiagnostic = new TelemetryDiagnosticControls();
13+
14+
teleDiagnostic.checkTransmission();
15+
16+
String result = teleDiagnostic.getDiagnosticInfo();
17+
}
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package tddmicroexercises.telemetrysystem.somedependencies;
2+
3+
import tddmicroexercises.telemetrysystem.TelemetryDiagnosticControls;
4+
5+
public class TelemetryDiagnosticControlsClient3
6+
{
7+
// A class with the only goal of simulating a dependency on TelemetryDiagnosticControls
8+
// that has impact on the refactoring.
9+
10+
public TelemetryDiagnosticControlsClient3() throws Exception {
11+
12+
TelemetryDiagnosticControls teleDiagnostic = new TelemetryDiagnosticControls();
13+
14+
teleDiagnostic.checkTransmission();
15+
16+
String result = teleDiagnostic.getDiagnosticInfo();
17+
}
18+
}
19+
20+

0 commit comments

Comments
 (0)