public class org.apache.nifi.processors.standard.relp.frame.TestRELPDecoder extends java.lang.Object
{
public static final java.lang.String OPEN_FRAME_DATA;
public static final java.lang.String OPEN_FRAME;
public static final java.lang.String SYSLOG_FRAME_DATA;
public static final java.lang.String SYSLOG_FRAME;
public static final java.lang.String CLOSE_FRAME;
private org.apache.nifi.processors.standard.relp.frame.RELPDecoder decoder;
public void <init>()
{
org.apache.nifi.processors.standard.relp.frame.TestRELPDecoder v;
v := @this: org.apache.nifi.processors.standard.relp.frame.TestRELPDecoder;
specialinvoke v.<java.lang.Object: void <init>()>();
return;
}
public void setup()
{
org.apache.nifi.processors.standard.relp.frame.TestRELPDecoder v;
org.apache.nifi.processors.standard.relp.frame.RELPDecoder v;
java.nio.charset.Charset v;
v := @this: org.apache.nifi.processors.standard.relp.frame.TestRELPDecoder;
v = new org.apache.nifi.processors.standard.relp.frame.RELPDecoder;
v = <java.nio.charset.StandardCharsets: java.nio.charset.Charset UTF_8>;
specialinvoke v.<org.apache.nifi.processors.standard.relp.frame.RELPDecoder: void <init>(java.nio.charset.Charset)>(v);
v.<org.apache.nifi.processors.standard.relp.frame.TestRELPDecoder: org.apache.nifi.processors.standard.relp.frame.RELPDecoder decoder> = v;
return;
}
public void testDecodeSingleFrame() throws org.apache.nifi.processors.standard.relp.frame.RELPFrameException
{
byte[] v, v, v;
long v;
byte v;
java.nio.charset.Charset v, v;
int v, v, v;
org.apache.nifi.processors.standard.relp.frame.RELPFrame v;
java.lang.String v, v, v;
boolean v;
org.apache.nifi.processors.standard.relp.frame.TestRELPDecoder v;
org.apache.nifi.processors.standard.relp.frame.RELPDecoder v, v;
v := @this: org.apache.nifi.processors.standard.relp.frame.TestRELPDecoder;
v = "1 open 85 relp_version=0\nrelp_software=librelp,1.2.7,http://librelp.adiscon.com\ncommands=syslog\n";
v = <java.nio.charset.StandardCharsets: java.nio.charset.Charset UTF_8>;
v = virtualinvoke v.<java.lang.String: byte[] getBytes(java.nio.charset.Charset)>(v);
v = null;
v = lengthof v;
v = 0;
label:
if v >= v goto label;
v = v[v];
v = v.<org.apache.nifi.processors.standard.relp.frame.TestRELPDecoder: org.apache.nifi.processors.standard.relp.frame.RELPDecoder decoder>;
v = virtualinvoke v.<org.apache.nifi.processors.standard.relp.frame.RELPDecoder: boolean process(byte)>(v);
if v == 0 goto label;
v = v.<org.apache.nifi.processors.standard.relp.frame.TestRELPDecoder: org.apache.nifi.processors.standard.relp.frame.RELPDecoder decoder>;
v = virtualinvoke v.<org.apache.nifi.processors.standard.relp.frame.RELPDecoder: org.apache.nifi.processors.standard.relp.frame.RELPFrame getFrame()>();
goto label;
label:
v = v + 1;
goto label;
label:
staticinvoke <org.junit.jupiter.api.Assertions: void assertNotNull(java.lang.Object)>(v);
v = virtualinvoke v.<org.apache.nifi.processors.standard.relp.frame.RELPFrame: long getTxnr()>();
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(long,long)>(1L, v);
v = virtualinvoke v.<org.apache.nifi.processors.standard.relp.frame.RELPFrame: java.lang.String getCommand()>();
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(java.lang.Object,java.lang.Object)>("open", v);
v = virtualinvoke v.<org.apache.nifi.processors.standard.relp.frame.RELPFrame: int getDataLength()>();
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(int,int)>(85, v);
v = virtualinvoke v.<org.apache.nifi.processors.standard.relp.frame.RELPFrame: byte[] getData()>();
staticinvoke <org.junit.jupiter.api.Assertions: void assertNotNull(java.lang.Object)>(v);
v = new java.lang.String;
v = virtualinvoke v.<org.apache.nifi.processors.standard.relp.frame.RELPFrame: byte[] getData()>();
v = <java.nio.charset.StandardCharsets: java.nio.charset.Charset UTF_8>;
specialinvoke v.<java.lang.String: void <init>(byte[],java.nio.charset.Charset)>(v, v);
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(java.lang.Object,java.lang.Object)>("relp_version=0\nrelp_software=librelp,1.2.7,http://librelp.adiscon.com\ncommands=syslog", v);
return;
}
public void testDecodeMultipleCommands() throws org.apache.nifi.processors.standard.relp.frame.RELPFrameException
{
byte[] v, v, v, v, v;
byte v;
org.apache.nifi.processors.standard.relp.frame.RELPFrame v;
boolean v;
org.apache.nifi.processors.standard.relp.frame.TestRELPDecoder v;
org.apache.nifi.processors.standard.relp.frame.RELPDecoder v, v;
long v, v, v;
java.util.ArrayList v;
java.nio.charset.Charset v, v, v;
int v, v, v, v, v, v;
java.lang.String v, v, v, v, v, v;
java.lang.Object v, v, v;
v := @this: org.apache.nifi.processors.standard.relp.frame.TestRELPDecoder;
v = "1 open 85 relp_version=0\nrelp_software=librelp,1.2.7,http://librelp.adiscon.com\ncommands=syslog\n syslog 29 this is a syslog message here\n close 0\n";
v = <java.nio.charset.StandardCharsets: java.nio.charset.Charset UTF_8>;
v = virtualinvoke v.<java.lang.String: byte[] getBytes(java.nio.charset.Charset)>(v);
v = new java.util.ArrayList;
specialinvoke v.<java.util.ArrayList: void <init>()>();
v = lengthof v;
v = 0;
label:
if v >= v goto label;
v = v[v];
v = v.<org.apache.nifi.processors.standard.relp.frame.TestRELPDecoder: org.apache.nifi.processors.standard.relp.frame.RELPDecoder decoder>;
v = virtualinvoke v.<org.apache.nifi.processors.standard.relp.frame.RELPDecoder: boolean process(byte)>(v);
if v == 0 goto label;
v = v.<org.apache.nifi.processors.standard.relp.frame.TestRELPDecoder: org.apache.nifi.processors.standard.relp.frame.RELPDecoder decoder>;
v = virtualinvoke v.<org.apache.nifi.processors.standard.relp.frame.RELPDecoder: org.apache.nifi.processors.standard.relp.frame.RELPFrame getFrame()>();
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>(v);
label:
v = v + 1;
goto label;
label:
v = interfaceinvoke v.<java.util.List: int size()>();
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(int,int)>(3, v);
v = interfaceinvoke v.<java.util.List: java.lang.Object get(int)>(0);
staticinvoke <org.junit.jupiter.api.Assertions: void assertNotNull(java.lang.Object)>(v);
v = virtualinvoke v.<org.apache.nifi.processors.standard.relp.frame.RELPFrame: long getTxnr()>();
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(long,long)>(1L, v);
v = virtualinvoke v.<org.apache.nifi.processors.standard.relp.frame.RELPFrame: java.lang.String getCommand()>();
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(java.lang.Object,java.lang.Object)>("open", v);
v = virtualinvoke v.<org.apache.nifi.processors.standard.relp.frame.RELPFrame: int getDataLength()>();
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(int,int)>(85, v);
v = virtualinvoke v.<org.apache.nifi.processors.standard.relp.frame.RELPFrame: byte[] getData()>();
staticinvoke <org.junit.jupiter.api.Assertions: void assertNotNull(java.lang.Object)>(v);
v = new java.lang.String;
v = virtualinvoke v.<org.apache.nifi.processors.standard.relp.frame.RELPFrame: byte[] getData()>();
v = <java.nio.charset.StandardCharsets: java.nio.charset.Charset UTF_8>;
specialinvoke v.<java.lang.String: void <init>(byte[],java.nio.charset.Charset)>(v, v);
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(java.lang.Object,java.lang.Object)>("relp_version=0\nrelp_software=librelp,1.2.7,http://librelp.adiscon.com\ncommands=syslog", v);
v = interfaceinvoke v.<java.util.List: java.lang.Object get(int)>(1);
staticinvoke <org.junit.jupiter.api.Assertions: void assertNotNull(java.lang.Object)>(v);
v = virtualinvoke v.<org.apache.nifi.processors.standard.relp.frame.RELPFrame: long getTxnr()>();
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(long,long)>(2L, v);
v = virtualinvoke v.<org.apache.nifi.processors.standard.relp.frame.RELPFrame: java.lang.String getCommand()>();
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(java.lang.Object,java.lang.Object)>("syslog", v);
v = virtualinvoke v.<org.apache.nifi.processors.standard.relp.frame.RELPFrame: int getDataLength()>();
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(int,int)>(29, v);
v = virtualinvoke v.<org.apache.nifi.processors.standard.relp.frame.RELPFrame: byte[] getData()>();
staticinvoke <org.junit.jupiter.api.Assertions: void assertNotNull(java.lang.Object)>(v);
v = new java.lang.String;
v = virtualinvoke v.<org.apache.nifi.processors.standard.relp.frame.RELPFrame: byte[] getData()>();
v = <java.nio.charset.StandardCharsets: java.nio.charset.Charset UTF_8>;
specialinvoke v.<java.lang.String: void <init>(byte[],java.nio.charset.Charset)>(v, v);
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(java.lang.Object,java.lang.Object)>("this is a syslog message here", v);
v = interfaceinvoke v.<java.util.List: java.lang.Object get(int)>(2);
staticinvoke <org.junit.jupiter.api.Assertions: void assertNotNull(java.lang.Object)>(v);
v = virtualinvoke v.<org.apache.nifi.processors.standard.relp.frame.RELPFrame: long getTxnr()>();
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(long,long)>(3L, v);
v = virtualinvoke v.<org.apache.nifi.processors.standard.relp.frame.RELPFrame: java.lang.String getCommand()>();
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(java.lang.Object,java.lang.Object)>("close", v);
v = virtualinvoke v.<org.apache.nifi.processors.standard.relp.frame.RELPFrame: int getDataLength()>();
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(int,int)>(0, v);
return;
}
public void testDecodeMultipleSyslogCommands() throws org.apache.nifi.processors.standard.relp.frame.RELPFrameException
{
byte[] v;
java.util.ArrayList v;
org.apache.nifi.processors.standard.relp.frame.TestRELPDecoder v;
org.apache.nifi.processors.standard.relp.frame.RELPDecoder v, v;
byte v;
java.nio.charset.Charset v;
int v, v, v;
org.apache.nifi.processors.standard.relp.frame.RELPFrame v;
java.lang.String v;
boolean v;
v := @this: org.apache.nifi.processors.standard.relp.frame.TestRELPDecoder;
v = "1 syslog 20 this is message 1234\n syslog 22 this is message 456789\n syslog 21 this is message ABCDE\n";
v = <java.nio.charset.StandardCharsets: java.nio.charset.Charset UTF_8>;
v = virtualinvoke v.<java.lang.String: byte[] getBytes(java.nio.charset.Charset)>(v);
v = new java.util.ArrayList;
specialinvoke v.<java.util.ArrayList: void <init>()>();
v = lengthof v;
v = 0;
label:
if v >= v goto label;
v = v[v];
v = v.<org.apache.nifi.processors.standard.relp.frame.TestRELPDecoder: org.apache.nifi.processors.standard.relp.frame.RELPDecoder decoder>;
v = virtualinvoke v.<org.apache.nifi.processors.standard.relp.frame.RELPDecoder: boolean process(byte)>(v);
if v == 0 goto label;
v = v.<org.apache.nifi.processors.standard.relp.frame.TestRELPDecoder: org.apache.nifi.processors.standard.relp.frame.RELPDecoder decoder>;
v = virtualinvoke v.<org.apache.nifi.processors.standard.relp.frame.RELPDecoder: org.apache.nifi.processors.standard.relp.frame.RELPFrame getFrame()>();
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>(v);
label:
v = v + 1;
goto label;
label:
v = interfaceinvoke v.<java.util.List: int size()>();
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(int,int)>(3, v);
return;
}
public void testBadDataShouldThrowException()
{
org.apache.nifi.processors.standard.relp.frame.TestRELPDecoder v;
org.junit.jupiter.api.function.Executable v;
v := @this: org.apache.nifi.processors.standard.relp.frame.TestRELPDecoder;
v = staticinvoke <org.apache.nifi.processors.standard.relp.frame.TestRELPDecoder$lambda_testBadDataShouldThrowException_0__269: org.junit.jupiter.api.function.Executable bootstrap$(org.apache.nifi.processors.standard.relp.frame.TestRELPDecoder)>(v);
staticinvoke <org.junit.jupiter.api.Assertions: java.lang.Throwable assertThrows(java.lang.Class,org.junit.jupiter.api.function.Executable)>(class "Lorg/apache/nifi/processors/standard/relp/frame/RELPFrameException;", v);
return;
}
}