Package com.neophob.sematrix.core.properties

Examples of com.neophob.sematrix.core.properties.ApplicationConfigurationHelper


    String rootDir = System.getProperty("buildDirectory");
    if (rootDir == null) {
      //if unit test is run in eclipse
      rootDir = "."+File.separatorChar;
    }
      ph = new ApplicationConfigurationHelper(new Properties());
      col = new ColorSet("test", new int[]{1,2,3});
     
      for (int x=1; x<maxResolution; x++) {
        for (int y=1; y<maxResolution; y++) {
          testWithResolution(x,y);
View Full Code Here


public class PropertiesHelperTest {

    @Test
    public void testEmptyConfig() {     
        Properties config = new Properties();    
        ApplicationConfigurationHelper ph = new ApplicationConfigurationHelper(config);

        assertEquals(1, ph.getNrOfScreens());
        assertEquals(8, ph.getDeviceXResolution());
        assertEquals(8, ph.getDeviceYResolution());

        assertEquals(0, ph.getI2cAddr().size());
        assertEquals(0, ph.getLpdDevice().size());
        assertEquals(20, ph.parseFps());
        assertEquals(OutputDeviceEnum.NULL, ph.getOutputDevice());
    }
View Full Code Here

    @Test
    public void testPixelInvadersDefaultConfig() {    
        Properties config = new Properties();
        config.put(ConfigConstant.PIXELINVADERS_ROW1, "ROTATE_180,NO_ROTATE");
        config.put(ConfigConstant.PIXELINVADERS_ROW2, "ROTATE_90,NO_ROTATE");      
        ApplicationConfigurationHelper ph = new ApplicationConfigurationHelper(config);
       
        List<Integer> order = ph.getPanelOrder();
        assertEquals(Integer.valueOf(0), order.get(0));
        assertEquals(Integer.valueOf(1), order.get(1));
        assertEquals(Integer.valueOf(2), order.get(2));
        assertEquals(Integer.valueOf(3), order.get(3));
       
        List<ColorFormat> colorFormat = ph.getColorFormat();
        assertEquals(ColorFormat.RGB, colorFormat.get(0));
        assertEquals(ColorFormat.RGB, colorFormat.get(1));
        assertEquals(ColorFormat.RGB, colorFormat.get(2));
        assertEquals(ColorFormat.RGB, colorFormat.get(3));       
    }
View Full Code Here

        config.put(ConfigConstant.PIXELINVADERS_COLORADJUST_R+"2", "4");
        config.put(ConfigConstant.PIXELINVADERS_COLORADJUST_G+"2", "-222");
        config.put(ConfigConstant.PIXELINVADERS_COLORADJUST_B+"2", "zzz");

        ApplicationConfigurationHelper ph = new ApplicationConfigurationHelper(config);

        assertEquals(4, ph.getNrOfScreens());
        assertEquals(8, ph.getDeviceXResolution());
        assertEquals(8, ph.getDeviceYResolution());
       
        List<Integer> order = ph.getPanelOrder();
        assertEquals(Integer.valueOf(0), order.get(0));
        assertEquals(Integer.valueOf(3), order.get(1));
        assertEquals(Integer.valueOf(1), order.get(2));
        assertEquals(Integer.valueOf(2), order.get(3));
       
        assertEquals(0, ph.getI2cAddr().size());
        assertEquals(4, ph.getLpdDevice().size());
        assertEquals(OutputDeviceEnum.PIXELINVADERS, ph.getOutputDevice());
       
        Map<Integer, RGBAdjust> correction = ph.getPixelInvadersCorrectionMap();
        assertFalse(correction.containsKey(ConfigConstant.PIXELINVADERS_COLORADJUST_R+"0"));
        assertFalse(correction.containsKey(ConfigConstant.PIXELINVADERS_COLORADJUST_G+"0"));
        assertFalse(correction.containsKey(ConfigConstant.PIXELINVADERS_COLORADJUST_B+"0"));

        RGBAdjust corr = correction.get(1);
View Full Code Here

    String rootDir = System.getProperty("buildDirectory");
    if (rootDir == null) {
      //if unit test is run in eclipse
      rootDir = "."+File.separatorChar;
    }
      ph = new ApplicationConfigurationHelper(new Properties());
      fileUtils = new FileUtilsJunit();
      sound = new SoundDummy();
      resize = new PixelResize();
      col = new ColorSet("test", new int[]{1,2,3});
     
View Full Code Here

        config.put(ConfigConstant.PIXELINVADERS_ROW1, "ROTATE_180, NO_ROTATE");
        config.put(ConfigConstant.PIXELINVADERS_ROW2, "ROTATE_90, NO_ROTATE");
        config.put(ConfigConstant.PIXELINVADERS_PANEL_ORDER, "0,3, 1,2");
        config.put(ConfigConstant.PIXELINVADERS_NET_IP, "127.0.0.1");
        config.put(ConfigConstant.PIXELINVADERS_NET_PORT, "5333");
        ApplicationConfigurationHelper ph = new ApplicationConfigurationHelper(config);

        assertEquals(4, ph.getNrOfScreens());
        assertEquals(8, ph.getDeviceXResolution());
        assertEquals(8, ph.getDeviceYResolution());
       
        List<Integer> order = ph.getPanelOrder();
        assertEquals(Integer.valueOf(0), order.get(0));
        assertEquals(Integer.valueOf(3), order.get(1));
        assertEquals(Integer.valueOf(1), order.get(2));
        assertEquals(Integer.valueOf(2), order.get(3));
       
        assertEquals(0, ph.getI2cAddr().size());
        assertEquals(4, ph.getLpdDevice().size());
        assertEquals(OutputDeviceEnum.PIXELINVADERS_NET, ph.getOutputDevice());
       
        Map<Integer, RGBAdjust> correction = ph.getPixelInvadersCorrectionMap();
        assertTrue(correction!=null);
    }
View Full Code Here

    public void testPixelInvadersAdvancedConfig() {    
        Properties config = new Properties();
        config.put(ConfigConstant.PIXELINVADERS_ROW1, "ROTATE_180_FLIPPEDY,NO_ROTATE,NO_ROTATE");
        config.put(ConfigConstant.PIXELINVADERS_ROW2, "ROTATE_180_FLIPPEDY,NO_ROTATE,NO_ROTATE");
        config.put(ConfigConstant.PIXELINVADERS_PANEL_ORDER, "0,3,1,4,2,5");
        ApplicationConfigurationHelper ph = new ApplicationConfigurationHelper(config);

        assertEquals(6, ph.getNrOfScreens());
        assertEquals(8, ph.getDeviceXResolution());
        assertEquals(8, ph.getDeviceYResolution());
       
        List<ColorFormat> colorFormat = ph.getColorFormat();
        List<Integer> order = ph.getPanelOrder();
        List<DeviceConfig> displayOptions = ph.getLpdDevice();
       
        for (int ofs=0; ofs<ph.getNrOfScreens(); ofs++) {
            int panelNr = order.get(ofs);           
            System.out.println("visual "+ofs+", panel ofs: "+panelNr+", layout: "+displayOptions.get(panelNr)+
                " colorformat: "+colorFormat.get(panelNr));
        }
    }
View Full Code Here

        config.put(ConfigConstant.PIXELINVADERS_BLACKLIST, "/dev/tty.Bluetooth-Serial-1,/dev/cu.Bluetooth-Serial-1,/dev/cu.Bluetooth-Modem,/dev/cu.Bluetooth-Serial-2,/dev/cu.Bluetooth-PDA-Sync,/dev/tty.Bluetooth-PDA-Sync,/dev/cu.Bluetooth-Modem,/dev/tty.Bluetooth-Modem,/dev/tty.Bluetooth-Serial-2");
        config.put(ConfigConstant.NULLOUTPUT_ROW1, "1");
        config.put(ConfigConstant.NULLOUTPUT_ROW2, "0");
        config.put(ConfigConstant.OUTPUT_DEVICE_RESOLUTION_X, "16");
        config.put(ConfigConstant.OUTPUT_DEVICE_RESOLUTION_Y, "16");
        ApplicationConfigurationHelper ph = new ApplicationConfigurationHelper(config);
       
        assertEquals(8, ph.getDeviceXResolution());
        assertEquals(8, ph.getDeviceYResolution());
        assertEquals(2, ph.getNrOfScreens());
    }
View Full Code Here

        config.put(ConfigConstant.PIXELINVADERS_NET_IP, "127.0.0.1");
        config.put(ConfigConstant.NULLOUTPUT_ROW1, "1");
        config.put(ConfigConstant.NULLOUTPUT_ROW2, "0");
        config.put(ConfigConstant.OUTPUT_DEVICE_RESOLUTION_X, "16");
        config.put(ConfigConstant.OUTPUT_DEVICE_RESOLUTION_Y, "16");
        ApplicationConfigurationHelper ph = new ApplicationConfigurationHelper(config);
       
        assertEquals(8, ph.getDeviceXResolution());
        assertEquals(8, ph.getDeviceYResolution());
        assertEquals(2, ph.getNrOfScreens());
    }
View Full Code Here

    public void testInvalidPixelInvadersConfigOne() {    
        Properties config = new Properties();
        config.put(ConfigConstant.PIXELINVADERS_ROW1, "ROTATE_180,NO_ROTATE");
        config.put(ConfigConstant.PIXELINVADERS_ROW2, "ROTATE_90,NO_ROTATE");
        config.put(ConfigConstant.PIXELINVADERS_PANEL_ORDER, "0,4,1,2");
        ApplicationConfigurationHelper ph = new ApplicationConfigurationHelper(config);

        //panel order is ignored, due invalid value
        List<Integer> order = ph.getPanelOrder();
        assertEquals(Integer.valueOf(0), order.get(0));
        assertEquals(Integer.valueOf(1), order.get(1));
        assertEquals(Integer.valueOf(2), order.get(2));
        assertEquals(Integer.valueOf(3), order.get(3));
    }
View Full Code Here

TOP

Related Classes of com.neophob.sematrix.core.properties.ApplicationConfigurationHelper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.