25
25
import org .eclipse .aether .artifact .DefaultArtifact ;
26
26
import org .eclipse .aether .graph .Dependency ;
27
27
import org .junit .After ;
28
- import org .junit .Ignore ;
29
28
import org .junit .Rule ;
30
29
import org .junit .Test ;
31
30
import org .junit .rules .ExpectedException ;
@@ -127,7 +126,7 @@ public void dryrun() throws Exception {
127
126
public void classpath () throws Exception {
128
127
String [] args = new String [] { "--thin.classpath" , "--thin.archive=src/test/resources/apps/basic" };
129
128
ThinJarLauncher .main (args );
130
- assertThat (output .toString ()).contains ("spring-web-4.3.3 .RELEASE.jar" + File .pathSeparator );
129
+ assertThat (output .toString ()).contains ("spring-web-5.2.7 .RELEASE.jar" + File .pathSeparator );
131
130
}
132
131
133
132
@ Test
@@ -150,7 +149,7 @@ public void compute() throws Exception {
150
149
String [] args = new String [] { "--thin.classpath=properties" , "--thin.archive=src/test/resources/apps/basic" };
151
150
ThinJarLauncher .main (args );
152
151
assertThat (output .toString ())
153
- .contains ("dependencies.spring-web=org.springframework:spring-web:4.3.3 .RELEASE\n " );
152
+ .contains ("dependencies.spring-web=org.springframework:spring-web:5.2.7 .RELEASE\n " );
154
153
}
155
154
156
155
@ Test
@@ -314,8 +313,24 @@ public void settingsReadFromRootWithThinRoot() throws Exception {
314
313
}
315
314
316
315
@ Test
317
- @ Ignore
318
316
public void commandLineOffline () throws Exception {
317
+ // Once online to prime the cache
318
+ String [] args = new String [] { "--thin.root=target/thin/test" , "--thin.dryrun=true" ,
319
+ "--thin.archive=src/test/resources/apps/basic" , "--debug" };
320
+ ThinJarLauncher .main (args );
321
+ DependencyResolver .close ();
322
+ // Then go offline with the same args
323
+ DependencyResolver .close ();
324
+ args = new String [] { "--thin.root=target/thin/test" , "--thin.dryrun=true" , "--thin.offline=true" ,
325
+ "--thin.archive=src/test/resources/apps/basic" , "--debug" };
326
+ // assertThat(deleteRecursively(new
327
+ // File("target/thin/test/repository/org/springframework/spring-core"))).isTrue();
328
+ ThinJarLauncher .main (args );
329
+ assertThat (new File ("target/thin/test/repository/org/springframework/spring-core" ).exists ()).isTrue ();
330
+ }
331
+
332
+ @ Test
333
+ public void commandLineOfflineSnapshots () throws Exception {
319
334
// Once online to prime the cache
320
335
String [] args = new String [] { "--thin.root=target/thin/test" , "--thin.dryrun=true" ,
321
336
"--thin.archive=src/test/resources/apps/snapshots-with-repos" , "--debug" };
@@ -325,7 +340,8 @@ public void commandLineOffline() throws Exception {
325
340
DependencyResolver .close ();
326
341
args = new String [] { "--thin.root=target/thin/test" , "--thin.dryrun=true" , "--thin.offline=true" ,
327
342
"--thin.archive=src/test/resources/apps/snapshots-with-repos" , "--debug" };
328
- assertThat (deleteRecursively (new File ("target/thin/test/repository/org/springframework/spring-core" ))).isTrue ();
343
+ // assertThat(deleteRecursively(new
344
+ // File("target/thin/test/repository/org/springframework/spring-core"))).isTrue();
329
345
ThinJarLauncher .main (args );
330
346
assertThat (new File ("target/thin/test/repository/org/springframework/spring-core" ).exists ()).isTrue ();
331
347
}
0 commit comments