Skip to content

Add unit tests for Vector3Serializer round-trip serialization#2811

Open
xinzhoudev wants to merge 1 commit into
jMonkeyEngine:masterfrom
xinzhoudev:master
Open

Add unit tests for Vector3Serializer round-trip serialization#2811
xinzhoudev wants to merge 1 commit into
jMonkeyEngine:masterfrom
xinzhoudev:master

Conversation

@xinzhoudev
Copy link
Copy Markdown

This PR introduces Vector3SerializerTest, a JUnit test class that validates the round-trip correctness of Vector3Serializer, which is responsible for encoding Vector3f positions and directions in multiplayer network messages.

A test case for networking.
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces unit tests for the Vector3Serializer class, verifying that it correctly serializes and deserializes Vector3f objects. However, there is a package mismatch in the new test file where the declared package does not match its directory path, which will cause compilation errors. A suggestion has been provided to correct the package declaration and add the necessary import.

Comment on lines +32 to +37
package com.jme3.network.serializing.serializers;

import com.jme3.math.Vector3f;
import java.io.IOException;
import java.nio.ByteBuffer;
import org.junit.Test;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The package declaration com.jme3.network.serializing.serializers does not match the file's directory path com/jme3/network/message/. This will cause compilation errors. Please update the package declaration to com.jme3.network.message and import Vector3Serializer explicitly.

Suggested change
package com.jme3.network.serializing.serializers;
import com.jme3.math.Vector3f;
import java.io.IOException;
import java.nio.ByteBuffer;
import org.junit.Test;
package com.jme3.network.message;
import com.jme3.math.Vector3f;
import com.jme3.network.serializing.serializers.Vector3Serializer;
import java.io.IOException;
import java.nio.ByteBuffer;
import org.junit.Test;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant