5151import org .junit .Test ;
5252import org .junit .runners .model .Statement ;
5353import org .jvnet .hudson .test .RestartableJenkinsRule ;
54- import org .jvnet .hudson .test .recipes .LocalData ;
5554
5655import static org .hamcrest .MatcherAssert .assertThat ;
5756import static org .hamcrest .Matchers .containsInAnyOrder ;
@@ -92,50 +91,6 @@ public static void closeSCM() {
9291 c = null ;
9392 }
9493
95- /**
96- * Checks that data is migrated correctly from 1.x to current version.
97- */
98- @ Test
99- @ LocalData
100- public void nameMangling () throws Exception {
101- r .addStep (new Statement () {
102- @ Override
103- public void evaluate () throws Throwable {
104- TopLevelItem foo = r .j .jenkins .getItem ("foo" );
105- assertDataMigrated (foo );
106- }
107- });
108- r .addStep (new Statement () {
109- @ Override
110- public void evaluate () throws Throwable {
111- TopLevelItem foo = r .j .jenkins .getItem ("foo" );
112- assertDataMigrated (foo );
113- }
114- });
115- }
116-
117- /**
118- * Checks that data migrated from 1.x to 2.0.0 name mangling is still valid when re-migrated to 2.0.2 name mangling
119- */
120- @ Test
121- @ LocalData
122- public void nameMangling_2 () throws Exception {
123- r .addStep (new Statement () {
124- @ Override
125- public void evaluate () throws Throwable {
126- TopLevelItem foo = r .j .jenkins .getItem ("foo" );
127- assertDataMigrated (foo );
128- }
129- });
130- r .addStep (new Statement () {
131- @ Override
132- public void evaluate () throws Throwable {
133- TopLevelItem foo = r .j .jenkins .getItem ("foo" );
134- assertDataMigrated (foo );
135- }
136- });
137- }
138-
13994 @ Test
14095 public void createdFromScratch () throws Exception {
14196 r .addStep (new Statement () {
@@ -159,52 +114,6 @@ public void evaluate() throws Throwable {
159114 });
160115 }
161116
162- /**
163- * Checks that data is migrated correctly from 1.x to current version.
164- */
165- @ Test
166- @ LocalData
167- public void nameMangling_full_reload () throws Exception {
168- r .addStep (new Statement () {
169- @ Override
170- public void evaluate () throws Throwable {
171- TopLevelItem foo = r .j .jenkins .getItem ("foo" );
172- r .j .jenkins .reload ();
173- assertDataMigrated (foo );
174- }
175- });
176- r .addStep (new Statement () {
177- @ Override
178- public void evaluate () throws Throwable {
179- TopLevelItem foo = r .j .jenkins .getItem ("foo" );
180- assertDataMigrated (foo );
181- }
182- });
183- }
184-
185- /**
186- * Checks that data migrated from 1.x to 2.0.0 name mangling is still valid when re-migrated to 2.0.2 name mangling
187- */
188- @ Test
189- @ LocalData
190- public void nameMangling_2_full_reload () throws Exception {
191- r .addStep (new Statement () {
192- @ Override
193- public void evaluate () throws Throwable {
194- TopLevelItem foo = r .j .jenkins .getItem ("foo" );
195- r .j .jenkins .reload ();
196- assertDataMigrated (foo );
197- }
198- });
199- r .addStep (new Statement () {
200- @ Override
201- public void evaluate () throws Throwable {
202- TopLevelItem foo = r .j .jenkins .getItem ("foo" );
203- assertDataMigrated (foo );
204- }
205- });
206- }
207-
208117 @ Test
209118 public void createdFromScratch_full_reload () throws Exception {
210119 r .addStep (new Statement () {
@@ -229,52 +138,6 @@ public void evaluate() throws Throwable {
229138 });
230139 }
231140
232- /**
233- * Checks that data is migrated correctly from 1.x to current version.
234- */
235- @ Test
236- @ LocalData
237- public void nameMangling_folder_reload () throws Exception {
238- r .addStep (new Statement () {
239- @ Override
240- public void evaluate () throws Throwable {
241- OrganizationFolder foo = r .j .jenkins .getItemByFullName ("foo" , OrganizationFolder .class );
242- foo .doReload ();
243- assertDataMigrated (foo );
244- }
245- });
246- r .addStep (new Statement () {
247- @ Override
248- public void evaluate () throws Throwable {
249- TopLevelItem foo = r .j .jenkins .getItem ("foo" );
250- assertDataMigrated (foo );
251- }
252- });
253- }
254-
255- /**
256- * Checks that data migrated from 1.x to 2.0.0 name mangling is still valid when re-migrated to 2.0.2 name mangling
257- */
258- @ Test
259- @ LocalData
260- public void nameMangling_2_folder_reload () throws Exception {
261- r .addStep (new Statement () {
262- @ Override
263- public void evaluate () throws Throwable {
264- OrganizationFolder foo = r .j .jenkins .getItemByFullName ("foo" , OrganizationFolder .class );
265- foo .doReload ();
266- assertDataMigrated (foo );
267- }
268- });
269- r .addStep (new Statement () {
270- @ Override
271- public void evaluate () throws Throwable {
272- TopLevelItem foo = r .j .jenkins .getItem ("foo" );
273- assertDataMigrated (foo );
274- }
275- });
276- }
277-
278141 @ Test
279142 public void createdFromScratch_folder_reload () throws Exception {
280143 r .addStep (new Statement () {
0 commit comments