Skip to content

Commit

Permalink
Use checkstyle standard code
Browse files Browse the repository at this point in the history
Use checkstyle standard code
  • Loading branch information
doleyzi committed Dec 8, 2021
1 parent 0f77dcf commit 9608f05
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,10 @@

package org.apache.inlong.audit;


import org.junit.Test;

public class AuditImpTest {
@Test
public void init() {
AuditImp.getInstance().init("inlog_audit.txt");
}


@Test
public void add() {
AuditImp.getInstance().init("inlog_audit.txt");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ public class SenderChannelTest {
private ChannelFuture future;
SenderChannel senderChannel;

/**
* test SenderChannel
*/
public SenderChannelTest() {
try {
client.setFactory(new NioClientSocketChannelFactory(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public class SenderGroupTest {
public void send() {
AuditApi.AuditMessageHeader header = AuditApi.AuditMessageHeader.newBuilder().setIp("127.0.0.1").build();
AuditApi.AuditMessageBody body = AuditApi.AuditMessageBody.newBuilder().setAuditId("1").build();
AuditApi.AuditRequest content = AuditApi.AuditRequest.newBuilder().setMsgHeader(header).addMsgBody(body).build();
AuditApi.AuditRequest content = AuditApi.AuditRequest.newBuilder().setMsgHeader(header)
.addMsgBody(body).build();
AuditData testData = new AuditData(System.currentTimeMillis(), content, 1L);
ChannelBuffer dataBuf = ChannelBuffers.wrappedBuffer(testData.getDataByte());
sender.send(dataBuf);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.apache.inlong.audit.util.Config;
import org.junit.Test;


public class SenderManagerTest {
private Config testConfig = new Config();

Expand All @@ -35,21 +34,22 @@ public void reload() {
@Test
public void nextRequestId() {
SenderManager testManager = new SenderManager(testConfig);
Long RequestId = testManager.nextRequestId();
System.out.println(RequestId);
Long requestId = testManager.nextRequestId();
System.out.println(requestId);

RequestId = testManager.nextRequestId();
System.out.println(RequestId);
requestId = testManager.nextRequestId();
System.out.println(requestId);

RequestId = testManager.nextRequestId();
System.out.println(RequestId);
requestId = testManager.nextRequestId();
System.out.println(requestId);
}

@Test
public void send() {
AuditApi.AuditMessageHeader header = AuditApi.AuditMessageHeader.newBuilder().setIp("127.0.0.1").build();
AuditApi.AuditMessageBody body = AuditApi.AuditMessageBody.newBuilder().setAuditId("1").build();
AuditApi.AuditRequest content = AuditApi.AuditRequest.newBuilder().setMsgHeader(header).addMsgBody(body).build();
AuditApi.AuditRequest content = AuditApi.AuditRequest.newBuilder().setMsgHeader(header)
.addMsgBody(body).build();
SenderManager testManager = new SenderManager(testConfig);
testManager.send(System.currentTimeMillis(), content);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.apache.inlong.audit.protocol.AuditApi;
import org.junit.Test;


public class AuditDataTest {
@Test
public void increaseResendTimes() {
Expand All @@ -38,9 +37,10 @@ public void increaseResendTimes() {
public void getDataByte() {
AuditApi.AuditMessageHeader header = AuditApi.AuditMessageHeader.newBuilder().setIp("127.0.0.1").build();
AuditApi.AuditMessageBody body = AuditApi.AuditMessageBody.newBuilder().setAuditId("1").build();
AuditApi.AuditRequest content = AuditApi.AuditRequest.newBuilder().setMsgHeader(header).addMsgBody(body).build();
AuditApi.AuditRequest content = AuditApi.AuditRequest.newBuilder().setMsgHeader(header)
.addMsgBody(body).build();
AuditData test = new AuditData(System.currentTimeMillis(), content, 1L);
byte data[] = test.getDataByte();
byte[] data = test.getDataByte();
System.out.println(data[0]);
System.out.println(data);
}
Expand Down

0 comments on commit 9608f05

Please sign in to comment.