Package com.neophob.sematrix.core.properties

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


    @Test
    public void testMissingRgbValue() {
        Properties config = new Properties();
        config.put(ConfigConstant.PIXELINVADERS_ROW1, "ROTATE_180,NO_ROTATE");
        config.put(ConfigConstant.CFG_PANEL_COLOR_ORDER, "RBG");
        ApplicationConfigurationHelper ph = new ApplicationConfigurationHelper(config);

        assertEquals(2, ph.getNrOfScreens());
        assertEquals(ColorFormat.RBG, ph.getColorFormat().get(0));       
        assertEquals(ColorFormat.RGB, ph.getColorFormat().get(1));       
    }
View Full Code Here


    @Test
    public void testRgbValue() {
        Properties config = new Properties();
        config.put(ConfigConstant.PIXELINVADERS_ROW1, "ROTATE_180,NO_ROTATE");
        config.put(ConfigConstant.CFG_PANEL_COLOR_ORDER, "RBG, BRG");
        ApplicationConfigurationHelper ph = new ApplicationConfigurationHelper(config);

        assertEquals(2, ph.getNrOfScreens());
        assertEquals(ColorFormat.RBG, ph.getColorFormat().get(0));       
        assertEquals(ColorFormat.BRG, ph.getColorFormat().get(1));       
    }
View Full Code Here

        final String devTwo = "/dev/two";
       
        Properties config = new Properties();
        config.put(ConfigConstant.PIXELINVADERS_ROW1, "ROTATE_180,NO_ROTATE");
        config.put(ConfigConstant.PIXELINVADERS_BLACKLIST, devOne);
        ApplicationConfigurationHelper ph = new ApplicationConfigurationHelper(config);       
        assertEquals(ph.getPixelInvadersBlacklist().get(0), devOne);

        config = new Properties();
        config.put(ConfigConstant.PIXELINVADERS_ROW1, "ROTATE_180,NO_ROTATE");
        config.put(ConfigConstant.PIXELINVADERS_BLACKLIST, devOne+","+devTwo);
        ph = new ApplicationConfigurationHelper(config);
       
        boolean foundOne=false, foundTwo=false;
        for (String s: ph.getPixelInvadersBlacklist()) {
            if (s.equalsIgnoreCase(devOne)) {
                foundOne = true;
            }
            if (s.equalsIgnoreCase(devTwo)) {
                foundTwo = true;
View Full Code Here

    @Test
    public void testTpm2() {
        Properties config = new Properties();       
        config.put(ConfigConstant.TPM2_BAUDRATE, "128000");
        config.put(ConfigConstant.TPM2_DEVICE, "/dev/blah");
        ApplicationConfigurationHelper ph = new ApplicationConfigurationHelper(config);
        assertEquals(OutputDeviceEnum.TPM2, ph.getOutputDevice());
    }
View Full Code Here

    public void testTpm2Net() {
        Properties config = new Properties();       
        config.put(ConfigConstant.TPM2NET_IP, "127.0.0.1");
        config.put(ConfigConstant.TPM2NET_ROW1, "ROTATE_180,NO_ROTATE");
        config.put(ConfigConstant.TPM2NET_ROW2, "NO_ROTATE, NO_ROTATE");
        ApplicationConfigurationHelper ph = new ApplicationConfigurationHelper(config);
        assertEquals(OutputDeviceEnum.TPM2NET, ph.getOutputDevice());
        assertEquals(4, ph.getTpm2NetDevice().size());
        assertEquals("127.0.0.1", ph.getTpm2NetIpAddress());       
    }
View Full Code Here

    @Test
    public void testNegativeSettings() {
        Properties config = new Properties();       
        config.put(ConfigConstant.ADDITIONAL_VISUAL_SCREENS, "-20");       
        config.put(ConfigConstant.NULLOUTPUT_ROW1, "1");
        ApplicationConfigurationHelper ph = new ApplicationConfigurationHelper(config);
       
        assertEquals(0, ph.getNrOfAdditionalVisuals());
    }
View Full Code Here

    @Test
    public void testSoundSilence() {     
        Properties config = new Properties();    
        config.put(ConfigConstant.SOUND_SILENCE_THRESHOLD, "0.06f");
        ApplicationConfigurationHelper ph = new ApplicationConfigurationHelper(config);
        assertEquals(0.06f, ph.getSoundSilenceThreshold(), 0.001);

        config = new Properties();    
        config.put(ConfigConstant.SOUND_SILENCE_THRESHOLD, "  0.06   ");
        ph = new ApplicationConfigurationHelper(config);
        assertEquals(0.06f, ph.getSoundSilenceThreshold(), 0.001);

        config = new Properties();    
        config.put(ConfigConstant.SOUND_SILENCE_THRESHOLD, "");
        ph = new ApplicationConfigurationHelper(config);
        assertEquals(0.0005f, ph.getSoundSilenceThreshold(), 0.001);

        config = new Properties();    
        config.put(ConfigConstant.SOUND_SILENCE_THRESHOLD, "0.pillepalle");
        ph = new ApplicationConfigurationHelper(config);
        assertEquals(0.0005f, ph.getSoundSilenceThreshold(), 0.001);

        config = new Properties();    
        ph = new ApplicationConfigurationHelper(config);
        assertEquals(0.0005f, ph.getSoundSilenceThreshold(), 0.001);

        config = new Properties();    
        config.put(ConfigConstant.SOUND_SILENCE_THRESHOLD, "-0.5");
        ph = new ApplicationConfigurationHelper(config);
        assertEquals(0.0005f, ph.getSoundSilenceThreshold(), 0.001);

        config = new Properties();    
        config.put(ConfigConstant.SOUND_SILENCE_THRESHOLD, "1.5f");
        ph = new ApplicationConfigurationHelper(config);
        assertEquals(0.0005f, ph.getSoundSilenceThreshold(), 0.001);
    }
View Full Code Here

        //ignored
      }
    }

    try {
      return new ApplicationConfigurationHelper(config);
    } catch (Exception e) {
      LOG.log(Level.SEVERE, "Configuration Error: ", e);
      throw new IllegalArgumentException(e);
    }
  }
View Full Code Here

    @Test
    public void testMatrixStretch() {
        Properties config = new Properties();
        config.put(ConfigConstant.NULLOUTPUT_ROW1, "2");
        config.put(ConfigConstant.NULLOUTPUT_ROW2, "2");
        ApplicationConfigurationHelper ph = new ApplicationConfigurationHelper(config);
        Output output = new NullDevice(ph);
     
      FileUtils fileUtils = new FileUtils();
      Collector.getInstance().init(fileUtils, ph);
View Full Code Here

    Properties config = new Properties();
    String rootDir = System.getProperty("buildDirectory");
    LOG.log(Level.INFO, "Test Root Directory: "+rootDir);

    config.put(ConfigConstant.RESOURCE_PATH, rootDir);
    ApplicationConfigurationHelper ph = new ApplicationConfigurationHelper(config);

    Collector.getInstance().init(new FileUtils(), ph);

    String[] str = null;
    MessageProcessor.processMsg(str, false, null);
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.