Examples of MCTProperties


Examples of gov.nasa.arc.mct.util.property.MCTProperties

    }

    @Test
    public void readActivity() throws IOException {

        MCCActivity actSel = new MCCActivity(new MCTProperties("properties/test.mcc.properties"));

        Assert.assertEquals(actSel.getFlightID(), "29");
        Assert.assertEquals(actSel.getSimType(), "TST");
        Assert.assertEquals(actSel.getVehicleID(), "unset");
View Full Code Here

Examples of gov.nasa.arc.mct.util.property.MCTProperties

    }

    @Test
    public void testMultInstances() throws IOException {
        MCCActivity actSel1 = new MCCActivity(new MCTProperties("properties/test.mcc.properties"));
        Assert.assertEquals(actSel1.getUserID(), initialUser);
        MCCActivity actSel2 = new MCCActivity(new MCTProperties("properties/test.mcc.properties"));

        actSel2.setUserID("sally-isNextUserAfterShiftChange");
        Assert.assertEquals(actSel2.getUserID(), "sally-isNextUserAfterShiftChange");

    }
View Full Code Here

Examples of gov.nasa.arc.mct.util.property.MCTProperties

    }

    @Test(expectedExceptions = IOException.class)
    public void testBadFile() throws IOException {
        new MCCActivity(new MCTProperties("xx/test.mccxxxxx.properxxties"));
    }
View Full Code Here

Examples of gov.nasa.arc.mct.util.property.MCTProperties

   *
   * @return java path
   */
  public String javaPath() {

    final MCTProperties mctProperties = MCTProperties.DEFAULT_MCT_PROPERTIES;

    String java = mctProperties.getProperty("mct.java.home");

    String separator = System.getProperty("file.separator");

    java = System.getProperty("java.home");

View Full Code Here

Examples of gov.nasa.arc.mct.util.property.MCTProperties

  /**
   * Sets look and feel for alert box if null
   */
  private static void setLAF()
  {
    final MCTProperties mctProperties = MCTProperties.DEFAULT_MCT_PROPERTIES;

    String laf = mctProperties.getProperty("mct.look.and.feel");
   
    JFrame.setDefaultLookAndFeelDecorated(false);

    try {
      UIManager.setLookAndFeel(laf);
View Full Code Here

Examples of gov.nasa.arc.mct.util.property.MCTProperties

    }

    private static int initMaxSubscriptions() {
        int defaultMax = 3000;
        int max = defaultMax;
        final MCTProperties mctProperties = MCTProperties.DEFAULT_MCT_PROPERTIES;
        String str = mctProperties.getProperty("max.subscriptions", "unset");
        if (str.equals("unset")) {
            LOGGER.error("Property mct.max.subscriptions is not set or empty. Using default of: "+ defaultMax);
        }
        try {
            max = new Integer(str);
View Full Code Here

Examples of gov.nasa.arc.mct.util.property.MCTProperties

    /**
     * Creates an activity info.
     * @throws IOException
     */
    public MCCActivity() throws IOException {
        this(new MCTProperties("properties/identityManager.properties"), MCTProperties.DEFAULT_MCT_PROPERTIES);
    }
View Full Code Here

Examples of gov.nasa.arc.mct.util.property.MCTProperties

     * @param initialUser the current user ID
     * @throws MCTException
     * @throws IOException
     */
    public ShiftChangeReporter(String initialUser) throws MCTException, IOException {
        final MCTProperties mctProperties = MCTProperties.DEFAULT_MCT_PROPERTIES;

        if (StringUtil.isEmpty(initialUser))
            throw new MCTException("empty or null initial user");
        currentUser = initialUser;

        String portProp = mctProperties.getProperty("mcc.monitor.port");
        if (StringUtil.isEmpty(portProp)) {
            throw new MCTException("property mcc.monitor.port is not set or empty.");
        }
        try {
            this.monitorPort = new Integer(portProp);
        } catch (NumberFormatException e) {
            throw new MCTException(
                    "Could not convert mcc.monitor.port to a valid port. Check that mcc.monitor.port is set.", e);
        }

        reporterExpirationSeconds = DEFAULT_EXPIRATION;
        String expire = mctProperties.getProperty("mcc.reporter.expiration", "0");
        try {
            reporterExpirationSeconds = new Integer(expire);
        } catch (NumberFormatException e) {
            logger.warn("Could not convert mcc.reporter.expiration; using default");
        }

        interval = DEFAULT_INTERVAL;
        String intervalProp = mctProperties.getProperty("mcc.monitor.interval");
        if (!StringUtil.isEmpty(intervalProp)) {
            try {
                this.interval = new Integer(intervalProp);
            } catch (NumberFormatException e) {
                logger.warn("Could not convert mcc.monitor.interval; using default");
            }
        }

        execCommand = mctProperties.getProperty("mcc.monitor.command");
        if (StringUtil.isEmpty(execCommand)) {
            throw new MCTException("property mcc.monitor.command is not set or invalid.");
        }
    }
View Full Code Here

Examples of gov.nasa.arc.mct.util.property.MCTProperties

     * @throws MCTException - MCT customized exception.
     * @throws IOException - I/O exception.
     */
    public static IdentityManager newIdentityManager(String prop, Runnable refreshRunnable) throws MCTException,
            IOException {
        MCTProperties idMgrProp = new MCTProperties(prop);

        // switch on the site
        if (idMgrProp.getProperty("site", "").equalsIgnoreCase("mcc")) {
            return new MCCIdentityManager(idMgrProp, refreshRunnable);
        } else { // Use a general-purpose ID manager if no site is specified
            return new DefaultIdentityManager(idMgrProp);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.