congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
JuUtils
Code IndexAdd Tabnine to your IDE (free)

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

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

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-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-dbutil

private void handleEncryptedPassword() {
  this.decryptedPassword = JuSecurityUtils.decryptTaggedValueIfNecessary(this.password, JuUtils.getDefaultEncryptor());
}

origin: ch.inftec.ju/ju-util

@Before
public void clearPropertyChain_beforeTests() {
  JuUtils.clearPropertyChain();
}

origin: ch.inftec.ju/ju-util

@Test
public void canInterpolate_value() {
  PropertyChain pc = PropertyChainTest.createPropertiesChain(false,
      "p1", "World");
  
  Assert.assertEquals("Hello World", JuUtils.interpolate("Hello ${p1}", pc));
}

origin: ch.inftec.ju/ju-util

@BeforeClass
public static void clearPropertyChain_afterTests() {
  JuUtils.clearPropertyChain();
}

origin: ch.inftec.ju/ju-util

  @Test
  public void canInterpolate_envValue() {
    try (SystemPropertyTempSetter ts = new SystemPropertyTempSetter()) {
      ts.setEnv("MY_ENV", "World");
      
      Assert.assertEquals("Hello World", JuUtils.interpolate("Hello ${env.MY_ENV}"));
    }
  }
}
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-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-dbutil

@Before
public void clearPropertyChain_beforeTests() {
  JuUtils.clearPropertyChain();
}

origin: ch.inftec.ju/ju-util

@Test
public void defaultDecryptor_isNull_whenPassword_isNotSet() {
  try (SystemPropertyTempSetter ts = new SystemPropertyTempSetter()) {
    ts.setProperty("ju-util.propertyChain.encryption.password", null);
    
    Assert.assertNull(JuUtils.getDefaultEncryptor());
  }
}

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-util

@Test
public void defaultDecryptor_isAvailable_whenPassword_isSet() {
  try (SystemPropertyTempSetter ts = new SystemPropertyTempSetter()) {
    ts.setProperty("ju-util.propertyChain.encryption.password", "secretPassword");
    
    Assert.assertEquals("secretVal", JuUtils.getDefaultEncryptor().decrypt("cCULeUjKiLfBwEgCOKC1g3BasxVDF85c"));
  }
}

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

String tagName = JuUtils.getJuPropertyChain().get(clazz.getName(), false);
String defaultTagName = JuUtils.getJuPropertyChain().get("ju.ee.cdi.defaultDynamicCdiTag", "-");
origin: ch.inftec.ju/ju-ee

String tagName = JuUtils.getJuPropertyChain().get(clazz.getName(), false);
String defaultTagName = JuUtils.getJuPropertyChain().get("ju.ee.cdi.defaultDynamicCdiTag", "-");
origin: ch.inftec.ju/ju-dbutil

/**
 * Loads connection info by PropertyChain profile.
 * <p>
 * This will look for the following properties:
 * <ul>
 *   <li>ju-dbutil-test.[profileName].connectionUrl</li>
 *   <li>ju-dbutil-test.[profileName].user</li>
 *   <li>ju-dbutil-test.[profileName].password</li>
 * </ul>
 * @param profileName
 * @return
 */
public JuConnUtilBuilder profile(String profileName) {
  PropertyChain pc = JuUtils.getJuPropertyChain();
  
  return this.url(pc.get(String.format("ju-dbutil-test.%s.connectionUrl", profileName)))
    .user(pc.get(String.format("ju-dbutil-test.%s.user", profileName)))
    .password(pc.get(String.format("ju-dbutil-test.%s.password", profileName)));
}

origin: ch.inftec.ju/ju-testing

private void prepareSchemaByProfile() {
  String profile = JuUtils.getJuPropertyChain().get("ju-dbutil-test.profile", true);
  String adminPassword = JuUtils.getJuPropertyChain().get(String.format("ju-dbutil-test.%sAdmin.password", profile), false);
  String schemaName = JuUtils.getJuPropertyChain().get(String.format("ju-dbutil-test.%s.schema", profile), false);
  String userName = JuUtils.getJuPropertyChain().get(String.format("ju-dbutil-test.%s.user", profile), false);
  if (StringUtils.isEmpty(schemaName)) {
    schemaName = userName;
      boolean dropExistingSchema = JuUtils.getJuPropertyChain().get(
          String.format("ju-dbutil-test.%s.dropExistingSchema", adminProfile), Boolean.class, "false");
      logger.info("Creating Schema {}", schemaName);
      String schemaPassword = JuUtils.getJuPropertyChain().get(String.format("ju-dbutil-test.%s.password", profile), false);
      boolean jtaRecoveryGrants = JuUtils.getJuPropertyChain().get(
          String.format("ju-dbutil-test.%s.jtaRecoveryGrants", profile), Boolean.class, "false");
origin: ch.inftec.ju/ju-testing

if (!JuUtils.getJuPropertyChain().get("ju-testing.export.compareToResource", Boolean.class)
    && this.dataSetConfigInfo.isLoadImportResourcesFromFileSystem() && !StringUtils.isEmpty(resourceDir)) {
origin: ch.inftec.ju/ju-testing

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

Most used methods

  • getJuPropertyChain
  • clearPropertyChain
  • getDefaultEncryptor
  • interpolate

Popular in Java

  • Start an intent from android
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • setContentView (Activity)
  • startActivity (Activity)
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Join (org.hibernate.mapping)
  • Runner (org.openjdk.jmh.runner)
  • Sublime Text for Python
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now