package us.ihmc.tools.nativelibraries;

import org.apache.commons.lang3.SystemUtils;

import us.ihmc.tools.nativelibraries.NativeLibraryDescription.Platform;

import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail;

public class DefaultNativeLibraryDescriptionTest
{
   @Test
   public void testContructNativeLibraryDescription()
   {
      String packageName = "us.ihmc.native";
      String libraryName = "ihmcNativeUtils";
      String windowsCorrectName = libraryName + ".dll";
      String macCorrectName = "lib" + libraryName + ".dylib";
      String linuxCorrectName = "lib" + libraryName + ".so";
      DefaultNativeLibraryDescription defaultNativeLibraryDescription = new DefaultNativeLibraryDescription(packageName, libraryName);
      
      assertEquals("Package name not set.", packageName, defaultNativeLibraryDescription.getPackage());
      
      if (SystemUtils.IS_OS_WINDOWS)
      {
         String actualName = defaultNativeLibraryDescription.getLibraries(Platform.WIN64)[0];
         System.out.println(windowsCorrectName + " =? " + actualName);
         assertEquals("Library name not correct on Windows.", windowsCorrectName, actualName);
      }
      else if (SystemUtils.IS_OS_MAC)
      {
         String actualName = defaultNativeLibraryDescription.getLibraries(Platform.MACOSX64)[0];
         System.out.println(macCorrectName + " =? " + actualName);
         assertEquals("Library name not correct on Mac.", macCorrectName, actualName);
      }
      else if (SystemUtils.IS_OS_LINUX)
      {
         String actualName = defaultNativeLibraryDescription.getLibraries(Platform.LINUX64)[0];
         System.out.println(linuxCorrectName + " =? " + actualName);
         assertEquals("Library name not correct on Linux.", linuxCorrectName, actualName);
      }
      else
      {
         fail("Unsupported OS.");
      }
   }
}

@@ -878,33 +878,8 @@
 als(
-%22Package name not set.%22, 
 pack
@@ -931,16 +931,41 @@
 ackage()
+, %22Package name not set.%22
 );%0D%0A    
@@ -1196,32 +1196,64 @@
    assertEquals(
+windowsCorrectName, actualName, 
 %22Library name no
@@ -1278,40 +1278,8 @@
 ws.%22
-, windowsCorrectName, actualName
 );%0D%0A
@@ -1515,32 +1515,60 @@
    assertEquals(
+macCorrectName, actualName, 
 %22Library name no
@@ -1589,36 +1589,8 @@
 ac.%22
-, macCorrectName, actualName
 );%0D%0A
@@ -1837,16 +1837,46 @@
 tEquals(
+linuxCorrectName, actualName, 
 %22Library
@@ -1907,38 +1907,8 @@
 ux.%22
-, linuxCorrectName, actualName
 );%0D%0A

Fix test to Junit 5