<commit_before>package org.kaazing.gateway.service.turn.proxy.stun;

import static org.kaazing.gateway.service.turn.proxy.stun.StunMessageAttributeType.MAPPED_ADDRESS;

import java.nio.ByteBuffer;

import org.junit.Assert;
import org.junit.Assume;
import org.junit.Test;

public class AttributeTest {
    
    @Test
    public void mappedAddressIpv4(){
//        short type = MAPPED_ADDRESS.getType();
//        short length = 4 + (32 / 4);
//        ByteBuffer buf = ByteBuffer.allocate(4 + length);
//        byte[] value = new byte[]{0x12};
//        StunMessageAttribute attr = StunMessageAttribute.Factory.get(type, length, value);
//        Assert.assertEquals(attr.getLength(), length);
//        Assert.assertEquals(attr.getType(), type);
//        hmm = new byte[]{0x01};
//        Assert.assertEquals(attr.getVariable(), value);
//        attr.get
//        
    }
    
    @Test
    public void mappedAddressIpv6(){
        Assert.assertEquals(new byte[]{0x01}, new byte[]{0x01});
        
    }

    @Test
    public void noopAttribute(){
        // TODO, Kaazing NOOP Attribute which catchs all unimplemented
    }
    
    @Test
    public void username(){
        Assume.assumeTrue("Not implemented", true);
    }
    
    @Test
    public void messageIntegrity(){
    }
    
    @Test
    public void errorCode(){
        Assume.assumeTrue("Not implemented", true);
    }
    
    @Test
    public void unknownErrorCode(){
        Assume.assumeTrue("Not implemented", true);
    }
    
    @Test
    public void relam(){
        Assume.assumeTrue("Not implemented", true);
    }
    
    @Test
    public void nonce(){
        Assume.assumeTrue("Not implemented", true);
    }
    
    @Test
    public void xorMappedAddressIpv4(){
        
    }
    
    @Test
    public void xorMappedAddressIpv6(){
        
    }
    
    @Test
    public void software(){
        Assume.assumeTrue("Not implemented", true);
    }
    
    @Test
    public void alternativeServer(){
        Assume.assumeTrue("Not implemented", true);
    }
    
    @Test
    public void fingerprint(){
        Assume.assumeTrue("Not implemented", true);
    }
}<commit_msg>Added more tests to have<commit_after>package org.kaazing.gateway.service.turn.proxy.stun;

import static org.kaazing.gateway.service.turn.proxy.stun.StunMessageAttributeType.MAPPED_ADDRESS;

import java.nio.ByteBuffer;

import org.junit.Assert;
import org.junit.Assume;
import org.junit.Test;

public class AttributeTest {
    
    @Test
    public void mappedAddressIpv4(){
        short type = MAPPED_ADDRESS.getType();
        short length = 4 + (32 / 4);
        ByteBuffer buf = ByteBuffer.allocate(4 + length);
        byte[] value = new byte[]{0x12};
        StunMessageAttribute attr = StunMessageAttribute.Factory.get(type, length, value);
        Assert.assertEquals(attr.getLength(), length);
        Assert.assertEquals(attr.getType(), type);
        // not this byte array compare is not correct, figure some way out to  compare (via API or loop)
        Assert.assertEquals(attr.getVariable(), value);
        
        MappedAddressAttribute mappedAddressAttribute = (MappedAddressAttribute) attr;
        mappedAddressAttribute.setAddress(address);
        mappedAddressAttribute.setPort(port);
        
        Assert.assertEquals(attr.getLength(), length);
        Assert.assertEquals(attr.getType(), type);
        // not this byte array compare is not correct, figure some way out to  compare (via API or loop)
        Assert.assertEquals(attr.getVariable(), value);

    }
    
    @Test
    public void mappedAddressIpv6(){
        Assert.assertEquals(new byte[]{0x01}, new byte[]{0x01});
        
    }

    @Test
    public void noopAttribute(){
        // TODO, Kaazing NOOP Attribute which catchs all unimplemented
    }
    
    @Test
    public void username(){
        Assume.assumeTrue("Not implemented", true);
    }
    
    @Test
    public void messageIntegrity(){
    }
    
    @Test
    public void errorCode(){
        Assume.assumeTrue("Not implemented", true);
    }
    
    @Test
    public void unknownErrorCode(){
        Assume.assumeTrue("Not implemented", true);
    }
    
    @Test
    public void relam(){
        Assume.assumeTrue("Not implemented", true);
    }
    
    @Test
    public void nonce(){
        Assume.assumeTrue("Not implemented", true);
    }
    
    @Test
    public void xorMappedAddressIpv4(){
        
    }
    
    @Test
    public void xorMappedAddressIpv6(){
        
    }
    
    @Test
    public void software(){
        Assume.assumeTrue("Not implemented", true);
    }
    
    @Test
    public void alternativeServer(){
        Assume.assumeTrue("Not implemented", true);
    }
    
    @Test
    public void fingerprint(){
        Assume.assumeTrue("Not implemented", true);
    }

    @Test
    public void channelNumber(){
        Assume.assumeTrue("Not implemented", true);
    }

    @Test
    public void lifetime(){
        Assume.assumeTrue("Not implemented", true);
    }
    
    @Test
    public void xorPeerAddressIPv4(){
    }

    @Test
    public void xorPeerAddressIPv6(){
    }
    
    
    @Test
    public void data(){
        Assume.assumeTrue("Not implemented", true);
    }
    @Test
    public void xorRelayAddressIPv4(){
    }

    @Test
    public void xorRelayAddressIPv6(){
    }

    @Test
    public void evenPort(){
    }
    
    @Test
    public void requestedTransport(){
        // note to DPW want to check so we can enforce it
        
    }
    
    @Test
    public void dontFragment(){
        Assume.assumeTrue("Not implemented", true);
    }
    
    @Test
    public void reservationToken(){
        
    }
}
{'fraction_non_alphanumeric': 0.10953133228014744, 'fraction_numerical': 0.007547832192381956, 'mean_word_length': 2.274712643678161, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4049839', 'n_tokens_mistral': 1666, 'n_tokens_neox': 1630, 'n_words': 393}