-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#13 improved tests and minor refactoring
- Loading branch information
Showing
6 changed files
with
82 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
mvn-jlink-wrapper/src/test/java/com/igormaznitsa/mvnjlink/utils/HostOsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package com.igormaznitsa.mvnjlink.utils; | ||
|
||
import static com.igormaznitsa.meta.common.utils.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.condition.OS.FREEBSD; | ||
import static org.junit.jupiter.api.condition.OS.LINUX; | ||
import static org.junit.jupiter.api.condition.OS.MAC; | ||
import static org.junit.jupiter.api.condition.OS.SOLARIS; | ||
import static org.junit.jupiter.api.condition.OS.WINDOWS; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.condition.EnabledOnOs; | ||
|
||
class HostOsTest { | ||
|
||
@Test | ||
@EnabledOnOs(LINUX) | ||
void testLinux() { | ||
assertEquals(HostOs.LINUX, HostOs.findHostOs()); | ||
} | ||
|
||
@Test | ||
@EnabledOnOs(WINDOWS) | ||
void testWindows() { | ||
assertEquals(HostOs.WINDOWS, HostOs.findHostOs()); | ||
} | ||
|
||
@Test | ||
@EnabledOnOs(MAC) | ||
void testMac() { | ||
assertEquals(true, HostOs.findHostOs().isMac()); | ||
} | ||
|
||
@Test | ||
@EnabledOnOs(SOLARIS) | ||
void testSolaris() { | ||
assertEquals(HostOs.SOLARIS, HostOs.findHostOs()); | ||
} | ||
|
||
@Test | ||
@EnabledOnOs(FREEBSD) | ||
void testFreeBsd() { | ||
assertEquals(HostOs.FREE_BSD, HostOs.findHostOs()); | ||
} | ||
|
||
} |
22 changes: 13 additions & 9 deletions
22
mvn-jlink-wrapper/src/test/java/com/igormaznitsa/mvnjlink/utils/HttpUtilsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
package com.igormaznitsa.mvnjlink.utils; | ||
|
||
import org.junit.Test; | ||
import static org.junit.Assert.*; | ||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertNotEquals; | ||
|
||
public class HttpUtilsTest { | ||
import org.junit.jupiter.api.Test; | ||
|
||
class HttpUtilsTest { | ||
|
||
@Test | ||
public void testContentTypeParsed() { | ||
assertTrue(new ContentTypeParsed("text/some+json").equals(new ContentTypeParsed("text/json"))); | ||
assertTrue(new ContentTypeParsed("text/json").equals(new ContentTypeParsed("text/ddd+fff+json"))); | ||
assertFalse(new ContentTypeParsed("image/json").equals(new ContentTypeParsed("text/ddd+fff+json"))); | ||
assertFalse(new ContentTypeParsed("image/json").equals(new ContentTypeParsed("text/ddd+fff+json"))); | ||
assertFalse(new ContentTypeParsed("text/json").equals(new ContentTypeParsed("text/ddd+fff"))); | ||
void testContentTypeParsed() { | ||
assertEquals(new ContentTypeParsed("text/some+json"), new ContentTypeParsed("text/json")); | ||
assertEquals(new ContentTypeParsed("text/json"), new ContentTypeParsed("text/ddd+fff+json")); | ||
assertNotEquals(new ContentTypeParsed("image/json"), | ||
new ContentTypeParsed("text/ddd+fff+json")); | ||
assertNotEquals(new ContentTypeParsed("image/json"), | ||
new ContentTypeParsed("text/ddd+fff+json")); | ||
assertNotEquals(new ContentTypeParsed("text/json"), new ContentTypeParsed("text/ddd+fff")); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters