<commit_before>/*******************************************************************************
 * Copyright 2014 Rogueai.com
 *
 * Licensed 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 com.rogueai.framework.snmp2bean.api.snmp4j.impl;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

import java.util.List;

import org.junit.Test;

import com.rogueai.framework.snmp2bean.api.test.InitSnmpTest;
import com.rogueai.framework.snmp2bean.domain.test.IfEntry;
import com.rogueai.framework.snmp2bean.domain.test.SystemInfo;


public class Snmp4jSessionFactoryTest extends InitSnmpTest {
    
    @Test    
    public void testGet() {
        try {
            SystemInfo sysMIB = service.get(SystemInfo.class);
            assertNotNull(sysMIB.getSysObjectID());
            assertEquals("<NAME> <<EMAIL>>", sysMIB.getSysContact());            
        } catch (Exception e) {
            e.printStackTrace();
            fail();
        }
    }
    
    @Test
    public void testGetByIndex() {
        try {
            List<IfEntry> list = service.getTable(IfEntry.class);
            assertTrue(list.size() > 0);
            IfEntry rtIfEntry = (IfEntry) service.getByIndex(IfEntry.class, list.get(0).getIfIndex());
            assertNotNull(rtIfEntry.getIfDescr());
            rtIfEntry = (IfEntry) service.getByIndex(IfEntry.class, 1,
                    new String[] { "ifDescr" });
            assertNotNull(rtIfEntry.getIfDescr());
            assertTrue(rtIfEntry.getIfInDiscards() == 0);
        } catch (Exception e) {
            e.printStackTrace();
            fail();
        }
    }
    
    @Test
    public void testGetTable() {
        try {
            List<IfEntry> list = service.getTable(IfEntry.class);
            assertTrue(list.size() > 0);<commit_msg>This test needs to be changed<commit_after>/*******************************************************************************
 * Copyright 2014 R<EMAIL>
 *
 * Licensed 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 com.rogueai.framework.snmp2bean.api.snmp4j.impl;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

import java.util.List;

import org.junit.Test;

import com.rogueai.framework.snmp2bean.api.test.InitSnmpTest;
import com.rogueai.framework.snmp2bean.domain.test.IfEntry;
import com.rogueai.framework.snmp2bean.domain.test.SystemInfo;


public class Snmp4jSessionFactoryTest extends InitSnmpTest {
    
    @Test    
    public void testGet() {
        try {
            SystemInfo sysMIB = service.get(SystemInfo.class);
            assertNotNull(sysMIB.getSysObjectID());
        } catch (Exception e) {
            e.printStackTrace();
            fail();
        }
    }
    
    @Test
    public void testGetByIndex() {
        try {
            List<IfEntry> list = service.getTable(IfEntry.class);
            assertTrue(list.size() > 0);
            IfEntry rtIfEntry = (IfEntry) service.getByIndex(IfEntry.class, list.get(0).getIfIndex());
            assertNotNull(rtIfEntry.getIfDescr());
            rtIfEntry = (IfEntry) service.getByIndex(IfEntry.class, 1,
                    new String[] { "ifDescr" });
            assertNotNull(rtIfEntry.getIfDescr());
            assertTrue(rtIfEntry.getIfInDiscards() == 0);
        } catch (Exception e) {
            e.printStackTrace();
            fail();
        }
    }
    
    @Test
    public void testGetTable() {
        try {
            List<IfEntry> list = service.getTable(IfEntry.class);
            assertTrue(list.size() > 0);
{'fraction_non_alphanumeric': 0.16138328530259366, 'fraction_numerical': 0.007822149032523672, 'mean_word_length': 2.896551724137931, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '7665858', 'n_tokens_mistral': 1333, 'n_tokens_neox': 1304, 'n_words': 336}