ottobackwards commented on a change in pull request #257:
URL: https://github.com/apache/plc4x/pull/257#discussion_r695044678



##########
File path: 
plc4j/integrations/apache-nifi/nifi-plc4x-processors/src/test/java/org/apache/plc4x/nifi/util/Plc4xSchemaTest.java
##########
@@ -0,0 +1,125 @@
+package org.apache.plc4x.nifi.util;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.avro.Schema;
+import org.apache.nifi.avro.AvroTypeUtil;
+import org.apache.nifi.serialization.record.MapRecord;
+import org.apache.plc4x.java.api.value.PlcValue;
+import org.apache.plc4x.java.spi.values.PlcBOOL;
+import org.apache.plc4x.java.spi.values.PlcBYTE;
+import org.apache.plc4x.java.spi.values.PlcBigDecimal;
+import org.apache.plc4x.java.spi.values.PlcBigInteger;
+import org.apache.plc4x.java.spi.values.PlcBitString;
+import org.apache.plc4x.java.spi.values.PlcCHAR;
+import org.apache.plc4x.java.spi.values.PlcDATE;
+import org.apache.plc4x.java.spi.values.PlcDATE_AND_TIME;
+import org.apache.plc4x.java.spi.values.PlcDINT;
+import org.apache.plc4x.java.spi.values.PlcDWORD;
+import org.apache.plc4x.java.spi.values.PlcINT;
+import org.apache.plc4x.java.spi.values.PlcLINT;
+import org.apache.plc4x.java.spi.values.PlcLREAL;
+import org.apache.plc4x.java.spi.values.PlcLTIME;
+import org.apache.plc4x.java.spi.values.PlcLWORD;
+import org.apache.plc4x.java.spi.values.PlcList;
+import org.apache.plc4x.java.spi.values.PlcNull;
+import org.apache.plc4x.java.spi.values.PlcREAL;
+import org.apache.plc4x.java.spi.values.PlcSINT;
+import org.apache.plc4x.java.spi.values.PlcSTRING;
+import org.apache.plc4x.java.spi.values.PlcStruct;
+import org.apache.plc4x.java.spi.values.PlcTIME;
+import org.apache.plc4x.java.spi.values.PlcTIME_OF_DAY;
+import org.apache.plc4x.java.spi.values.PlcUDINT;
+import org.apache.plc4x.java.spi.values.PlcUINT;
+import org.apache.plc4x.java.spi.values.PlcULINT;
+import org.apache.plc4x.java.spi.values.PlcUSINT;
+import org.apache.plc4x.java.spi.values.PlcWCHAR;
+import org.apache.plc4x.java.spi.values.PlcWORD;
+import org.junit.jupiter.api.Test;
+
+public class Plc4xSchemaTest {
+       
+    @Test
+    public void testSchemaTypesAndValues() {
+       
+       Map<String, PlcValue> map = new HashMap<String, PlcValue>();
+       Map<String, Object> mapValues = new HashMap<String, Object>();
+       //Map<String, ? extends PlcValue> map = new HashMap<String, PlcValue>();
+       
+       
+       Double plcBigDecimalOriginal = 10.0;
+       PlcValue plcBigDecimal = new PlcBigDecimal(new 
BigDecimal(plcBigDecimalOriginal));
+       map.put("plcBigDecimal", plcBigDecimal);
+       mapValues.put("plcBigDecimal", 
Plc4xCommon.normalizeValue(plcBigDecimal));
+       
+       Integer plcBigIntegerOriginal = 10;
+       PlcValue plcBigInteger = new 
PlcBigInteger(BigInteger.valueOf(plcBigIntegerOriginal));
+       map.put("plcBigInteger", plcBigInteger);
+       mapValues.put("plcBigInteger", 
Plc4xCommon.normalizeValue(plcBigInteger));
+       
+       
+       Boolean plcBooleanOriginal = false;
+       PlcValue plcBoolean = new PlcBOOL(plcBooleanOriginal);
+       map.put("plcBoolean", plcBoolean);
+       mapValues.put("plcBoolean", Plc4xCommon.normalizeValue(plcBoolean));
+       
+       byte plcByteOriginal = 1;
+       PlcValue plcByte = new PlcBYTE(plcByteOriginal);
+       map.put("plcByte", plcByte);
+       mapValues.put("plcByte", Plc4xCommon.normalizeValue(plcByte));
+       
+       /*
+       PlcBigDecimal
+               PlcBigInteger
+               PlcBitString
+               PlcBOOL
+               PlcBYTE
+               PlcCHAR
+               PlcDATE_AND_TIME
+               PlcDATE
+               PlcDINT
+               PlcDWORD
+               PlcINT
+               PlcLINT
+               PlcList
+               PlcLREAL
+               PlcLTIME
+               PlcLWORD
+               PlcNull
+               PlcREAL
+               PlcSINT
+               PlcSTRING
+               PlcStruct
+               PlcTIME_OF_DAY
+               PlcTIME
+               PlcUDINT
+               PlcUINT
+               PlcULINT
+               PlcUSINT
+               PlcWCHAR
+               PlcWORD
+               */
+       

Review comment:
       should test all types




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to