@@ -48,66 +48,6 @@ public void anchorsAndReferences() throws IOException {
4848 assertThat (actual ).isEqualTo (expected );
4949 }
5050
51- @ Test
52- public void read () throws IOException {
53- List <ApplicationManifest > expected = Arrays .asList (
54- ApplicationManifest .builder ()
55- .name ("alpha-application-1" )
56- .buildpack ("alpha-buildpack" )
57- .command ("alpha-command" )
58- .disk (-1 )
59- .healthCheckHttpEndpoint ("alpha-health-check-http-endpoint" )
60- .healthCheckType (NONE )
61- .instances (-1 )
62- .memory (1 )
63- .noRoute (true )
64- .path (Paths .get ("/alpha-path" ))
65- .randomRoute (true )
66- .route (Route .builder ()
67- .route ("alpha-route-1" )
68- .build ())
69- .route (Route .builder ()
70- .route ("alpha-route-2" )
71- .build ())
72- .stack ("alpha-stack" )
73- .timeout (-1 )
74- .environmentVariable ("ALPHA_KEY_1" , "alpha-value-1" )
75- .environmentVariable ("ALPHA_KEY_2" , "alpha-value-2" )
76- .service ("alpha-instance-1" )
77- .service ("alpha-instance-2" )
78- .build (),
79- ApplicationManifest .builder ()
80- .name ("alpha-application-2" )
81- .buildpack ("alpha-buildpack" )
82- .command ("alpha-command" )
83- .disk (-1 )
84- .domain ("alpha-domain" )
85- .domain ("alpha-domains-1" )
86- .domain ("alpha-domains-2" )
87- .healthCheckHttpEndpoint ("alpha-health-check-http-endpoint" )
88- .healthCheckType (PORT )
89- .host ("alpha-host" )
90- .host ("alpha-hosts-1" )
91- .host ("alpha-hosts-2" )
92- .instances (-1 )
93- .memory (1024 )
94- .noHostname (true )
95- .noRoute (true )
96- .path (Paths .get ("c:\\ alpha-path" ))
97- .randomRoute (true )
98- .stack ("alpha-stack" )
99- .timeout (-1 )
100- .environmentVariable ("ALPHA_KEY_1" , "1" )
101- .environmentVariable ("ALPHA_KEY_2" , "alpha-value-2" )
102- .service ("alpha-instance-1" )
103- .service ("alpha-instance-2" )
104- .build ());
105-
106- List <ApplicationManifest > actual = ApplicationManifestUtils .read (new ClassPathResource ("fixtures/manifest-alpha.yml" ).getFile ().toPath ());
107-
108- assertThat (actual ).isEqualTo (expected );
109- }
110-
11151 @ Test
11252 public void readCommon () throws IOException {
11353 List <ApplicationManifest > expected = Arrays .asList (
@@ -324,32 +264,6 @@ public void readInherit() throws IOException {
324264 .service ("beta-instance-1" )
325265 .service ("beta-instance-2" )
326266 .build (),
327- ApplicationManifest .builder ()
328- .name ("alpha-application-2" )
329- .buildpack ("alpha-buildpack" )
330- .command ("alpha-command" )
331- .disk (-1 )
332- .domain ("alpha-domain" )
333- .domain ("alpha-domains-1" )
334- .domain ("alpha-domains-2" )
335- .healthCheckHttpEndpoint ("alpha-health-check-http-endpoint" )
336- .healthCheckType (PORT )
337- .host ("alpha-host" )
338- .host ("alpha-hosts-1" )
339- .host ("alpha-hosts-2" )
340- .instances (-1 )
341- .memory (1024 )
342- .noHostname (true )
343- .noRoute (true )
344- .path (Paths .get ("c:\\ alpha-path" ))
345- .randomRoute (true )
346- .stack ("alpha-stack" )
347- .timeout (-1 )
348- .environmentVariable ("ALPHA_KEY_1" , "1" )
349- .environmentVariable ("ALPHA_KEY_2" , "alpha-value-2" )
350- .service ("alpha-instance-1" )
351- .service ("alpha-instance-2" )
352- .build (),
353267 ApplicationManifest .builder ()
354268 .name ("beta-application-1" )
355269 .buildpack ("beta-buildpack" )
@@ -460,7 +374,7 @@ public void readNoRoute() throws IOException {
460374
461375 @ Test
462376 public void relativePath () throws IOException {
463- Path root = new ClassPathResource ("fixtures/manifest-mike .yml" ).getFile ().toPath ();
377+ Path root = new ClassPathResource ("fixtures/manifest-november .yml" ).getFile ().toPath ();
464378
465379 List <ApplicationManifest > expected = Collections .singletonList (
466380 ApplicationManifest .builder ()
@@ -523,23 +437,68 @@ public void testDiskQuotaAndMemoryParsing() throws Exception {
523437 .build ()
524438 );
525439
526- List <ApplicationManifest > actual = ApplicationManifestUtils .read (new ClassPathResource ("fixtures/manifest-quota .yml" ).getFile ().toPath ());
440+ List <ApplicationManifest > actual = ApplicationManifestUtils .read (new ClassPathResource ("fixtures/manifest-mike .yml" ).getFile ().toPath ());
527441
528442 assertThat (actual ).isEqualTo (expected );
529443 }
530444
445+ @ Test
446+ public void unixRead () throws IOException {
447+ assumeTrue (SystemUtils .IS_OS_UNIX );
448+ read ("/alpha-path" , "fixtures/manifest-alpha-unix.yml" );
449+ }
450+
531451 @ Test
532452 public void unixWrite () throws IOException {
533453 assumeTrue (SystemUtils .IS_OS_UNIX );
534454 write ("/alpha-path" , "fixtures/manifest-echo-unix.yml" );
535455 }
536456
457+ @ Test
458+ public void windowsRead () throws IOException {
459+ assumeTrue (SystemUtils .IS_OS_WINDOWS );
460+ read ("c:\\ alpha-path" , "fixtures/manifest-alpha-windows.yml" );
461+ }
462+
537463 @ Test
538464 public void windowsWrite () throws IOException {
539465 assumeTrue (SystemUtils .IS_OS_WINDOWS );
540466 write ("c:\\ alpha-path" , "fixtures/manifest-echo-windows.yml" );
541467 }
542468
469+ private void read (String path , String expectedManifest ) throws IOException {
470+ List <ApplicationManifest > expected = Arrays .asList (
471+ ApplicationManifest .builder ()
472+ .name ("alpha-application-1" )
473+ .buildpack ("alpha-buildpack" )
474+ .command ("alpha-command" )
475+ .disk (-1 )
476+ .healthCheckHttpEndpoint ("alpha-health-check-http-endpoint" )
477+ .healthCheckType (NONE )
478+ .instances (-1 )
479+ .memory (1 )
480+ .noRoute (true )
481+ .path (Paths .get (path ))
482+ .randomRoute (true )
483+ .route (Route .builder ()
484+ .route ("alpha-route-1" )
485+ .build ())
486+ .route (Route .builder ()
487+ .route ("alpha-route-2" )
488+ .build ())
489+ .stack ("alpha-stack" )
490+ .timeout (-1 )
491+ .environmentVariable ("ALPHA_KEY_1" , "alpha-value-1" )
492+ .environmentVariable ("ALPHA_KEY_2" , "alpha-value-2" )
493+ .service ("alpha-instance-1" )
494+ .service ("alpha-instance-2" )
495+ .build ());
496+
497+ List <ApplicationManifest > actual = ApplicationManifestUtils .read (new ClassPathResource (expectedManifest ).getFile ().toPath ());
498+
499+ assertThat (actual ).isEqualTo (expected );
500+ }
501+
543502 private void write (String path , String expectedManifest ) throws IOException {
544503 Path out = Files .createTempFile ("test-manifest-" , ".yml" );
545504
0 commit comments