* BAEL-1733

* naming conventions settled

* createManifestFile method added

* remove accidentally created MANIFEST.MF file from the project root flder
This commit is contained in:
enpy
2018-06-24 18:57:24 +02:00
committed by KevinGilmore
parent 14bdd8e7d7
commit 1024102d9a
3 changed files with 115 additions and 0 deletions
@@ -0,0 +1,24 @@
package com.baeldung.manifest;
import static org.junit.Assert.*;
import org.junit.Test;
public class ExecuteJarFileUnitTest {
private static final String ERROR_MESSAGE = "no main manifest attribute, in example.jar\n";
private static final String SUCCESS_MESSAGE = "AppExample executed!\n";
@Test
public final void givenDefaultManifest_whenManifestAttributeIsNotPresent_thenGetErrorMessage() {
String output = ExecuteJarFile.executeJarWithoutManifestAttribute();
assertEquals(ERROR_MESSAGE, output);
}
@Test
public final void givenCustomManifest_whenManifestAttributeIsPresent_thenGetSuccessMessage() {
String output = ExecuteJarFile.executeJarWithManifestAttribute();
assertEquals(SUCCESS_MESSAGE, output);
}
}