Skip to content

Commit e70f379

Browse files
committed
merge conflicts
1 parent c372dcb commit e70f379

3 files changed

Lines changed: 33 additions & 172 deletions

File tree

‎koans-tests/test/com/sandwich/koan/runner/AppReadinessForDeploymentTest.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public void displayResult(KoanSuiteResult actualAppResult) {
105105
String message = "Not all koans need solving! Each should ship in a failing state.";
106106
assertEquals(message, 0, result[0].getNumberPassing());
107107
// make sure test was actually useful (ie something actually failed)
108-
assertNotNull(result[0].getFailingCase());
108+
assertNotNull(result[0].getFailingCase())
109109
}
110110

111111
@Test

‎koans/src/PathToEnlightment.xml‎

Lines changed: 23 additions & 162 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<!-- TODO: AboutDataTypes... -->
3434
<suite class="AboutObjects">
3535
<koan name="objectEqualsNull"
36-
lesson="An Object instance should NEVER equal null keyword. This applies to all subclasses (everything exception primitives subclass Object)." />
36+
lesson="An Object instance should NEVER equal null keyword. This applies to all subclasses (everything except primitives subclass Object)." />
3737
<koan name="objectEqualsSelf"
3838
lesson="An Object instance should equal itself. This too applies to all subclasses of Object." />
3939
<koan name="objectIdentityEqualityIsTrueWhenReferringToSameObject"
@@ -45,99 +45,34 @@
4545
<koan name="doubleEqualsOperatorEvalutesToFalseWithDifferentInstances"
4646
lesson="The inverse of the prior koan, though two objects may be logically equal, they are not referencing the same object." />
4747
<koan name="objectToString"
48-
lesson="How to identify an object at in string form. Should be overridden in any objects with internal state. Default to string is classname of the instance followed by its hashCode in base 16 (hexadecimal)." />
48+
lesson="It's easy to identify an object's state at a glance - with a good toString() implementation. Should be overridden in any objects with internal state. Default to string is classname of the instance followed by its hashCode in base 16 (hexadecimal)." />
4949
<koan name="toStringConcatenates"
5050
lesson="Java 's string concatenation syntax utilizes addition operator to splice a string with virtually anything." />
5151
<koan name="toStringIsTestedForNullWhenInvokedImplicitly"
5252
lesson="String concatenation implicitly invokes toString on Objects, unless they are null. Notice no NullPointerException is thrown." />
5353
</suite>
54-
<suite class="AboutLoops">
55-
<koan name="basicForLoop" />
56-
<koan name="basicForLoopWithTwoVariables" />
57-
<koan name="extendedForLoop" />
58-
<koan name="whileLoop" />
59-
<koan name="doLoop" />
60-
<koan name="extendedForLoopBreak" />
61-
<koan name="extendedForLoopContinue" />
62-
<koan name="forLoopContinueLabel" />
63-
<koan name="forLoopBreakLabel" />
64-
</suite>
65-
<suite class="AboutCasting">
66-
<koan name="longPlusInt" />
67-
<koan name="forceIntTypecast" />
68-
<koan name="implicitTypecast" />
69-
<koan name="downCastWithInerhitance" />
70-
<koan name="downCastAndPolymophism" />
71-
<koan name="upCastWithInheritance" />
72-
<koan name="upCastAndPolymophism" />
73-
<koan name="complicatedCast" />
74-
<koan name="complicatedCastWithInterface" />
75-
</suite>
76-
<suite class="AboutConditionals">
77-
<koan name="basicIfWithoutCurly" />
78-
<koan name="basicIfElseWithoutCurly" />
79-
<koan name="basicIfElseIfElseWithoutCurly" />
80-
<koan name="nestedIfsWithoutCurlysAreReallyMisleading" />
81-
<koan name="ifAsIntended" />
82-
<koan name="basicSwitchStatement" />
83-
<koan name="switchStatementFallThrough" />
84-
<koan name="switchStatementCrazyFallThrough" />
85-
<koan name="switchStatementConstants" />
86-
<koan name="switchStatementSwitchValues" />
87-
</suite>
54+
<suite class="AboutLoops" />
55+
<suite class="AboutCasting"/>
56+
<suite class="AboutConditionals"/>
8857
<suite class="AboutInheritance">
89-
<koan name="differenceBetweenOverloadingAndOverriding" />
9058
<koan name="overridenMethodsMayReturnSubtype"
9159
lesson="An overridden method may return a subtype of the return type for the method being overridden. Look at the javadoc for java.util.Collection or java.util.List - it will reveal how to eliminate this type cast." />
9260
</suite>
93-
<suite class="AboutConstructors">
94-
<koan name="simpleConstructorOrder" />
95-
<koan name="complexConstructorOrder" />
96-
</suite>
97-
<suite class="AboutEnums">
98-
<koan name="basicEnums" />
99-
<koan name="basicEnumsAccess" />
100-
<koan name="enumsWithAttributes" />
101-
<koan name="enumsWithMethods" />
102-
</suite>
103-
<suite class="AboutExceptions">
104-
<koan name="catchCheckedExceptions" />
105-
<koan name="useFinally" />
106-
<koan name="finallyWithoutCatch" />
107-
<koan name="catchUncheckedExceptions" />
108-
<koan name="catchOrder" />
109-
</suite>
110-
<suite class="AboutMethodPreference">
111-
<koan name="methodPreferenceInt" />
112-
<koan name="methodPreferenceInteger" />
113-
<koan name="methodPreferenceLong" />
114-
<koan name="methodPreferenceBoxedLong" />
115-
<koan name="methodPreferenceDouble" />
116-
<koan name="methodPreferenceMore" />
117-
</suite>
118-
<suite class="AboutOperators">
119-
<koan name="plusPlusVariablePlusPlus" />
120-
<koan name="shortCircuit" />
121-
<koan name="fullAnd" />
122-
<koan name="shortCircuitAnd" />
123-
<koan name="aboutXOR" />
124-
<koan name="dontMistakeEqualsForEqualsEquals" />
125-
<koan name="aboutBitShiftingRightShift" />
126-
<koan name="aboutBitShiftingLeftShift" />
127-
<koan name="aboutBitShiftingRightUnsigned" />
128-
</suite>
61+
<suite class="AboutConstructors"/>
62+
<suite class="AboutEnums"/>
63+
<suite class="AboutExceptions"/>
64+
<suite class="AboutMethodPreference"/>
65+
<suite class="AboutOperators"/>
12966
<suite class="AboutArrays">
13067
<koan name="arraysDoNotConsiderElementsWhenEvaluatingEquality"
13168
lesson="Arrays utilize reference equality, they do not consider elements when determining equality." />
13269
<koan name="cloneEqualityIs_NotRespected"
13370
lesson="The general contract of clone is that: Object a == new Object(); a != a.clone(); a.equals(a.clone()). Array instances DO NOT honor this contract, despite implementing Cloneable." />
13471
<koan name="anArraysHashCodeMethodDoesNotConsiderElements"
13572
lesson="Likewise with hashcode, an array instance's hashCode is that of the array, it does not incorporate elements." />
136-
<koan
137-
name="arraysHelperClassEqualsMethodConsidersElementsWhenDeterminingEquality"
73+
<koan name="arraysHelperClassEqualsMethodConsidersElementsWhenDeterminingEquality"
13874
lesson="The Arrays.equals(...) method DOES evaluate elements when determining equality. This is called 'Logical Equality'." />
139-
<koan
140-
name="arraysHelperClassHashCodeMethodConsidersElementsWhenDeterminingHashCode"
75+
<koan name="arraysHelperClassHashCodeMethodConsidersElementsWhenDeterminingHashCode"
14176
lesson="Likewise with hashCode, the Arrays.hashCode(...) method DOES consider elements when determining hashCode." />
14277
<koan name="arraysAreMutable"
14378
lesson="Arrays are always mutable, even when declared final. The final declaration prevents reassignment, but does nothing for elements." />
@@ -148,15 +83,7 @@
14883
<koan name="arrayLengthCanBeChecked"
14984
lesson="It is often necessary to check the length of an array to ensure an index is valid. This is easy with the array's length property." />
15085
</suite>
151-
<suite class="AboutPrimitives">
152-
<koan name="byteSize" />
153-
<koan name="shortSize" />
154-
<koan name="integerSize" />
155-
<koan name="longSize" />
156-
<koan name="charSizeAndValue" />
157-
<koan name="floatSize" />
158-
<koan name="doubleSize" />
159-
</suite>
86+
<suite class="AboutPrimitives"/>
16087
</package>
16188
<package pkg="intermediate" name="Intermediate">
16289
<suite class="AboutAutoboxing">
@@ -167,85 +94,19 @@
16794
lesson="With AutoBoxing, we can intermix as well" />
16895
<koan name="allPrimativesCanBeAutoboxed" lesson="All primatives can be autoboxed" />
16996
</suite>
170-
<suite class="AboutCollections">
171-
<koan name="usingAnArrayList" />
172-
<koan name="usingAQueue" />
173-
<koan name="usingABasicSet" />
174-
<koan name="usingABasicMap" />
175-
<koan name="usingBackedArrayList" />
176-
<koan name="usingBackedSubMap" />
177-
<koan name="differenceBetweenOrderedAndSorted" />
178-
</suite>
179-
<suite class="AboutComparison">
180-
<koan name="compareObjects" />
181-
<koan name="makeObjectsComparable" />
182-
<koan name="makeObjectsComparableWithoutComparable" />
183-
</suite>
184-
<suite class="AboutDates">
185-
<koan name="dateToString" />
186-
<koan name="changingDateValue" />
187-
<koan name="usingCalendarToChangeDates" />
188-
<koan name="usingRollToChangeDatesDoesntWrapOtherFields" />
189-
<koan name="usingDateFormatToFormatDate" />
190-
<koan name="usingDateFormatToFormatDateShort" />
191-
<koan name="usingDateFormatToFormatDateFull" />
192-
<koan name="usingDateFormatToParseDates" />
193-
</suite>
194-
<suite class="AboutEquality">
195-
<koan name="sameObject" />
196-
<koan name="equalObject" />
197-
<koan name="noObjectShouldbeEqualToNull" />
198-
<koan name="equalForOwnObjects" />
199-
<koan name="unequalForOwnObjects" />
200-
<koan name="unequalForOwnObjectsWithDifferentType" />
201-
<koan name="equalNullForOwnObjects" />
202-
<koan name="ownHashCode" />
203-
<koan name="ownHashCodeImplementationPartTwo" />
204-
</suite>
205-
<suite class="AboutFileIO">
206-
<koan name="fileObjectDoesntCreateFile" />
207-
<koan name="fileCreationAndDeletion" />
208-
<koan name="basicFileWritingAndReading" />
209-
<koan name="betterFileWritingAndReading" />
210-
<koan name="directChainingForReadingAndWriting" />
211-
</suite>
212-
<suite class="AboutInnerClasses">
213-
<koan name="creatingInnerClassInstance" />
214-
<koan name="creatingInnerClassInstanceWithOtherSyntax" />
215-
<koan name="accessingOuterClassMembers" />
216-
<koan name="innerClassesInMethods" />
217-
<koan name="innerClassesInMethodsThatEscape" />
218-
<koan name="creatingAnonymousInnerClasses" />
219-
<koan name="creatingAnonymousInnerClassesToImplementInterface" />
220-
<koan name="innerClassAndInheritance" />
221-
<koan name="innerClassAndInheritanceOther" />
222-
<koan name="staticInnerClass" />
223-
<koan name="staticInnerClassFullyQualified" />
224-
</suite>
225-
<suite class="AboutLocale">
226-
<koan name="localizedOutputOfDates" />
227-
<koan name="getCountryInformation" />
228-
<koan name="formatCurrency" />
229-
</suite>
230-
<suite class="AboutRegularExpressions">
231-
<koan name="basicMatching" />
232-
<koan name="extendedMatching" />
233-
<koan name="escapingMetaCharacters" />
234-
<koan name="splittingStrings" />
235-
</suite>
236-
<suite class="AboutSerialization">
237-
<koan name="simpleSerialization" />
238-
<koan name="customObjectSerialization" />
239-
<koan name="customObjectSerializationWithTransientFields" />
240-
<koan name="customSerializationWithUnserializableFields" />
241-
<koan name="serializeWithInteritance" />
242-
<koan name="serializeWithInheritanceWhenParentNotserializable" />
243-
</suite>
97+
<suite class="AboutCollections"/>
98+
<suite class="AboutComparison"/>
99+
<suite class="AboutDates"/>
100+
<suite class="AboutEquality"/>
101+
<suite class="AboutFileIO"/>
102+
<suite class="AboutInnerClasses"/>
103+
<suite class="AboutLocale"/>
104+
<suite class="AboutRegularExpressions"/>
105+
<suite class="AboutSerialization"/>
244106
</package>
245107
<package pkg="advanced" name="Advanced">
246108
<suite class="AboutMocks">
247-
<koan name="simpleAnonymousMock"
248-
lesson="How can this pass without touching the ClassUnderTest?" />
109+
<koan name="simpleAnonymousMock" lesson="How can this pass without touching the ClassUnderTest?" />
249110
</suite>
250111
</package>
251112
</packages>

‎koans/src/beginner/AboutObjects.java‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,43 +10,43 @@ public class AboutObjects {
1010
@Koan()
1111
public void objectEqualsNull(){
1212
// does a new object instance equal the null keyword?
13-
assertEquals(new Object().equals(null), false);
13+
assertEquals(new Object().equals(null), __);
1414
}
1515

1616
@Koan()
1717
public void objectEqualsSelf(){
1818
Object obj = new Object();
1919
// does a new object equal itself?
20-
assertEquals(obj.equals(obj), true);
20+
assertEquals(obj.equals(obj), __);
2121
}
2222

2323
@Koan()
2424
public void objectIdentityEqualityIsTrueWhenReferringToSameObject(){
2525
Object objectReference = new Object();
2626
Object referenceToSameObject = objectReference;
2727
// does a new object == itself?
28-
assertEquals(objectReference == referenceToSameObject, true);
28+
assertEquals(objectReference == referenceToSameObject, __);
2929
}
3030

3131
@Koan()
3232
public void subclassesEqualsMethodIsLooserThanDoubleEquals(){
3333
Integer integer0 = new Integer(0);
3434
Integer integer1 = new Integer(0);
35-
assertEquals(integer0.equals(integer1), true);
35+
assertEquals(integer0.equals(integer1), __);
3636
}
3737

3838
@Koan()
3939
public void doubleEqualsOperatorEvalutesToTrueOnlyWithSameInstance(){
4040
Integer integer0 = new Integer(0);
4141
Integer integer1 = integer0; // <- assigning same instance to different reference
42-
assertEquals(integer0 == integer1, true);
42+
assertEquals(integer0 == integer1, __);
4343
}
4444

4545
@Koan()
4646
public void doubleEqualsOperatorEvalutesToFalseWithDifferentInstances(){
4747
Integer integer0 = new Integer(0);
4848
Integer integer1 = new Integer(0); // <- new keyword is generating new object instance
49-
assertEquals(integer0 == integer1, false);
49+
assertEquals(integer0 == integer1, __);
5050
}
5151

5252
@Koan()
@@ -55,7 +55,7 @@ public void objectToString(){
5555
// TODO: Why is it best practice to ALWAYS override toString?
5656
assertEquals((new StringBuilder()).append(Object.class.getName())
5757
.append('@')
58-
.append(Integer.toHexString(object.hashCode())).toString(), object.toString()); //object.toString()
58+
.append(Integer.toHexString(object.hashCode())).toString(), __); //object.toString()
5959
}
6060

6161
@Koan()
@@ -66,12 +66,12 @@ public void toStringConcatenates(){
6666
return string;
6767
}
6868
};
69-
assertEquals(string + object, "haha");
69+
assertEquals(string + object, __);
7070
}
7171

7272
@Koan()
7373
public void toStringIsTestedForNullWhenInvokedImplicitly(){
7474
String string = "string";
75-
assertEquals(string+null, "stringnull");
75+
assertEquals(string+null, __);
7676
}
7777
}

0 commit comments

Comments
 (0)