Package org.apache.felix.utils.properties

Examples of org.apache.felix.utils.properties.Properties$PropertiesReader


    String getLogFilePath() {
      String filename = configProps == null ? null : configProps.getProperty(KARAF_BOOTSTRAP_LOG);
      if (filename != null) {
        return filename;
      }
      Properties props = loadPaxLoggingConfig();
      // Make a best effort to log to the default file appender configured for log4j
      return props.getProperty(LOG4J_APPENDER_FILE, "${karaf.data}/log/karaf.log");
    }
View Full Code Here


   
    abstract DefaultJDBCLock createLock(Properties props);
   
    @BeforeClass
    public static void setUpTestSuite() {
        Properties properties = new Properties();
        properties.put("karaf.bootstrap.log", "target/karaf.log");
        BootstrapLogManager.setProperties(properties);
    }
View Full Code Here

        metaData = EasyMock.createMock(DatabaseMetaData.class);
        resultSet = EasyMock.createMock(ResultSet.class);
        preparedStatement = EasyMock.createMock(PreparedStatement.class);
        statement = EasyMock.createMock(Statement.class);
       
        props = new Properties();
        props.put("karaf.lock.jdbc.url", url);
        props.put("karaf.lock.jdbc.driver", driver);
        props.put("karaf.lock.jdbc.user", user);
        props.put("karaf.lock.jdbc.password", password);
        props.put("karaf.lock.jdbc.table", tableName);
View Full Code Here

import org.junit.Test;

public class BootstrapLogManagerTest {
 
  private Properties getConfigProperties() {
    Properties configProps = new Properties();
    configProps.put("karaf.data", "target");
    return configProps;
  }
View Full Code Here

  }
 
  @Test
  public void testGetLogManagerFromPaxLoggingConfig() {
    new File("target/test.log").delete();
    Properties configProps = getConfigProperties();
    BootstrapLogManager.setProperties(configProps, "src/test/resources/org.ops4j.pax.logging.cfg");
    Handler handler = BootstrapLogManager.getDefaultHandler();
    Assert.assertNotNull(handler);
    assertExists("target/test.log");
  }
View Full Code Here

    private boolean batch;
    private String file = null;
    private String command;

    public ClientConfig(String[] args) throws IOException {
        Properties shellCfg = new Properties(new File(System.getProperty("karaf.etc"), "org.apache.karaf.shell.cfg"));

        host = shellCfg.getProperty("sshHost", "localhost");
        port = Integer.parseInt(shellCfg.getProperty("sshPort", "8101"));
        level = SimpleLogger.WARN;
        retryAttempts = 0;
        retryDelay = 2;
        batch = false;
        file = null;
        user = null;
        password = null;
        StringBuilder commandBuilder = new StringBuilder();

        for (int i = 0; i < args.length; i++) {
            if (args[i].charAt(0) == '-') {
                if (args[i].equals("-a")) {
                    port = Integer.parseInt(args[++i]);
                } else if (args[i].equals("-h")) {
                    host = args[++i];
                } else if (args[i].equals("-u")) {
                    user = args[++i];
                } else if (args[i].equals("-v")) {
                    level++;
                } else if (args[i].equals("-r")) {
                    retryAttempts = Integer.parseInt(args[++i]);
                } else if (args[i].equals("-d")) {
                    retryDelay = Integer.parseInt(args[++i]);
                } else if (args[i].equals("-b")) {
                    batch = true;
                } else if (args[i].equals("-f")) {
                    file = args[++i];
                } else if (args[i].equals("--help")) {
                    showHelp();
                } else {
                    System.err.println("Unknown option: " + args[i]);
                    System.err.println("Run with --help for usage");
                    System.exit(1);
                }
            } else {
                commandBuilder.append(args[i]);
                commandBuilder.append(' ');
            }
        }
        command = commandBuilder.toString();

        Properties usersCfg = new Properties(new File(System.getProperty("karaf.etc") + "/users.properties"));
        if (!usersCfg.isEmpty()) {
            if (user == null) {
                user = (String) usersCfg.keySet().iterator().next();
            }
            password = (String) usersCfg.getProperty(user);
            if (password != null && password.contains(ROLE_DELIMITER)) {
                password = password.substring(0, password.indexOf(ROLE_DELIMITER));
            }
        }
View Full Code Here

    abstract DefaultJDBCLock createLock(Properties props);
   
    @BeforeClass
    public static void setUpTestSuite() {
        Properties properties = new Properties();
        properties.put("karaf.bootstrap.log", "target/karaf.log");
        BootstrapLogManager.setProperties(properties);
    }
View Full Code Here

        BootstrapLogManager.setProperties(properties);
    }
   
    @Before
    public void setUp() throws Exception {
        props = new Properties();
        props.put("karaf.lock.jdbc.url", url);
        props.put("karaf.lock.jdbc.driver", driver);
        props.put("karaf.lock.jdbc.user", user);
        props.put("karaf.lock.jdbc.password", password);
        props.put("karaf.lock.jdbc.table", tableName);
View Full Code Here

        LDAPCache.clear();
    }

    @Test
    public void testAdminLogin() throws Exception {
        Properties options = ldapLoginModuleOptions();
        LDAPLoginModule module = new LDAPLoginModule();
        CallbackHandler cb = new CallbackHandler() {
            public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
                for (Callback cb : callbacks) {
                    if (cb instanceof NameCallback) {
View Full Code Here

        assertTrue(module.logout());
        assertEquals("Principals should be gone as the user has logged out", 0, subject.getPrincipals().size());       
    }

    protected Properties ldapLoginModuleOptions() throws IOException {
        return new Properties(new File("src/test/resources/org/apache/karaf/jaas/modules/ldap/ldap.properties"));
    }
View Full Code Here

TOP

Related Classes of org.apache.felix.utils.properties.Properties$PropertiesReader

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.