Package java.util

Examples of java.util.Properties.containsKey()


    Properties p = new Properties();
   
    SocketServerConnectionFactory.updateConnectionProperties(p);
      
    assertTrue(p.containsKey(TeiidURL.CONNECTION.CLIENT_HOSTNAME));
    assertTrue(p.containsKey(TeiidURL.CONNECTION.CLIENT_IP_ADDRESS));
  }
 
  @Test public void testLogonFailsWithMultipleHosts() throws Exception {
    Properties p = new Properties();
    SocketServerInstanceFactory instanceFactory = Mockito.mock(SocketServerInstanceFactory.class);
View Full Code Here


    // ================= Function - ENV ========================
    public static Object env(CommandContext context, String propertyName) {
        // All context property keys must be lowercase - we lowercase the incoming key here to match regardless of case
        String propertyNameNocase = propertyName.toLowerCase();
        Properties envProps = context.getEnvironmentProperties();
        if(envProps != null && envProps.containsKey(propertyNameNocase)) {
            return envProps.getProperty(propertyNameNocase);
        }
        String value = System.getProperty(propertyName);
        if (value == null) {
            value = System.getProperty(propertyNameNocase);
View Full Code Here

        InputStream is = new ByteArrayInputStream(propertiesString.getBytes());
        properties.load(is);
       
        // HACK for crash recovery tests
        // check whether we have User and Password in XA properties
        if (! properties.containsKey("User"))
        {
           properties.setProperty("User", CrashHelper.DS_USER_NAME);
           properties.setProperty("Password", CrashHelper.DS_PASSWORD);
        }
        // end of hack
View Full Code Here

   public void run() throws Exception
   {
      Object message[] = (Object[]) test.getMessages().get(msgNo);
      Properties properties = (Properties)message[2];
      if (properties.containsKey(property) == false)
         throw new Exception("For msgNo=" + msgNo + " property does not exist property= " + property + " Expected=" + value + " msg=" + message);
      Object actual = properties.get(property);
      if (value.equals(actual) == false)
         throw new Exception("For msgNo=" + msgNo + " property= " + property + " Expected=" + value + " actual=" + actual + " msg=" + message);
   }
View Full Code Here

  public synchronized void setAnnotation(I18nItem i18nItem, String annotation) {
    Properties properties = getPropertiesWithoutResolvingRecursively(null, i18nItem.getBundleName());
    String key = i18nItem.getKey() + METADATA_ANNOTATION_POSTFIX;
    if (StringHelper.containsNonWhitespace(annotation)) {
      properties.setProperty(key, annotation);
    } else if (properties.containsKey(key)) {
      properties.remove(key);
    }
    if (properties.size() == 0) {
      // delete empty files
      deleteProperties(null, i18nItem.getBundleName());
View Full Code Here

  public synchronized void saveOrUpdateI18nItem(I18nItem i18nItem, String value) {
    Properties properties = getPropertiesWithoutResolvingRecursively(i18nItem.getLocale(), i18nItem.getBundleName());
    // Add logging block to find bogus save issues
    if (isLogDebugEnabled()) {
      String itemIdent = i18nItem.getLocale() + ":" + buildI18nItemIdentifyer(i18nItem.getBundleName(), i18nItem.getKey());
      if (properties.containsKey(i18nItem.getKey())) {
        if (StringHelper.containsNonWhitespace(value)) {
          logDebug("Updating i18n item::" + itemIdent + " with new value::" + value, null);         
        } else {
          logDebug("Deleting i18n item::" + itemIdent + " because new value is emty", null);
        }
View Full Code Here

      }
    }
    //
    if (StringHelper.containsNonWhitespace(value)) {
      properties.setProperty(i18nItem.getKey(), value);
    } else if (properties.containsKey(i18nItem.getKey())) {
      properties.remove(i18nItem.getKey());
    }
    if (properties.size() == 0) {
      // delete empty files
      deleteProperties(i18nItem.getLocale(), i18nItem.getBundleName());
View Full Code Here

          if (targetLangBundleKeys.contains(key)){
            //everything ok
          } else {
            //only work on keys found in reference lang (de/en) but not in this bundle
            //try to load key from branch
            if (oldProps.containsKey(key)){
              String oldValue = oldProps.getProperty(key);
              if (StringHelper.containsNonWhitespace(oldValue) && !oldValue.trim().startsWith("TODO")) {
                langCounter++;
                bundleCounter++;
                totalCounter++;
View Full Code Here

  {
    try
    {
      deploy("jca-mockdriver.jar");
      Properties props = getConnectionProperties(EARXMLDS);
          assertTrue(props.containsKey("serverName") && props.containsKey("databaseName") && props.containsKey("portNumber"));
          assertTrue(deploymentUsesDataSource(EARXMLDS));       
         
          props.clear();
         
          props = getConnectionProperties(DRIVEREARXML);
View Full Code Here

  {
    try
    {
      deploy("jca-mockdriver.jar");
      Properties props = getConnectionProperties(EARXMLDS);
          assertTrue(props.containsKey("serverName") && props.containsKey("databaseName") && props.containsKey("portNumber"));
          assertTrue(deploymentUsesDataSource(EARXMLDS));       
         
          props.clear();
         
          props = getConnectionProperties(DRIVEREARXML);
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.