Permalink
Browse files

Moved Java version from Peter Rhys Thomas from the ProposedSolution f…

…older to the YourSolutions forlder.

Added language to the folders name in the YourSolutiond folders.
Updated readme.
  • Loading branch information...
lucaminudel committed Sep 9, 2012
1 parent 91c56cb commit 9575b7e3bab5bdeec0339ecb0dddbaa6ffafb2fc
Showing with 464 additions and 464 deletions.
  1. +2 −2 README.md
  2. 0 ...xercises.ProposedSolution → TDDMicroExercises.YoursSolutions/Java-Roberto-Simoni}/Java/.gitignore
  3. 0 TDDMicroExercises.YoursSolutions/{Roberto-Simoni → Java-Roberto-Simoni}/Java/TextConverter/pom.xml
  4. 0 ...→ Java-Roberto-Simoni}/Java/TextConverter/src/main/java/tddmicroexercises/textconvertor/Text.java
  5. 0 ...va-Roberto-Simoni}/Java/TextConverter/src/test/java/tddmicroexercises/textconvertor/TextTest.java
  6. +6 −6 TDDMicroExercises.YoursSolutions/{Roberto-Simoni/Java → Java-peterrhysthomas}/.gitignore
  7. +14 −14 ...sedSolution/Java → TDDMicroExercises.YoursSolutions/Java-peterrhysthomas}/TelemetrySystem/pom.xml
  8. +10 −10 ...peterrhysthomas}/TelemetrySystem/src/main/java/tddmicroexercises/telemetrysystem/IConnection.java
  9. +10 −10 ...eterrhysthomas}/TelemetrySystem/src/main/java/tddmicroexercises/telemetrysystem/IDataChannel.java
  10. 0 ...sthomas}/TelemetrySystem/src/main/java/tddmicroexercises/telemetrysystem/TelemetryConnection.java
  11. +67 −67 ...thomas}/TelemetrySystem/src/main/java/tddmicroexercises/telemetrysystem/TelemetryDataChannel.java
  12. 0 .../TelemetrySystem/src/main/java/tddmicroexercises/telemetrysystem/TelemetryDiagnosticControls.java
  13. +38 −38 ...mas}/TelemetrySystem/src/test/java/tddmicroexercises/telemetrysystem/TelemetryConnectionMock.java
  14. +24 −24 ...as}/TelemetrySystem/src/test/java/tddmicroexercises/telemetrysystem/TelemetryDataChannelMock.java
  15. 0 ...em/src/test/java/tddmicroexercises/telemetrysystem/TelemetryDiagnosticControlsCoveringsTests.java
  16. 0 ...emetrySystem/src/test/java/tddmicroexercises/telemetrysystem/TelemetryDiagnosticControlsTest.java
  17. +19 −19 ...posedSolution/Java → TDDMicroExercises.YoursSolutions/Java-peterrhysthomas}/TextConverter/pom.xml
  18. +20 −20 ...hysthomas}/TextConverter/src/main/java/tddmicroexercises/textconvertor/FileUnicodeDataSource.java
  19. +9 −9 ...terrhysthomas}/TextConverter/src/main/java/tddmicroexercises/textconvertor/UnicodeDataSource.java
  20. 0 ...}/TextConverter/src/main/java/tddmicroexercises/textconvertor/UnicodeFileToHtmlTextConverter.java
  21. +3 −3 ...ava → TDDMicroExercises.YoursSolutions/Java-peterrhysthomas}/TextConverter/src/test/java/data.txt
  22. +23 −23 ...hysthomas}/TextConverter/src/test/java/tddmicroexercises/textconvertor/UnicodeDataSourceStub.java
  23. +18 −18 ...r/src/test/java/tddmicroexercises/textconvertor/UnicodeFileToHtmlTextConverterCoveringsTests.java
  24. +35 −35 ...tConverter/src/test/java/tddmicroexercises/textconvertor/UnicodeFileToHtmlTextConverterTests.java
  25. +14 −14 ...ava → TDDMicroExercises.YoursSolutions/Java-peterrhysthomas}/TirePressureMonitoringSystem/pom.xml
  26. 0 ...ePressureMonitoringSystem/src/main/java/tddmicroexercises/tirepressuremonitoringsystem/Alarm.java
  27. +6 −6 ...ressureMonitoringSystem/src/main/java/tddmicroexercises/tirepressuremonitoringsystem/ISensor.java
  28. 0 ...PressureMonitoringSystem/src/main/java/tddmicroexercises/tirepressuremonitoringsystem/Sensor.java
  29. +54 −54 ...sureMonitoringSystem/src/test/java/tddmicroexercises/tirepressuremonitoringsystem/AlarmTests.java
  30. +18 −18 ...sureMonitoringSystem/src/test/java/tddmicroexercises/tirepressuremonitoringsystem/StubSensor.java
  31. +14 −14 ...olution/Java → TDDMicroExercises.YoursSolutions/Java-peterrhysthomas}/TurnTicketDispenser/pom.xml
  32. +6 −6 .../TurnTicketDispenser/src/main/java/tddmicroexercises/turnticketdispenser/ITurnNumberSequence.java
  33. 0 ...mas}/TurnTicketDispenser/src/main/java/tddmicroexercises/turnticketdispenser/TicketDispenser.java
  34. 0 ...}/TurnTicketDispenser/src/main/java/tddmicroexercises/turnticketdispenser/TurnNumberSequence.java
  35. 0 ...ysthomas}/TurnTicketDispenser/src/main/java/tddmicroexercises/turnticketdispenser/TurnTicket.java
  36. +11 −11 ...rnTicketDispenser/src/test/java/tddmicroexercises/turnticketdispenser/MockTurnNumberSequence.java
  37. +18 −18 ...penser/src/test/java/tddmicroexercises/turnticketdispenser/TurnTicketDispenserCoveringsTests.java
  38. +25 −25 ...TicketDispenser/src/test/java/tddmicroexercises/turnticketdispenser/TurnTicketDispenserTests.java
  39. 0 TDDMicroExercises.YoursSolutions/{Sam-Serpoosh → Ruby-Sam-Serpoosh}/.gitignore
  40. 0 ...cises.YoursSolutions/{Sam-Serpoosh → Ruby-Sam-Serpoosh}/code/telemetry_system/telemetry_client.rb
  41. 0 ...lutions/{Sam-Serpoosh → Ruby-Sam-Serpoosh}/code/telemetry_system/telemetry_diagnostic_controls.rb
  42. 0 ...s.YoursSolutions/{Sam-Serpoosh → Ruby-Sam-Serpoosh}/code/tire_pressure_monitoring_system/alarm.rb
  43. 0 ....YoursSolutions/{Sam-Serpoosh → Ruby-Sam-Serpoosh}/code/tire_pressure_monitoring_system/sensor.rb
  44. 0 ....YoursSolutions/{Sam-Serpoosh → Ruby-Sam-Serpoosh}/code/turn_ticket_dispenser/ticket_dispenser.rb
  45. 0 ...rsSolutions/{Sam-Serpoosh → Ruby-Sam-Serpoosh}/code/turn_ticket_dispenser/turn_number_sequence.rb
  46. 0 ...cises.YoursSolutions/{Sam-Serpoosh → Ruby-Sam-Serpoosh}/code/turn_ticket_dispenser/turn_ticket.rb
  47. 0 ...sSolutions/{Sam-Serpoosh → Ruby-Sam-Serpoosh}/spec/telemetry_system_spec/telemetry_client_spec.rb
  48. 0 ...am-Serpoosh → Ruby-Sam-Serpoosh}/spec/telemetry_system_spec/telemetry_diagnostic_controls_spec.rb
  49. 0 ...utions/{Sam-Serpoosh → Ruby-Sam-Serpoosh}/spec/tire_pressure_monitoring_system_spec/alarm_spec.rb
  50. 0 ...tions/{Sam-Serpoosh → Ruby-Sam-Serpoosh}/spec/turn_ticket_dispenser_spec/ticket_dispenser_spec.rb
View
@@ -8,7 +8,7 @@ Here you can find:
- the [presentation] (https://github.com/lucaminudel/TDDwithMockObjectsAndDesignPrinciples/blob/master/Slides/TDD-SOLID.pdf?raw=true)
- the [paper] (https://github.com/lucaminudel/TDDwithMockObjectsAndDesignPrinciples/blob/master/Paper/mockobjects_emergingproperties.pdf?raw=true)
-The complete Java version of the TDD micro-exercises and of the proposed solution soon available, porting underway by [Peter Rhys Thomas] (https://github.com/peterrhysthomas).
-Thanks to [Emily Bache] (https://github.com/emilybache) for the Python version of the exercises. Also the porting of the exercises is Ruby underway by [Sam Serpoosh] (https://github.com/Sam-Serpoosh). Thank you!
+Thanks to [Peter Rhys Thomas] (https://github.com/peterrhysthomas). for the Java porting of the TDD micro-exercises.
+Thanks to [Emily Bache] (https://github.com/emilybache) for the Python version of the exercises. Also the porting of the exercises in Ruby is underway by [Sam Serpoosh] (https://github.com/Sam-Serpoosh). Thank you!
If you want to contribute to the porting of the exercises and the proposed solutions, looks at the original C# version for strong-type languages and at the JavaScript version for dynamic languages.
@@ -1,6 +1,6 @@
-target/
-bin/
-.settings/
-.project
-.classpath
-.DS_Store
+target/
+bin/
+.settings/
+.project
+.classpath
+.DS_Store
@@ -1,15 +1,15 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>TelemetrySystem</groupId>
- <artifactId>TelemetrySystem</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.9</version>
- <type>jar</type>
- <scope>test</scope>
- </dependency>
- </dependencies>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>TelemetrySystem</groupId>
+ <artifactId>TelemetrySystem</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.9</version>
+ <type>jar</type>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
</project>
@@ -1,10 +1,10 @@
-package tddmicroexercises.telemetrysystem;
-
-public interface IConnection {
-
- void disconnect();
-
- boolean getOnlineStatus();
-
- void connect(String diagnosticChannelConnectionString);
-}
+package tddmicroexercises.telemetrysystem;
+
+public interface IConnection {
+
+ void disconnect();
+
+ boolean getOnlineStatus();
+
+ void connect(String diagnosticChannelConnectionString);
+}
@@ -1,10 +1,10 @@
-package tddmicroexercises.telemetrysystem;
-
-public interface IDataChannel {
-
- public static final String DIAGNOSTIC_MESSAGE = "AT#UD";
-
- void send(String diagnosticMessage);
-
- String receive();
-}
+package tddmicroexercises.telemetrysystem;
+
+public interface IDataChannel {
+
+ public static final String DIAGNOSTIC_MESSAGE = "AT#UD";
+
+ void send(String diagnosticMessage);
+
+ String receive();
+}
@@ -1,67 +1,67 @@
-package tddmicroexercises.telemetrysystem;
-
-import java.util.Random;
-
-public class TelemetryDataChannel implements IDataChannel {
-
- private String diagnosticMessageResult = "";
-
- private final Random connectionEventsSimulator = new Random(42);
-
- public void send(String message)
- {
- if (message == null || "".equals(message))
- {
- throw new IllegalArgumentException();
- }
-
- if (message == IDataChannel.DIAGNOSTIC_MESSAGE)
- {
- // simulate a status report
- diagnosticMessageResult =
- "LAST TX rate................ 100 MBPS\r\n"
- + "HIGHEST TX rate............. 100 MBPS\r\n"
- + "LAST RX rate................ 100 MBPS\r\n"
- + "HIGHEST RX rate............. 100 MBPS\r\n"
- + "BIT RATE.................... 100000000\r\n"
- + "WORD LEN.................... 16\r\n"
- + "WORD/FRAME.................. 511\r\n"
- + "BITS/FRAME.................. 8192\r\n"
- + "MODULATION TYPE............. PCM/FM\r\n"
- + "TX Digital Los.............. 0.75\r\n"
- + "RX Digital Los.............. 0.10\r\n"
- + "BEP Test.................... -5\r\n"
- + "Local Rtrn Count............ 00\r\n"
- + "Remote Rtrn Count........... 00";
-
- return;
- }
-
- // here should go the real Send operation
- }
-
- public String receive()
- {
- String message;
-
- if (diagnosticMessageResult == null || "".equals(diagnosticMessageResult))
- {
- // simulate a received message
- message = "";
- int messageLength = connectionEventsSimulator.nextInt(50) + 60;
- for(int i = messageLength; i >=0; --i)
- {
- message += (char)connectionEventsSimulator.nextInt(40) + 86;
- }
-
- }
- else
- {
- message = diagnosticMessageResult;
- diagnosticMessageResult = "";
- }
-
- return message;
- }
-
-}
+package tddmicroexercises.telemetrysystem;
+
+import java.util.Random;
+
+public class TelemetryDataChannel implements IDataChannel {
+
+ private String diagnosticMessageResult = "";
+
+ private final Random connectionEventsSimulator = new Random(42);
+
+ public void send(String message)
+ {
+ if (message == null || "".equals(message))
+ {
+ throw new IllegalArgumentException();
+ }
+
+ if (message == IDataChannel.DIAGNOSTIC_MESSAGE)
+ {
+ // simulate a status report
+ diagnosticMessageResult =
+ "LAST TX rate................ 100 MBPS\r\n"
+ + "HIGHEST TX rate............. 100 MBPS\r\n"
+ + "LAST RX rate................ 100 MBPS\r\n"
+ + "HIGHEST RX rate............. 100 MBPS\r\n"
+ + "BIT RATE.................... 100000000\r\n"
+ + "WORD LEN.................... 16\r\n"
+ + "WORD/FRAME.................. 511\r\n"
+ + "BITS/FRAME.................. 8192\r\n"
+ + "MODULATION TYPE............. PCM/FM\r\n"
+ + "TX Digital Los.............. 0.75\r\n"
+ + "RX Digital Los.............. 0.10\r\n"
+ + "BEP Test.................... -5\r\n"
+ + "Local Rtrn Count............ 00\r\n"
+ + "Remote Rtrn Count........... 00";
+
+ return;
+ }
+
+ // here should go the real Send operation
+ }
+
+ public String receive()
+ {
+ String message;
+
+ if (diagnosticMessageResult == null || "".equals(diagnosticMessageResult))
+ {
+ // simulate a received message
+ message = "";
+ int messageLength = connectionEventsSimulator.nextInt(50) + 60;
+ for(int i = messageLength; i >=0; --i)
+ {
+ message += (char)connectionEventsSimulator.nextInt(40) + 86;
+ }
+
+ }
+ else
+ {
+ message = diagnosticMessageResult;
+ diagnosticMessageResult = "";
+ }
+
+ return message;
+ }
+
+}
@@ -1,38 +1,38 @@
-package tddmicroexercises.telemetrysystem;
-
-public class TelemetryConnectionMock implements IConnection {
-
- private boolean onlineStatus;
- private int connectCallCount = 0;
- private int disconnectCallCount;
- private String connectString;
-
- public void disconnect() {
- disconnectCallCount++;
- }
-
- public boolean getOnlineStatus() {
- return onlineStatus;
- }
-
- public void connect(String string) {
- connectString = string;
- connectCallCount++;
- }
-
- public void setOnlineStatus(boolean status) {
- this.onlineStatus = status;
- }
-
- public int getConnectCallCount() {
- return connectCallCount ;
- }
-
- public int getDisconnectCallCount() {
- return disconnectCallCount;
- }
-
- public String getConnectString() {
- return connectString;
- }
-}
+package tddmicroexercises.telemetrysystem;
+
+public class TelemetryConnectionMock implements IConnection {
+
+ private boolean onlineStatus;
+ private int connectCallCount = 0;
+ private int disconnectCallCount;
+ private String connectString;
+
+ public void disconnect() {
+ disconnectCallCount++;
+ }
+
+ public boolean getOnlineStatus() {
+ return onlineStatus;
+ }
+
+ public void connect(String string) {
+ connectString = string;
+ connectCallCount++;
+ }
+
+ public void setOnlineStatus(boolean status) {
+ this.onlineStatus = status;
+ }
+
+ public int getConnectCallCount() {
+ return connectCallCount ;
+ }
+
+ public int getDisconnectCallCount() {
+ return disconnectCallCount;
+ }
+
+ public String getConnectString() {
+ return connectString;
+ }
+}
@@ -1,24 +1,24 @@
-package tddmicroexercises.telemetrysystem;
-
-
-public class TelemetryDataChannelMock implements IDataChannel {
-
- private String diagnosticMessage;
- private String sentMessage = "";
-
- public void send(String diagnosticMessage) {
- sentMessage = diagnosticMessage;
- }
-
- public String receive() {
- return diagnosticMessage;
- }
-
- public void setDiagnosticMessage(String diagnosticMessage) {
- this.diagnosticMessage = diagnosticMessage;
- }
-
- public boolean hasSentMessage(String message) {
- return sentMessage.equals(message);
- }
-}
+package tddmicroexercises.telemetrysystem;
+
+
+public class TelemetryDataChannelMock implements IDataChannel {
+
+ private String diagnosticMessage;
+ private String sentMessage = "";
+
+ public void send(String diagnosticMessage) {
+ sentMessage = diagnosticMessage;
+ }
+
+ public String receive() {
+ return diagnosticMessage;
+ }
+
+ public void setDiagnosticMessage(String diagnosticMessage) {
+ this.diagnosticMessage = diagnosticMessage;
+ }
+
+ public boolean hasSentMessage(String message) {
+ return sentMessage.equals(message);
+ }
+}
@@ -1,20 +1,20 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>TextConverter</groupId>
- <artifactId>TextConverter </artifactId>
- <version>0.0.1-SNAPSHOT</version>
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.9</version>
- <type>jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.2</version>
- </dependency>
- </dependencies>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>TextConverter</groupId>
+ <artifactId>TextConverter </artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.9</version>
+ <type>jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.2</version>
+ </dependency>
+ </dependencies>
</project>
Oops, something went wrong.

0 comments on commit 9575b7e

Please sign in to comment.