Codota Logo
JuUtils.getJuPropertyChain
Code IndexAdd Codota to your IDE (free)

How to use
getJuPropertyChain
method
in
ch.inftec.ju.util.JuUtils

Best Java code snippets using ch.inftec.ju.util.JuUtils.getJuPropertyChain (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
DateTime d =
  • Codota Iconnew DateTime()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseDateTime(text)
  • Codota IconObject instant;new DateTime(instant)
  • Smart code suggestions by Codota
}
origin: ch.inftec.ju/ju-testing

  /**
   * Assumes that the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files are installed.
   * <p>
   * These are necessary to use strong encryption algorithms.
   */
  public static void javaCryptographyExtensionInstalled() {
    boolean javaCryptographyExtensionInstalled = JuUtils.getJuPropertyChain().get(
        "ju-testing.javaCryptographyExtension.isInstalled", Boolean.class, true);
    Assume.assumeTrue(javaCryptographyExtensionInstalled);
  }
}
origin: ch.inftec.ju/ju-testing

/**
 * Assumes the Chrome browser is available.
 */
public static void chromeIsAvailable() {
  boolean chromeIsAvailable = JuUtils.getJuPropertyChain().get("ju-testing-ee.selenium.chrome.isAvailable", Boolean.class, true);
  Assume.assumeTrue("Chrome is not available", chromeIsAvailable);
}

origin: ch.inftec.ju/ju-testing

/**
 * Assumes Internet access is available.
 */
public static void internetIsAvailable() {
  boolean chromeIsAvailable = JuUtils.getJuPropertyChain().get("ju-testing-ee.internet.isAvailable", Boolean.class, true);
  Assume.assumeTrue("Internet is not available", chromeIsAvailable);
}

origin: ch.inftec.ju/ju-ee-testing

  /**
   * Gets the full page URL for an URL specified without host and port,
   * e.g. <code>web-app/page.jsf</code>. Host name and port will be resolved from the
   * JU properties, e.g. <code>http://localhost:8080/web-app/page.jsf</code>
   * 
   * @param subPageUrl
   *            Page URL without host an port
   */
  public static String getPageUrl(String subPageUrl) {
    PropertyChain pc = JuUtils.getJuPropertyChain();

    String host = pc.get("ju-testing-ee.web.host");
    Integer port = pc.get("ju-testing-ee.web.port", Integer.class) + pc.get("ju-util-ee.portOffset", Integer.class);

    String url = String.format("http://%s:%d/%s", host, port, subPageUrl);
    return url;
  }
}
origin: ch.inftec.ju/ju-util-ee

@Override
public void cleanupTestRun(TestRunnerAnnotationHandler handler, SystemPropertyTempSetter tempSetter) {
  try (ContainerTestContextSetter s = handler.new ContainerTestContextSetter(true)) {
    tempSetter.close();
    // Clear property chain if clearing property is set
    if (JuUtils.getJuPropertyChain().get("ju-testing-ee.clearPropertyChainAfterEachTest", Boolean.class, "false")) {
      JuUtils.clearPropertyChain();
    }
  }
}
origin: ch.inftec.ju/ju-ee-testing

@Override
public void cleanupTestRun(TestRunnerAnnotationHandler handler, SystemPropertyTempSetter tempSetter) {
  try (ContainerTestContextSetter s = handler.new ContainerTestContextSetter(true)) {
    tempSetter.close();
    // Clear property chain if clearing property is set
    if (JuUtils.getJuPropertyChain().get("ju-testing-ee.clearPropertyChainAfterEachTest", Boolean.class, "false")) {
      JuUtils.clearPropertyChain();
    }
  }
}
origin: ch.inftec.ju/ju-testing

  @Test
  public void multiplePropertyFiles_areFound() {
    Assert.assertEquals("testing", JuUtils.getJuPropertyChain().get("ju-testing.property"));
  }
}
origin: ch.inftec.ju/ju-util

@Test
public void propertyChain_isInitialized() {
  Assert.assertEquals("derby", JuUtils.getJuPropertyChain().get("ju-dbutil-test.profile"));
}

origin: ch.inftec.ju/ju-ee

/**
 * Initializes the remote service locator based on the values of configuration properties
 * using the default JU Property chain.
 * 
 * @return Builder to adapt configuration
 */
public RemoteServiceLocatorBuilder initByConfigurationFiles() {
  PropertyChain pc = JuUtils.getJuPropertyChain();
  Integer port = pc.get("ju-util-ee.remote.port", Integer.class, true);
  Integer portOffset = pc.get("ju-util-ee.portOffset", Integer.class, true);
  this.remoteServer(pc.get("ju-util-ee.remote.host", true), port + portOffset);
  this.appName(pc.get("ju-util-ee.remote.appName", true));
  this.moduleName(pc.get("ju-util-ee.remote.moduleName", true));
  return this;
}
origin: ch.inftec.ju/ju-util

@Test
public void propertyChain_ignoresDecryption_ifPasswordFileIsNotSet() {
  try (SystemPropertyTempSetter ts = new SystemPropertyTempSetter()) {
    ts.setProperty("ju-util.profile", "testEncryption");
    
    Assert.assertEquals("ENC(8vu+etsGrzZK30MCEBjTzg==)", JuUtils.getJuPropertyChain().get("ju-util.encryptedString"));
  }
}

origin: ch.inftec.ju/ju-util

@Test
public void propertyChain_priorizes_systemProperty() {
  try (SystemPropertyTempSetter ts = new SystemPropertyTempSetter()) {
    ts.setProperty("ju-dbutil-test.profile", "myDerby");
    
    Assert.assertEquals("myDerby", JuUtils.getJuPropertyChain().get("ju-dbutil-test.profile"));
  }
}

origin: ch.inftec.ju/ju-util

@Test
public void profile_isResolved_forCsvFile() {
  try (SystemPropertyTempSetter ts = new SystemPropertyTempSetter()) {
    ts.setProperty("ju-util.profile", "testCsv");
    
    Assert.assertEquals("profileTestCsv", JuUtils.getJuPropertyChain().get("ju-util.testCsv"));
  }
}

origin: ch.inftec.ju/ju-util

@Test
public void profile_isResolved_forPropertyFile() {
  try (SystemPropertyTempSetter ts = new SystemPropertyTempSetter()) {
    ts.setProperty("ju-util.profile", "test");
    
    Assert.assertEquals("profileTestProps", JuUtils.getJuPropertyChain().get("ju-util.testProps"));
  }
}
  
origin: ch.inftec.ju/ju-util

@Test
public void profile_isResolved_forCsvFile_usingDefault() {
  try (SystemPropertyTempSetter ts = new SystemPropertyTempSetter()) {
    ts.setProperty("ju-util.profile", "testCsv");
    
    Assert.assertEquals("profileTestCsvDefault", JuUtils.getJuPropertyChain().get("ju-util.testCsvDefault"));
  }
}

origin: ch.inftec.ju/ju-ee

/**
 * Builds a remote service locator based on the values of configuration properties
 * using the default JU Property chain.
 * 
 * @return Remote service locator
 */
public static JndiServiceLocator createRemoteByConfigurationFiles() {
  PropertyChain pc = JuUtils.getJuPropertyChain();
  
  Integer port = pc.get("ju-util-ee.remote.port", Integer.class, true);
  Integer portOffset = pc.get("ju-util-ee.portOffset", Integer.class, true);
  
  return buildRemote()
    .remoteServer(pc.get("ju-util-ee.remote.host", true), port + portOffset)
    .appName(pc.get("ju-util-ee.remote.appName", true))
    .moduleName(pc.get("ju-util-ee.remote.moduleName", true))
    .createServiceLocator();
}

origin: ch.inftec.ju/ju-util-ee

/**
 * Builds a remote service locator based on the values of configuration properties
 * using the default JU Property chain.
 * 
 * @return Remote service locator
 */
public static JndiServiceLocator createRemoteByConfigurationFiles() {
  PropertyChain pc = JuUtils.getJuPropertyChain();
  
  Integer port = pc.get("ju-util-ee.remote.port", Integer.class, true);
  Integer portOffset = pc.get("ju-util-ee.portOffset", Integer.class, true);
  
  return buildRemote()
    .remoteServer(pc.get("ju-util-ee.remote.host", true), port + portOffset)
    .appName(pc.get("ju-util-ee.remote.appName", true))
    .moduleName(pc.get("ju-util-ee.remote.moduleName", true))
    .createServiceLocator();
}

origin: ch.inftec.ju/ju-util

@Test
public void propertyChain_supportDecryption_ifPasswordPropertyIsSet() {
  try (SystemPropertyTempSetter ts = new SystemPropertyTempSetter()) {
    ts.setProperty("ju-util.propertyChain.encryption.password", "secretPassword");
    ts.setProperty("encrVal", "ENC(cCULeUjKiLfBwEgCOKC1g3BasxVDF85c)"); // secretVal
    
    Assert.assertEquals("secretVal", JuUtils.getJuPropertyChain().get("encrVal"));
  }
}

origin: ch.inftec.ju/ju-util

@Test
public void propertyChain_supportDecryption_ifPasswordFileIsSet() {
  try (SystemPropertyTempSetter ts = new SystemPropertyTempSetter()) {
    ts.setProperty("ju-util.profile", "testEncryption");
    ts.setProperty("ju-util.propertyChain.encryption.passwordFile"
        , "src/test/resources/ch/inftec/ju/util/JuUtilsTest_encryptionPassword");
    
    Assert.assertEquals("String", JuUtils.getJuPropertyChain().get("ju-util.encryptedString"));
  }
}

origin: ch.inftec.ju/ju-util

@Test
public void propertyChain_interpolates_byDefault() {
  try (SystemPropertyTempSetter ts = new SystemPropertyTempSetter()) {
    ts.setProperty("ju-util.propertyChain.interpolation", null);
    ts.setProperty("p1", "v1");
    ts.setProperty("p2", "v2 ${p1}");
    
    Assert.assertEquals("v2 v1", JuUtils.getJuPropertyChain().get("p2"));
  }
}

origin: ch.inftec.ju/ju-util

@Test
public void propertyChain_doesnNotinterpolate_ifDeactivated() {
  try (SystemPropertyTempSetter ts = new SystemPropertyTempSetter()) {
    ts.setProperty("ju-util.propertyChain.interpolation", "false");
    ts.setProperty("p1", "v1");
    ts.setProperty("p2", "v2 ${p1}");
    
    Assert.assertEquals("v2 ${p1}", JuUtils.getJuPropertyChain().get("p2"));
  }
}

ch.inftec.ju.utilJuUtilsgetJuPropertyChain

Popular methods of JuUtils

  • clearPropertyChain
  • getDefaultEncryptor
  • interpolate

Popular in Java

  • Reactive rest calls using spring rest template
  • getSupportFragmentManager (FragmentActivity)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • getSystemService (Context)
  • Color (java.awt)
    The Color class is used encapsulate colors in the default sRGB color space or colors in arbitrary co
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • List (java.util)
    A List is a collection which maintains an ordering for its elements. Every element in the List has a
  • Notification (javax.management)
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within
  • JCheckBox (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now