Skip to content

Commit 7af08de

Browse files
committed
updating data dir for backups
1 parent 67f3928 commit 7af08de

2 files changed

Lines changed: 46 additions & 27 deletions

File tree

‎koans/data/src/PathToEnlightment.xml‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,42 @@
5555
<Koan name="toStringIsTestedForNullWhenInvokedImplicitly"
5656
lesson="String concatenation implicitly invokes toString on Objects, unless they are null. Notice no NullPointerException is thrown."/>
5757
</Suite>
58+
<Suite class="AboutCasting">
59+
<Koan name="longPlusInt" />
60+
<Koan name="forceIntTypecast" />
61+
<Koan name="implicitTypecast" />
62+
<Koan name="downCastWithInerhitance" />
63+
<Koan name="downCastAndPolymophism" />
64+
<Koan name="upCastWithInheritance" />
65+
<Koan name="upCastAndPolymophism" />
66+
<Koan name="complicatedCast" />
67+
<Koan name="complicatedCastWithInterface" />
68+
</Suite>
69+
<Suite class="AboutInheritance">
70+
<Koan name="differenceBetweenOverloadingAndOverriding" />
71+
<Koan name="overridenMethodsMayReturnSubtype"
72+
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."/>
73+
</Suite>
74+
<Suite class="AboutConstructors">
75+
<Koan name="simpleConstructorOrder" />
76+
<Koan name="complexConstructorOrder" />
77+
</Suite>
78+
<Suite class="AboutMethodPreference">
79+
<Koan name="methodPreferenceInt" />
80+
<Koan name="methodPreferenceInteger" />
81+
<Koan name="methodPreferenceLong" />
82+
<Koan name="methodPreferenceBoxedLong" />
83+
<Koan name="methodPreferenceDouble" />
84+
<Koan name="methodPreferenceMore" />
85+
</Suite>
86+
<Suite class="AboutOperators">
87+
<Koan name="plusPlusVariablePlusPlus" />
88+
<Koan name="shortCircuit" />
89+
<Koan name="fullAnd" />
90+
<Koan name="shortCircuitAnd" />
91+
<Koan name="aboutXOR" />
92+
<Koan name="dontMistakeEqualsForEqualsEquals" />
93+
</Suite>
5894
<Suite class="AboutArrays">
5995
<Koan name="arraysDoNotConsiderElementsWhenEvaluatingEquality"
6096
lesson="Arrays utilize reference equality, they do not consider elements when determining equality."/>
@@ -75,6 +111,15 @@
75111
<Koan name="arrayLengthCanBeChecked"
76112
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."/>
77113
</Suite>
114+
<Suite class="AboutPrimitives">
115+
<Koan name="byteSize" />
116+
<Koan name="shortSize" />
117+
<Koan name="integerSize" />
118+
<Koan name="longSize" />
119+
<Koan name="charSizeAndValue" />
120+
<Koan name="floatSize" />
121+
<Koan name="doubleSize" />
122+
</Suite>
78123
</Package>
79124
<Package pkg="intermediate" name="Intermediate">
80125
<Suite class="AboutAutoboxing">

‎koans/data/src/advanced/AboutMocks.java‎

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,10 @@
11
package advanced;
22

33
import com.sandwich.koan.Koan;
4+
import com.sandwich.koan.exampleclasses.ClassUnderTest;
45

56
public class AboutMocks {
67

7-
/*
8-
* Following two classes are used to demonstrate mocking
9-
*/
10-
static class ClassUnderTest {
11-
Collaborator c;
12-
ClassUnderTest(){
13-
// default is to pass a broken Collaborator, test should pass one
14-
// that doesn't throw exception
15-
this(new Collaborator(){
16-
@Override
17-
public void doBusinessStuff() {
18-
throw new AssertionError("Default collaborator's behavior is complicating testing.");
19-
}
20-
});
21-
}
22-
ClassUnderTest(Collaborator c){
23-
this.c = c;
24-
}
25-
public void doSomething(){
26-
c.doBusinessStuff();
27-
}
28-
}
29-
30-
static interface Collaborator {
31-
public void doBusinessStuff();
32-
}
33-
348
@Koan()
359
public void simpleAnonymousMock(){
3610
// HINT: pass different Collaborator implementation to constructor

0 commit comments

Comments
 (0)