Package es.zoocial.tsa

Examples of es.zoocial.tsa.Configuration.loadConfiguration()


      }
     
      log.info(String.format("Configuring servlet with file '%s'", configurationFile));
     
      Configuration conf = new Configuration();
      conf.loadConfiguration(configurationFile);
     
      KeystoreHandler store = new KeystoreHandler();
      store.loadKeystore(KeystoreModel.fromMap(conf.getPropertySet("keystore")));
      stamper = new Timestamper(store);
     
View Full Code Here


      cfg = Mockito.spy(cfg);
      Mockito.doReturn("")
          .when(cfg)
          .getConfigurationFilename();
    }
    cfg.loadConfiguration();
  }

 
  @Test(expected=IllegalArgumentException.class)
  public void testLoadConfigurationWithInvalidEnvVarThrowsIllegalArgumentException() {
View Full Code Here

      cfg = Mockito.spy(cfg);
      Mockito.doReturn("file://invalidfile-" + UUID.randomUUID().toString())
          .when(cfg)
          .getConfigurationFilename();
    }
    cfg.loadConfiguration();
  }
 
  @Test
  public void testLoadConfigurationWithValidFileURL() {
    Configuration cfg = new Configuration();
View Full Code Here

      cfg = Mockito.spy(cfg);
      Mockito.doReturn(confFileUrl.toString())
          .when(cfg)
          .getConfigurationFilename();
    }
    cfg.loadConfiguration();
   
    Assert.assertEquals("Configuration test key", "has some value", cfg.getProperty("some-key"));
  }

 
View Full Code Here

 
  @Test
  public void testLoadConfigurationWithValidFileURLAsArgument() {
    Configuration cfg = new Configuration();
    URL confFileUrl = getClass().getResource(getClass().getSimpleName() + ".properties");
    cfg.loadConfiguration(confFileUrl.toString());
   
    Assert.assertEquals("Configuration test key", "has some value", cfg.getProperty("some-key"));
  }
 
  @Test
View Full Code Here

 
  @Test
  public void testGetConfigurationPropertySet() {
    Configuration cfg = new Configuration();
    URL confFileUrl = getClass().getResource(getClass().getSimpleName() + ".properties");
    cfg.loadConfiguration(confFileUrl.toString());
   
    Map<String, String> propertySet = cfg.getPropertySet("myprefix.");
    Assert.assertNotNull("Property Set", propertySet);
    Assert.assertEquals("Value 1", propertySet.get("value1"), "value 1");
    Assert.assertEquals("Value 2", propertySet.get("value2"), "value 2");
View Full Code Here

  private static KeystoreHandler keystore = null;
 
  public static KeystoreHandler getP12Keystore() {
    if (keystore == null) {
      Configuration conf = new Configuration();
      conf.loadConfiguration(KeystoreHelper.class.getResource("keystore.properties").toString());
      Map<String, String> propertySet = conf.getPropertySet("keystore");
      URL url = null;
      try {
        url = new URL("file:cert/tsa.p12");
      } catch (MalformedURLException e) {
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.