Skip to content

Commit

Permalink
Restructure Netty tests for modules
Browse files Browse the repository at this point in the history
Move tests outside of io.netty.buffer package because that causes a conflict
with Netty's modules. Change functions marked as protected that are used in
tests to be public to facilitate this refactoring.
  • Loading branch information
jduo committed Nov 28, 2023
1 parent 2a03f29 commit c427fa6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,8 @@ public byte getByte(int index) {
}

@Override
protected short _getShortLE(int index) {
@VisibleForTesting
public short _getShortLE(int index) {
short s = getShort(index);
return Short.reverseBytes(s);
}
Expand All @@ -452,7 +453,8 @@ public short getShort(int index) {
}

@Override
protected int _getIntLE(int index) {
@VisibleForTesting
public int _getIntLE(int index) {
int value = getInt(index);
return Integer.reverseBytes(value);
}
Expand All @@ -468,7 +470,8 @@ public int getInt(int index) {
}

@Override
protected long _getLongLE(int index) {
@VisibleForTesting
public long _getLongLE(int index) {
long value = getLong(index);
return Long.reverseBytes(value);
}
Expand Down Expand Up @@ -509,7 +512,8 @@ protected void _setShortLE(int index, int value) {
}

@Override
protected void _setShort(int index, int value) {
@VisibleForTesting
public void _setShort(int index, int value) {
setShort(index, value);
}

Expand Down Expand Up @@ -581,7 +585,7 @@ public NettyArrowBuf setMedium(int index, int value) {

@Override
@VisibleForTesting
protected void _setInt(int index, int value) {
public void _setInt(int index, int value) {
setInt(index, value);
}

Expand All @@ -599,7 +603,8 @@ public NettyArrowBuf setInt(int index, int value) {
}

@Override
protected void _setLong(int index, long value) {
@VisibleForTesting
public void _setLong(int index, long value) {
setLong(index, value);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package io.netty.buffer;
package org.apache.arrow.io.netty.buffer;

import org.apache.arrow.memory.ArrowBuf;
import org.apache.arrow.memory.BufferAllocator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package io.netty.buffer;
package org.apache.arrow.io.netty.buffer;

import java.nio.ByteBuffer;

Expand Down

0 comments on commit c427fa6

Please sign in to comment.