Update buildscripts (#354)

This commit is contained in:
Serenibyss
2024-01-09 00:47:53 -06:00
committed by GitHub
parent f7651fff29
commit 8c7185f8ff
20 changed files with 796 additions and 638 deletions
@@ -18,13 +18,11 @@
package appeng.util.helpers;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import appeng.api.util.AEColor;
import org.junit.jupiter.api.Test;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
public class P2PHelperTest
@@ -50,17 +48,17 @@ public class P2PHelperTest
@Test
public void testToColors()
{
assertArrayEquals( WHITE_COLORS, this.unitUnderTest.toColors( WHITE_FREQUENCY ) );
assertArrayEquals( BLACK_COLORS, this.unitUnderTest.toColors( BLACK_FREQUENCY ) );
assertArrayEquals( MULTI_COLORS, this.unitUnderTest.toColors( MULTI_FREQUENCY ) );
assertThat( WHITE_COLORS, is( this.unitUnderTest.toColors( WHITE_FREQUENCY ) ) );
assertThat( BLACK_COLORS, is( this.unitUnderTest.toColors( BLACK_FREQUENCY ) ) );
assertThat( MULTI_COLORS, is( this.unitUnderTest.toColors( MULTI_FREQUENCY ) ) );
}
@Test
public void testFromColors()
{
assertEquals( WHITE_FREQUENCY, this.unitUnderTest.fromColors( WHITE_COLORS ) );
assertEquals( BLACK_FREQUENCY, this.unitUnderTest.fromColors( BLACK_COLORS ) );
assertEquals( MULTI_FREQUENCY, this.unitUnderTest.fromColors( MULTI_COLORS ) );
assertThat( WHITE_FREQUENCY, is( this.unitUnderTest.fromColors( WHITE_COLORS ) ) );
assertThat( BLACK_FREQUENCY, is( this.unitUnderTest.fromColors( BLACK_COLORS ) ) );
assertThat( MULTI_FREQUENCY, is( this.unitUnderTest.fromColors( MULTI_COLORS ) ) );
}
@Test
@@ -68,40 +66,39 @@ public class P2PHelperTest
{
for( short i = Short.MIN_VALUE; i < Short.MAX_VALUE; i++ )
{
assertEquals( i, this.unitUnderTest.fromColors( this.unitUnderTest.toColors( i ) ) );
assertThat( i, is( this.unitUnderTest.fromColors( this.unitUnderTest.toColors( i ) ) ));
}
}
@Test
public void testToHexDigit()
{
assertEquals( "0", this.unitUnderTest.toHexDigit( AEColor.WHITE ) );
assertEquals( "1", this.unitUnderTest.toHexDigit( AEColor.ORANGE ) );
assertEquals( "2", this.unitUnderTest.toHexDigit( AEColor.MAGENTA ) );
assertEquals( "3", this.unitUnderTest.toHexDigit( AEColor.LIGHT_BLUE ) );
assertEquals( "4", this.unitUnderTest.toHexDigit( AEColor.YELLOW ) );
assertEquals( "5", this.unitUnderTest.toHexDigit( AEColor.LIME ) );
assertEquals( "6", this.unitUnderTest.toHexDigit( AEColor.PINK ) );
assertEquals( "7", this.unitUnderTest.toHexDigit( AEColor.GRAY ) );
assertEquals( "8", this.unitUnderTest.toHexDigit( AEColor.LIGHT_GRAY ) );
assertEquals( "9", this.unitUnderTest.toHexDigit( AEColor.CYAN ) );
assertEquals( "A", this.unitUnderTest.toHexDigit( AEColor.PURPLE ) );
assertEquals( "B", this.unitUnderTest.toHexDigit( AEColor.BLUE ) );
assertEquals( "C", this.unitUnderTest.toHexDigit( AEColor.BROWN ) );
assertEquals( "D", this.unitUnderTest.toHexDigit( AEColor.GREEN ) );
assertEquals( "E", this.unitUnderTest.toHexDigit( AEColor.RED ) );
assertEquals( "F", this.unitUnderTest.toHexDigit( AEColor.BLACK ) );
assertThat( "0", is( this.unitUnderTest.toHexDigit( AEColor.WHITE ) ) );
assertThat( "1", is( this.unitUnderTest.toHexDigit( AEColor.ORANGE ) ) );
assertThat( "2", is( this.unitUnderTest.toHexDigit( AEColor.MAGENTA ) ) );
assertThat( "3", is( this.unitUnderTest.toHexDigit( AEColor.LIGHT_BLUE ) ) );
assertThat( "4", is( this.unitUnderTest.toHexDigit( AEColor.YELLOW ) ) );
assertThat( "5", is( this.unitUnderTest.toHexDigit( AEColor.LIME ) ) );
assertThat( "6", is( this.unitUnderTest.toHexDigit( AEColor.PINK ) ) );
assertThat( "7", is( this.unitUnderTest.toHexDigit( AEColor.GRAY ) ) );
assertThat( "8", is( this.unitUnderTest.toHexDigit( AEColor.LIGHT_GRAY ) ) );
assertThat( "9", is( this.unitUnderTest.toHexDigit( AEColor.CYAN ) ) );
assertThat( "A", is( this.unitUnderTest.toHexDigit( AEColor.PURPLE ) ) );
assertThat( "B", is( this.unitUnderTest.toHexDigit( AEColor.BLUE ) ) );
assertThat( "C", is( this.unitUnderTest.toHexDigit( AEColor.BROWN ) ) );
assertThat( "D", is( this.unitUnderTest.toHexDigit( AEColor.GREEN ) ) );
assertThat( "E", is( this.unitUnderTest.toHexDigit( AEColor.RED ) ) );
assertThat( "F", is( this.unitUnderTest.toHexDigit( AEColor.BLACK ) ) );
}
@Test
public void testToHexString()
{
assertEquals( HEX_WHITE_FREQUENCY, this.unitUnderTest.toHexString( WHITE_FREQUENCY ) );
assertEquals( HEX_BLACK_FREQUENCY, this.unitUnderTest.toHexString( BLACK_FREQUENCY ) );
assertEquals( HEX_MULTI_FREQUENCY, this.unitUnderTest.toHexString( MULTI_FREQUENCY ) );
assertThat( HEX_WHITE_FREQUENCY, is( this.unitUnderTest.toHexString( WHITE_FREQUENCY ) ) );
assertThat( HEX_BLACK_FREQUENCY, is( this.unitUnderTest.toHexString( BLACK_FREQUENCY ) ) );
assertThat( HEX_MULTI_FREQUENCY, is( this.unitUnderTest.toHexString( MULTI_FREQUENCY ) ) );
assertEquals( HEX_MIN_FREQUENCY, this.unitUnderTest.toHexString( Short.MIN_VALUE ) );
assertEquals( HEX_MAX_FREQUENCY, this.unitUnderTest.toHexString( Short.MAX_VALUE ) );
assertThat( HEX_MIN_FREQUENCY, is( this.unitUnderTest.toHexString( Short.MIN_VALUE ) ) );
assertThat( HEX_MAX_FREQUENCY, is( this.unitUnderTest.toHexString( Short.MAX_VALUE ) ) );
}
}