forked from apache/rocketmq
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ISSUE#525]add aclClient PRCHook for message track (apache#638)
* prepare to separate production-ready projects from the external projects * Update fastjson to the latest stable version * Clean code, don't list the default config in JVM * Update README.md * update the year info in NOTICE * Release semaphore when timeout * [ISSUE#525]add aclClient PRCHook for message track * [ISSUE#525]add the apache license text,remove the merged from master branch * [ISSUE#525]add aclClient PRCHook for message track,remove the merged content of notice and readme.md from master branch,add some unit test to increase the code coverage.
- Loading branch information
1 parent
bc72e36
commit b8a511c
Showing
11 changed files
with
217 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
acl/src/test/java/org/apache/rocketmq/acl/common/AclSignerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
broker/src/test/java/org/apache/rocketmq/broker/pagecache/ManyMessageTransferTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* 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.rocketmq.broker.pagecache; | ||
|
||
import java.nio.ByteBuffer; | ||
import org.apache.rocketmq.store.GetMessageResult; | ||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
public class ManyMessageTransferTest { | ||
|
||
@Test | ||
public void ManyMessageTransferBuilderTest(){ | ||
ByteBuffer byteBuffer = ByteBuffer.allocate(20); | ||
byteBuffer.putInt(20); | ||
GetMessageResult getMessageResult = new GetMessageResult(); | ||
ManyMessageTransfer manyMessageTransfer = new ManyMessageTransfer(byteBuffer,getMessageResult); | ||
} | ||
|
||
@Test | ||
public void ManyMessageTransferPosTest(){ | ||
ByteBuffer byteBuffer = ByteBuffer.allocate(20); | ||
byteBuffer.putInt(20); | ||
GetMessageResult getMessageResult = new GetMessageResult(); | ||
ManyMessageTransfer manyMessageTransfer = new ManyMessageTransfer(byteBuffer,getMessageResult); | ||
Assert.assertEquals(manyMessageTransfer.position(),4); | ||
} | ||
|
||
@Test | ||
public void ManyMessageTransferCountTest(){ | ||
ByteBuffer byteBuffer = ByteBuffer.allocate(20); | ||
byteBuffer.putInt(20); | ||
GetMessageResult getMessageResult = new GetMessageResult(); | ||
ManyMessageTransfer manyMessageTransfer = new ManyMessageTransfer(byteBuffer,getMessageResult); | ||
|
||
Assert.assertEquals(manyMessageTransfer.count(),20); | ||
|
||
} | ||
|
||
@Test | ||
public void ManyMessageTransferCloseTest(){ | ||
ByteBuffer byteBuffer = ByteBuffer.allocate(20); | ||
byteBuffer.putInt(20); | ||
GetMessageResult getMessageResult = new GetMessageResult(); | ||
ManyMessageTransfer manyMessageTransfer = new ManyMessageTransfer(byteBuffer,getMessageResult); | ||
manyMessageTransfer.close(); | ||
manyMessageTransfer.deallocate(); | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
broker/src/test/java/org/apache/rocketmq/broker/pagecache/OneMessageTransferTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* 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.rocketmq.broker.pagecache; | ||
|
||
import java.nio.ByteBuffer; | ||
import org.apache.rocketmq.store.MappedFile; | ||
import org.apache.rocketmq.store.SelectMappedBufferResult; | ||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
public class OneMessageTransferTest { | ||
|
||
@Test | ||
public void OneMessageTransferTest(){ | ||
ByteBuffer byteBuffer = ByteBuffer.allocate(20); | ||
byteBuffer.putInt(20); | ||
SelectMappedBufferResult selectMappedBufferResult = new SelectMappedBufferResult(0,byteBuffer,20,new MappedFile()); | ||
OneMessageTransfer manyMessageTransfer = new OneMessageTransfer(byteBuffer,selectMappedBufferResult); | ||
} | ||
|
||
@Test | ||
public void OneMessageTransferCountTest(){ | ||
ByteBuffer byteBuffer = ByteBuffer.allocate(20); | ||
byteBuffer.putInt(20); | ||
SelectMappedBufferResult selectMappedBufferResult = new SelectMappedBufferResult(0,byteBuffer,20,new MappedFile()); | ||
OneMessageTransfer manyMessageTransfer = new OneMessageTransfer(byteBuffer,selectMappedBufferResult); | ||
Assert.assertEquals(manyMessageTransfer.count(),40); | ||
} | ||
|
||
@Test | ||
public void OneMessageTransferPosTest(){ | ||
ByteBuffer byteBuffer = ByteBuffer.allocate(20); | ||
byteBuffer.putInt(20); | ||
SelectMappedBufferResult selectMappedBufferResult = new SelectMappedBufferResult(0,byteBuffer,20,new MappedFile()); | ||
OneMessageTransfer manyMessageTransfer = new OneMessageTransfer(byteBuffer,selectMappedBufferResult); | ||
Assert.assertEquals(manyMessageTransfer.position(),8); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters