Skip to content

Commit 40d5912

Browse files
committed
Sort methods
1 parent 55c796c commit 40d5912

File tree

1 file changed

+59
-59
lines changed

1 file changed

+59
-59
lines changed

src/test/java/org/apache/commons/lang3/builder/ReflectionDiffBuilderTest.java

Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,65 @@ public void testDifferenceInInherited_field() {
9999
assertEquals(1, list.getNumberOfDiffs());
100100
}
101101

102+
@Test
103+
public void testGetExcludeFieldNamesWithNullExcludedFieldNames() {
104+
// @formatter:off
105+
final ReflectionDiffBuilder<TypeTestClass> reflectionDiffBuilder = ReflectionDiffBuilder.<TypeTestClass>builder()
106+
.setDiffBuilder(DiffBuilder.<TypeTestClass>builder()
107+
.setLeft(new TypeTestClass())
108+
.setRight(new TypeTestChildClass())
109+
.setStyle(SHORT_STYLE)
110+
.build())
111+
.build();
112+
// @formatter:on
113+
final String[] excludeFieldNames = reflectionDiffBuilder.getExcludeFieldNames();
114+
assertNotNull(excludeFieldNames);
115+
assertEquals(0, excludeFieldNames.length);
116+
}
117+
118+
@Test
119+
public void testGetExcludeFieldNamesWithNullExcludedFieldNamesCtor() {
120+
// @formatter:off
121+
final ReflectionDiffBuilder<TypeTestClass> reflectionDiffBuilder =
122+
new ReflectionDiffBuilder<>(new TypeTestClass(), new TypeTestChildClass(), SHORT_STYLE);
123+
// @formatter:on
124+
reflectionDiffBuilder.setExcludeFieldNames(null);
125+
final String[] excludeFieldNames = reflectionDiffBuilder.getExcludeFieldNames();
126+
assertNotNull(excludeFieldNames);
127+
assertEquals(0, excludeFieldNames.length);
128+
}
129+
130+
@Test
131+
public void testGetExcludeFieldNamesWithNullValuesInExcludedFieldNames() {
132+
// @formatter:off
133+
final ReflectionDiffBuilder<TypeTestClass> reflectionDiffBuilder = ReflectionDiffBuilder.<TypeTestClass>builder()
134+
.setDiffBuilder(DiffBuilder.<TypeTestClass>builder()
135+
.setLeft(new TypeTestClass())
136+
.setRight(new TypeTestChildClass())
137+
.setStyle(SHORT_STYLE)
138+
.build())
139+
.setExcludeFieldNames("charField", null)
140+
.build();
141+
// @formatter:on
142+
final String[] excludeFieldNames = reflectionDiffBuilder.getExcludeFieldNames();
143+
assertNotNull(excludeFieldNames);
144+
assertEquals(1, excludeFieldNames.length);
145+
assertEquals("charField", excludeFieldNames[0]);
146+
}
147+
148+
@Test
149+
public void testGetExcludeFieldNamesWithNullValuesInExcludedFieldNamesCtor() {
150+
// @formatter:off
151+
final ReflectionDiffBuilder<TypeTestClass> reflectionDiffBuilder =
152+
new ReflectionDiffBuilder<>(new TypeTestClass(), new TypeTestChildClass(), SHORT_STYLE);
153+
// @formatter:on
154+
reflectionDiffBuilder.setExcludeFieldNames("charField", null);
155+
final String[] excludeFieldNames = reflectionDiffBuilder.getExcludeFieldNames();
156+
assertNotNull(excludeFieldNames);
157+
assertEquals(1, excludeFieldNames.length);
158+
assertEquals("charField", excludeFieldNames[0]);
159+
}
160+
102161
@Test
103162
public void testNoDifferences() {
104163
final TypeTestClass firstObject = new TypeTestClass();
@@ -169,63 +228,4 @@ public void testTransientFieldDifference() {
169228
assertEquals(0, list.getNumberOfDiffs());
170229
}
171230

172-
@Test
173-
public void testGetExcludeFieldNamesWithNullExcludedFieldNames() {
174-
// @formatter:off
175-
final ReflectionDiffBuilder<TypeTestClass> reflectionDiffBuilder = ReflectionDiffBuilder.<TypeTestClass>builder()
176-
.setDiffBuilder(DiffBuilder.<TypeTestClass>builder()
177-
.setLeft(new TypeTestClass())
178-
.setRight(new TypeTestChildClass())
179-
.setStyle(SHORT_STYLE)
180-
.build())
181-
.build();
182-
// @formatter:on
183-
final String[] excludeFieldNames = reflectionDiffBuilder.getExcludeFieldNames();
184-
assertNotNull(excludeFieldNames);
185-
assertEquals(0, excludeFieldNames.length);
186-
}
187-
188-
@Test
189-
public void testGetExcludeFieldNamesWithNullExcludedFieldNamesCtor() {
190-
// @formatter:off
191-
final ReflectionDiffBuilder<TypeTestClass> reflectionDiffBuilder =
192-
new ReflectionDiffBuilder<>(new TypeTestClass(), new TypeTestChildClass(), SHORT_STYLE);
193-
// @formatter:on
194-
reflectionDiffBuilder.setExcludeFieldNames(null);
195-
final String[] excludeFieldNames = reflectionDiffBuilder.getExcludeFieldNames();
196-
assertNotNull(excludeFieldNames);
197-
assertEquals(0, excludeFieldNames.length);
198-
}
199-
200-
@Test
201-
public void testGetExcludeFieldNamesWithNullValuesInExcludedFieldNames() {
202-
// @formatter:off
203-
final ReflectionDiffBuilder<TypeTestClass> reflectionDiffBuilder = ReflectionDiffBuilder.<TypeTestClass>builder()
204-
.setDiffBuilder(DiffBuilder.<TypeTestClass>builder()
205-
.setLeft(new TypeTestClass())
206-
.setRight(new TypeTestChildClass())
207-
.setStyle(SHORT_STYLE)
208-
.build())
209-
.setExcludeFieldNames("charField", null)
210-
.build();
211-
// @formatter:on
212-
final String[] excludeFieldNames = reflectionDiffBuilder.getExcludeFieldNames();
213-
assertNotNull(excludeFieldNames);
214-
assertEquals(1, excludeFieldNames.length);
215-
assertEquals("charField", excludeFieldNames[0]);
216-
}
217-
218-
@Test
219-
public void testGetExcludeFieldNamesWithNullValuesInExcludedFieldNamesCtor() {
220-
// @formatter:off
221-
final ReflectionDiffBuilder<TypeTestClass> reflectionDiffBuilder =
222-
new ReflectionDiffBuilder<>(new TypeTestClass(), new TypeTestChildClass(), SHORT_STYLE);
223-
// @formatter:on
224-
reflectionDiffBuilder.setExcludeFieldNames("charField", null);
225-
final String[] excludeFieldNames = reflectionDiffBuilder.getExcludeFieldNames();
226-
assertNotNull(excludeFieldNames);
227-
assertEquals(1, excludeFieldNames.length);
228-
assertEquals("charField", excludeFieldNames[0]);
229-
}
230-
231231
}

0 commit comments

Comments
 (0)