Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import java.util.List;
import org.junit.jupiter.api.Test;

public class HoldsModifiableVariableTest {
class HoldsModifiableVariableTest {

// Test class with HoldsModifiableVariable annotations
private static class TestClass {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
import java.math.BigInteger;
import org.junit.jupiter.api.Test;

public class ModifiableVariableFactoryTest {
class ModifiableVariableFactoryTest {

@Test
public void testSafelySetValueBigInteger() {
void testSafelySetValueBigInteger() {
// Test with null ModifiableBigInteger
BigInteger originalValue = new BigInteger("12345");
ModifiableBigInteger result = ModifiableVariableFactory.safelySetValue(null, originalValue);
Expand All @@ -42,7 +42,7 @@ public void testSafelySetValueBigInteger() {
}

@Test
public void testSafelySetValueString() {
void testSafelySetValueString() {
// Test with null ModifiableString
String originalValue = "test string";
ModifiableString result = ModifiableVariableFactory.safelySetValue(null, originalValue);
Expand All @@ -60,7 +60,7 @@ public void testSafelySetValueString() {
}

@Test
public void testSafelySetValueInteger() {
void testSafelySetValueInteger() {
// Test with null ModifiableInteger
Integer originalValue = 42;
ModifiableInteger result = ModifiableVariableFactory.safelySetValue(null, originalValue);
Expand All @@ -78,7 +78,7 @@ public void testSafelySetValueInteger() {
}

@Test
public void testSafelySetValueByte() {
void testSafelySetValueByte() {
// Test with null ModifiableByte
Byte originalValue = (byte) 0xAB;
ModifiableByte result = ModifiableVariableFactory.safelySetValue(null, originalValue);
Expand All @@ -95,7 +95,7 @@ public void testSafelySetValueByte() {
}

@Test
public void testSafelySetValueByteArray() {
void testSafelySetValueByteArray() {
// Test with null ModifiableByteArray
byte[] originalValue = new byte[] {0x01, 0x02, 0x03};
ModifiableByteArray result = ModifiableVariableFactory.safelySetValue(null, originalValue);
Expand All @@ -119,7 +119,7 @@ public void testSafelySetValueByteArray() {
}

@Test
public void testSafelySetValueLong() {
void testSafelySetValueLong() {
// Test with null ModifiableLong
Long originalValue = 9999999999L;
ModifiableLong result = ModifiableVariableFactory.safelySetValue(null, originalValue);
Expand All @@ -136,7 +136,7 @@ public void testSafelySetValueLong() {
}

@Test
public void testSafelySetValueBoolean() {
void testSafelySetValueBoolean() {
// Test with null ModifiableBoolean
Boolean originalValue = Boolean.TRUE;
ModifiableBoolean result = ModifiableVariableFactory.safelySetValue(null, originalValue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

public class ModifiableVariableHolderTest {
class ModifiableVariableHolderTest {

private TestModifiableVariableHolder holder;

Expand All @@ -34,7 +34,7 @@ private static class TestModifiableVariableHolder extends ModifiableVariableHold
private String regularString;
private NestedHolder nestedHolder;

public TestModifiableVariableHolder() {
TestModifiableVariableHolder() {
intValue = new ModifiableInteger();
stringValue = new ModifiableString();
byteArrayValue = new ModifiableByteArray();
Expand All @@ -47,22 +47,22 @@ public TestModifiableVariableHolder() {
private static class NestedHolder extends ModifiableVariableHolder {
private ModifiableInteger nestedInt;

public NestedHolder() {
NestedHolder() {
nestedInt = new ModifiableInteger();
nestedInt.setOriginalValue(42);
}
}

@BeforeEach
public void setUp() {
void setUp() {
holder = new TestModifiableVariableHolder();
holder.intValue.setOriginalValue(123);
holder.stringValue.setOriginalValue("Test String");
holder.byteArrayValue.setOriginalValue(new byte[] {0x04, 0x05, 0x06});
}

@Test
public void testGetAllModifiableVariableFields() {
void testGetAllModifiableVariableFields() {
List<Field> fields = holder.getAllModifiableVariableFields();

// Should find 3 fields: intValue, stringValue, byteArrayValue
Expand Down Expand Up @@ -93,7 +93,7 @@ public void testGetAllModifiableVariableFields() {
}

@Test
public void testGetRandomModifiableVariableField() {
void testGetRandomModifiableVariableField() {
// Use a fixed seed for reproducible test
Random random = new Random(123);

Expand All @@ -103,7 +103,7 @@ public void testGetRandomModifiableVariableField() {
}

@Test
public void testGetAllModifiableVariableHolders() {
void testGetAllModifiableVariableHolders() {
List<ModifiableVariableHolder> holders = holder.getAllModifiableVariableHolders();

// Should only contain the holder itself by default
Expand All @@ -112,7 +112,7 @@ public void testGetAllModifiableVariableHolders() {
}

@Test
public void testGetRandomModifiableVariableHolder() {
void testGetRandomModifiableVariableHolder() {
// Use a fixed seed for reproducible test
Random random = new Random(123);

Expand All @@ -122,7 +122,7 @@ public void testGetRandomModifiableVariableHolder() {
}

@Test
public void testReset() {
void testReset() {
// Apply a modification to test reset
VariableModification<Integer> modification =
new VariableModification<Integer>() {
Expand Down Expand Up @@ -150,7 +150,7 @@ public VariableModification<Integer> createCopy() {
}

@Test
public void testGetExtendedString() {
void testGetExtendedString() {
String result = holder.getExtendedString();
System.out.println("Extended string content: " + result);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import java.util.Map;
import org.junit.jupiter.api.Test;

public class ModifiableVariablePropertyTest {
class ModifiableVariablePropertyTest {

// Test class with annotated fields
private static class TestClass {
Expand Down Expand Up @@ -54,7 +54,7 @@ private static class TestClass {
}

@Test
public void testLengthProperty() throws NoSuchFieldException {
void testLengthProperty() throws NoSuchFieldException {
Field lengthField = TestClass.class.getDeclaredField("length");
ModifiableVariableProperty annotation =
lengthField.getAnnotation(ModifiableVariableProperty.class);
Expand All @@ -67,7 +67,7 @@ public void testLengthProperty() throws NoSuchFieldException {
}

@Test
public void testCountProperty() throws NoSuchFieldException {
void testCountProperty() throws NoSuchFieldException {
Field countField = TestClass.class.getDeclaredField("count");
ModifiableVariableProperty annotation =
countField.getAnnotation(ModifiableVariableProperty.class);
Expand All @@ -80,7 +80,7 @@ public void testCountProperty() throws NoSuchFieldException {
}

@Test
public void testSignatureWithEncodingProperty() throws NoSuchFieldException {
void testSignatureWithEncodingProperty() throws NoSuchFieldException {
Field signatureField = TestClass.class.getDeclaredField("signatureWithEncoding");
ModifiableVariableProperty annotation =
signatureField.getAnnotation(ModifiableVariableProperty.class);
Expand All @@ -91,7 +91,7 @@ public void testSignatureWithEncodingProperty() throws NoSuchFieldException {
}

@Test
public void testDefaultProperty() throws NoSuchFieldException {
void testDefaultProperty() throws NoSuchFieldException {
Field defaultField = TestClass.class.getDeclaredField("defaultProperty");
ModifiableVariableProperty annotation =
defaultField.getAnnotation(ModifiableVariableProperty.class);
Expand All @@ -104,7 +104,7 @@ public void testDefaultProperty() throws NoSuchFieldException {
}

@Test
public void testEnhancedProperty() throws NoSuchFieldException {
void testEnhancedProperty() throws NoSuchFieldException {
Field enhancedField = TestClass.class.getDeclaredField("enhancedProperty");
ModifiableVariableProperty annotation =
enhancedField.getAnnotation(ModifiableVariableProperty.class);
Expand All @@ -117,7 +117,7 @@ public void testEnhancedProperty() throws NoSuchFieldException {
}

@Test
public void testNewPurposeEnums() throws NoSuchFieldException {
void testNewPurposeEnums() throws NoSuchFieldException {
Field versionField = TestClass.class.getDeclaredField("protocolVersion");
ModifiableVariableProperty versionAnnotation =
versionField.getAnnotation(ModifiableVariableProperty.class);
Expand All @@ -143,7 +143,7 @@ public void testNewPurposeEnums() throws NoSuchFieldException {
}

@Test
public void testModifiableVariableAnalyzer() {
void testModifiableVariableAnalyzer() {
List<Field> annotatedFields =
ModifiableVariableAnalyzer.getAnnotatedFields(TestClass.class);
assertEquals(8, annotatedFields.size()); // 8 annotated fields in TestClass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
import java.util.List;
import org.junit.jupiter.api.Test;

public class ModifiableVariableTest {
class ModifiableVariableTest {

/** Test setModifications with a list of modifications. */
@Test
public void testSetModifications() {
void testSetModifications() {
ModifiableInteger integer = new ModifiableInteger();
integer.setOriginalValue(100);

Expand All @@ -39,7 +39,7 @@ public void testSetModifications() {

/** Test clear modifications. */
@Test
public void testClearModifications() {
void testClearModifications() {
ModifiableInteger integer = new ModifiableInteger();
integer.setOriginalValue(100);

Expand All @@ -56,7 +56,7 @@ public void testClearModifications() {

/** Test addModification with null. */
@Test
public void testAddModificationWithNull() {
void testAddModificationWithNull() {
ModifiableInteger integer = new ModifiableInteger();
integer.setOriginalValue(100);

Expand All @@ -69,7 +69,7 @@ public void testAddModificationWithNull() {

/** Test copy constructor with modifications. */
@Test
public void testCopyConstructorWithModifications() {
void testCopyConstructorWithModifications() {
// Create and set up original instance
ModifiableInteger original = new ModifiableInteger();
original.setOriginalValue(100);
Expand All @@ -87,7 +87,7 @@ public void testCopyConstructorWithModifications() {

/** Test getModifications method. */
@Test
public void testGetModifications() {
void testGetModifications() {
ModifiableInteger integer = new ModifiableInteger();
integer.setOriginalValue(100);

Expand All @@ -114,7 +114,7 @@ public void testGetModifications() {

/** Test containsAssertion method. */
@Test
public void testContainsAssertion() {
void testContainsAssertion() {
ModifiableInteger integer = new ModifiableInteger();

// Initially no assertion
Expand All @@ -131,7 +131,7 @@ public void testContainsAssertion() {

/** Test innerToString method through subclass toString. */
@Test
public void testInnerToString() {
void testInnerToString() {
// Test with no modifications or assertions
ModifiableInteger integer1 = new ModifiableInteger();
integer1.setOriginalValue(100);
Expand Down
Loading