diff --git a/.gitignore b/.gitignore index 3736e95..cf5943b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,23 @@ -target -.settings -.project -.classpath -.iml +.DS_Store +*.iml +*.ipr +*.iws +*.orig +*.rej +**/.keep +*.sdf +*.suo +*.vcxproj.user +.dev-tools/ +.hugo_build.lock .idea +.classpath .mvn/.develocity/ -*.versionsBackup +.project +.settings +target +build +patchprocess +dependency-reduced-pom.xml +.mvn/wrapper/maven-wrapper.jar +.vscode/ diff --git a/test/src/test/java/org/apache/ratis/thirdparty/com/google/protobuf/ProtobufTest.java b/test/src/test/java/org/apache/ratis/thirdparty/com/google/protobuf/ProtobufTest.java new file mode 100644 index 0000000..1aaf1c6 --- /dev/null +++ b/test/src/test/java/org/apache/ratis/thirdparty/com/google/protobuf/ProtobufTest.java @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.ratis.thirdparty.com.google.protobuf; + +import java.nio.ByteBuffer; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** Unit test for protobuf in order to access package private artifacts. */ +public class ProtobufTest { + @Test + public void testNioByteStringExist() { + final byte[] array = new byte[10]; + final NioByteString nioByteString = new NioByteString(ByteBuffer.wrap(array)); + assertEquals(array.length, nioByteString.size()); + } +}