public class BiosInfo implements ComponentInfo {
    private String date;
    private String manufacturer;
    private String version;
   
    private Map<String, String> fullInfo;

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public String getManufacturer() {
        return manufacturer;
    }

    public void setManufacturer(String manufacturer) {
        this.manufacturer = manufacturer;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }
    
    public Map<String, String> getFullInfo() {
        return fullInfo;
    }

    public void setFullInfo(Map<String, String> fullInfo) {
        this.fullInfo = fullInfo;
    }
    
} public class Display {
    private String name;
    private String currentResolution;
    private String refreshRate;
    private String[] supportedResolutions;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    
    public String getCurrentResolution() {
        return currentResolution;
    }

    public void setCurrentResolution(String currentResolution) {
        this.currentResolution = currentResolution;
    }

    public String getRefreshRate() {
        return refreshRate;
    }

    public void setRefreshRate(String refreshRate) {
        this.refreshRate = refreshRate;
    }

    public String[] getSupportedResolutions() {
        return supportedResolutions;
    }

    public void setSupportedResolutions(String[] supportedResolutions) {
        this.supportedResolutions = supportedResolutions;
    }
    
    
} public class DisplayInfo implements ComponentInfo {
    List<Display> displayDevices;

    public List<Display> getDisplayDevices() {
        return displayDevices;
    }

    public void setDisplayDevices(List<Display> displayDevices) {
        this.displayDevices = displayDevices;
    }
} public class GraphicsCard {

    private String name;
    private String manufacturer;
    private String chipType;
    private String dacType;
    private String deviceType;
    private String temperature;
    private String fanSpeed;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getManufacturer() {
        return manufacturer;
    }

    public void setManufacturer(String manufacturer) {
        this.manufacturer = manufacturer;
    }

    public String getChipType() {
        return chipType;
    }

    public void setChipType(String chipType) {
        this.chipType = chipType;
    }

    public String getDacType() {
        return dacType;
    }

    public void setDacType(String dacType) {
        this.dacType = dacType;
    }

    public String getDeviceType() {
        return deviceType;
    }

    public void setDeviceType(String deviceType) {
        this.deviceType = deviceType;
    }

    public String getTemperature() {
        return temperature;
    }

    public void setTemperature(String temperature) {
        this.temperature = temperature;
    }

    public String getFanSpeed() {
        return fanSpeed;
    }

    public void setFanSpeed(String fanSpeed) {
        this.fanSpeed = fanSpeed;
    }

} public class GraphicsCardInfo implements ComponentInfo {

    List<GraphicsCard> graphicsCards;

    public List<GraphicsCard> getGraphicsCards() {
        return graphicsCards;
    }

    public void setGraphicsCards(List<GraphicsCard> graphicsCards) {
        this.graphicsCards = graphicsCards;
    }

} public class MemoryInfo implements ComponentInfo {
    private String totalMemory;
    private String freeMemory;
    private String availableMemory;
   
    private Map<String, String> fullInfo;

    public String getTotalMemory() {
        return totalMemory;
    }

    public void setTotalMemory(String totalMemory) {
        this.totalMemory = totalMemory;
    }

    public String getFreeMemory() {
        return freeMemory;
    }

    public void setFreeMemory(String freeMemory) {
        this.freeMemory = freeMemory;
    }

    public String getAvailableMemory() {
        return availableMemory;
    }

    public void setAvailableMemory(String availableMemory) {
        this.availableMemory = availableMemory;
    }

    public Map<String, String> getFullInfo() {
        return fullInfo;
    }

    public void setFullInfo(Map<String, String> fullInfo) {
        this.fullInfo = fullInfo;
    }
    
    
} public class MotherboardInfo implements ComponentInfo {

    private String name;
    private String manufacturer;
    private String version;

    private Map<String, String> fullInfo;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getManufacturer() {
        return manufacturer;
    }

    public void setManufacturer(String manufacturer) {
        this.manufacturer = manufacturer;
    }

    public Map<String, String> getFullInfo() {
        return fullInfo;
    }

    public void setFullInfo(Map<String, String> fullInfo) {
        this.fullInfo = fullInfo;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

} public class NetworkInfo implements ComponentInfo {
    private List<NetworkInterfaceInfo> networkInterfaces;

    public List<NetworkInterfaceInfo> getNetworkInterfaces() {
        return networkInterfaces;
    }

    public void setNetworkInterfaces(List<NetworkInterfaceInfo> networkInterfaces) {
        this.networkInterfaces = networkInterfaces;
    }
    
} public class NetworkInterfaceInfo implements ComponentInfo{
    private String name;
    private String type;
    private String ipv4;
    private String ipv6;
    private String receivedPackets;
    private String transmittedPackets;
    private String receivedBytes;
    private String transmittedBytes;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getIpv4() {
        return ipv4;
    }

    public void setIpv4(String ipv4) {
        this.ipv4 = ipv4;
    }

    public String getIpv6() {
        return ipv6;
    }

    public void setIpv6(String ipv6) {
        this.ipv6 = ipv6;
    }

    public String getReceivedPackets() {
        return receivedPackets;
    }

    public void setReceivedPackets(String receivedPackets) {
        this.receivedPackets = receivedPackets;
    }

    public String getTransmittedPackets() {
        return transmittedPackets;
    }

    public void setTransmittedPackets(String transmittedPackets) {
        this.transmittedPackets = transmittedPackets;
    }

    public String getReceivedBytes() {
        return receivedBytes;
    }

    public void setReceivedBytes(String receivedBytes) {
        this.receivedBytes = receivedBytes;
    }

    public String getTransmittedBytes() {
        return transmittedBytes;
    }

    public void setTransmittedBytes(String transmittedBytes) {
        this.transmittedBytes = transmittedBytes;
    }    
} public class OSInfo implements ComponentInfo {
    private String version;
    private String lastBootTime;
    private String name;
    private String manufacturer;
    private Map<String, String> fullInfo;

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getLastBootTime() {
        return lastBootTime;
    }

    public void setLastBootTime(String lastBootTime) {
        this.lastBootTime = lastBootTime;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getManufacturer() {
        return manufacturer;
    }

    public void setManufacturer(String manufacturer) {
        this.manufacturer = manufacturer;
    }
    
    public Map<String, String> getFullInfo() {
        return fullInfo;
    }

    public void setFullInfo(Map<String, String> fullInfo) {
        this.fullInfo = fullInfo;
    }
    
} public class ProcessorInfo implements ComponentInfo{
    private String vendorId;
    private String family;
    private String model;
    private String modelName;
    private String stepping;
    private String mhz;
    private String cacheSize;
    private String numCores;
    private String temperature;
    
    private Map<String, String> fullInfo;

    public String getVendorId() {
        return vendorId;
    }

    public void setVendorId(String vendorId) {
        this.vendorId = vendorId;
    }

    public String getFamily() {
        return family;
    }

    public void setFamily(String family) {
        this.family = family;
    }

    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }

    public String getModelName() {
        return modelName;
    }

    public void setModelName(String modelName) {
        this.modelName = modelName;
    }

    public String getStepping() {
        return stepping;
    }

    public void setStepping(String stepping) {
        this.stepping = stepping;
    }

    public String getMhz() {
        return mhz;
    }

    public void setMhz(String mhz) {
        this.mhz = mhz;
    }

    public String getCacheSize() {
        return cacheSize;
    }

    public void setCacheSize(String cacheSize) {
        this.cacheSize = cacheSize;
    }

    public String getNumCores() {
        return numCores;
    }

    public void setNumCores(String numCores) {
        this.numCores = numCores;
    }

    public String getTemperature() {
        return temperature;
    }

    public void setTemperature(String temperature) {
        this.temperature = temperature;
    }

    public Map<String, String> getFullInfo() {
        return fullInfo;
    }

    public void setFullInfo(Map<String, String> fullInfo) {
        this.fullInfo = fullInfo;
    }
}

import java.util.Arrays;
import java.util.List;
import java.util.Map.Entry;
import java.util.Set;
import org.junit.After;
import org.junit.AfterClass;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.BeforeClass;
import org.jutils.jhardware.model.BiosInfo;
import org.jutils.jhardware.model.Display;
import org.jutils.jhardware.model.DisplayInfo;
import org.jutils.jhardware.model.GraphicsCard;
import org.jutils.jhardware.model.GraphicsCardInfo;
import org.jutils.jhardware.model.MemoryInfo;
import org.jutils.jhardware.model.MotherboardInfo;
import org.jutils.jhardware.model.NetworkInfo;
import org.jutils.jhardware.model.NetworkInterfaceInfo;
import org.jutils.jhardware.model.OSInfo;
import org.jutils.jhardware.model.ProcessorInfo;
/*
 * 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 org.jutils.jhardware;


/**
 * Tests jHardware
 *
 * @author Javier Garcia Alonso
 */
public class HardwareInfoTest {

    public HardwareInfoTest() {
    }

    @BeforeClass
    public static void setUpClass() {
    }

    @AfterClass
    public static void tearDownClass() {
    }

    @Before
    public void setUp() {
    }

    @After
    public void tearDown() {
    }

    /**
     * Test of getProcessorInfos method, of class HardwareInfo.
     */
    //@org.junit.Test
    public void testGetProcessorInfo() {
        System.out.println("Testing getProcessorInfo...");
        System.out.println("====================================");
        ProcessorInfo info = HardwareInfo.getProcessorInfo();

        assertTrue(info != null && info.getModelName() != null);

        System.out.println("Cache size: " + info.getCacheSize());
        System.out.println("Family: " + info.getFamily());
        System.out.println("Speed (Mhz): " + info.getMhz());
        System.out.println("Model: " + info.getModel());
        System.out.println("Model name: " + info.getModelName());
        System.out.println("Number of cores: " + info.getNumCores());
        System.out.println("Stepping: " + info.getStepping());
        System.out.println("Temperature: " + info.getTemperature());
        System.out.println("Vendor Id: " + info.getVendorId());

        Set<Entry<String, String>> fullInfos = info.getFullInfo().entrySet();

        for (final Entry<String, String> fullInfo : fullInfos) {
            System.out.println(fullInfo.getKey() + ": " + fullInfo.getValue());
        }

        System.out.println("End testing getProcessorInfo...");
        System.out.println("====================================");
    }

    /**
     * Test of getMemoryInfos method, of class HardwareInfo.
     */
    @org.junit.Test
    public void testGetMemoryInfo() {
        System.out.println("Testing getMemoryInfo...");
        System.out.println("====================================");
        MemoryInfo info = HardwareInfo.getMemoryInfo();

        assertTrue(info != null);

        System.out.println("Available Memory: " + info.getAvailableMemory());
        System.out.println("Free Memory: " + info.getFreeMemory());
        System.out.println("Total Memory: " + info.getTotalMemory());

        Set<Entry<String, String>> fullInfos = info.getFullInfo().entrySet();

        for (final Entry<String, String> fullInfo : fullInfos) {
            System.out.println(fullInfo.getKey() + ": " + fullInfo.getValue());
        }

        System.out.println("End testing getMemoryInfo...");
        System.out.println("====================================");
    }

    /**
     * Test of getBiosInfo method, of class HardwareInfo.
     */
    @org.junit.Test
    public void testGetBiosInfo() {
        System.out.println("Testing testGetBiosInfo...");
        System.out.println("====================================");
        BiosInfo info = HardwareInfo.getBiosInfo();

        assertTrue(info != null);

        System.out.println("BIOS manufacturer: " + info.getManufacturer());
        System.out.println("Last update : " + info.getDate());
        System.out.println("Version: " + info.getVersion());

        Set<Entry<String, String>> fullInfos = info.getFullInfo().entrySet();

        for (final Entry<String, String> fullInfo : fullInfos) {
            System.out.println(fullInfo.getKey() + ": " + fullInfo.getValue());
        }

        System.out.println("End testing testGetBiosInfo...");
        System.out.println("====================================");
    }

    /**
     * Test of getBiosInfo method, of class HardwareInfo.
     */
    @org.junit.Test
    public void testGetMotherboardInfo() {
        System.out.println("Testing testGetMotherboardInfo...");
        System.out.println("====================================");
        MotherboardInfo info = HardwareInfo.getMotherboardInfo();

        assertTrue(info != null);

        System.out.println("Manufacturer: " + info.getManufacturer());
        System.out.println("Name : " + info.getName());
        System.out.println("Version: " + info.getVersion());

        Set<Entry<String, String>> fullInfos = info.getFullInfo().entrySet();

        for (final Entry<String, String> fullInfo : fullInfos) {
            System.out.println(fullInfo.getKey() + ": " + fullInfo.getValue());
        }

        System.out.println("End testing testGetMotherboardInfo...");
        System.out.println("====================================");
    }

    /**
     * Test of getBiosInfo method, of class HardwareInfo.
     */
    @org.junit.Test
    public void testGetOSInfo() {
        System.out.println("Testing testGetOSInfo...");
        System.out.println("====================================");
        OSInfo info = HardwareInfo.getOSInfo();

        assertTrue(info != null && info.getManufacturer() != null);

        System.out.println("Manufacturer: " + info.getManufacturer());
        System.out.println("Name: " + info.getName());
        System.out.println("Version: " + info.getVersion());
        System.out.println("Last boot time: " + info.getLastBootTime());

        Set<Entry<String, String>> fullInfos = info.getFullInfo().entrySet();

        for (final Entry<String, String> fullInfo : fullInfos) {
            System.out.println(fullInfo.getKey() + ": " + fullInfo.getValue());
        }

        System.out.println("End testing testOSInfo...");
        System.out.println("====================================");
    }

    /**
     * Test of getNetworkInfo method, of class HardwareInfo.
     */
    @org.junit.Test
    public void getNetworkInfo() {
        System.out.println("Testing getNetworkInfo...");
        System.out.println("====================================");
        NetworkInfo info = HardwareInfo.getNetworkInfo();