You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DefaultDeploymentConfigurationTest.java 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package com.vaadin.server;
  2. import static org.junit.Assert.assertEquals;
  3. import java.util.Properties;
  4. import org.junit.Test;
  5. /**
  6. * Tests for {@link DefaultDeploymentConfiguration}
  7. *
  8. * @author Vaadin Ltd
  9. * @since 7.2
  10. */
  11. public class DefaultDeploymentConfigurationTest {
  12. @Test
  13. public void testGetSystemPropertyForDefaultPackage()
  14. throws ClassNotFoundException {
  15. Class<?> clazz = Class.forName("ClassInDefaultPackage");
  16. String value = "value";
  17. String prop = "prop";
  18. System.setProperty(prop, value);
  19. DefaultDeploymentConfiguration config = new DefaultDeploymentConfiguration(
  20. clazz, new Properties());
  21. assertEquals(value, config.getSystemProperty(prop));
  22. }
  23. @Test
  24. public void testGetSystemProperty() throws ClassNotFoundException {
  25. String value = "value";
  26. String prop = "prop";
  27. System.setProperty(
  28. DefaultDeploymentConfigurationTest.class.getPackage().getName()
  29. + '.' + prop,
  30. value);
  31. DefaultDeploymentConfiguration config = new DefaultDeploymentConfiguration(
  32. DefaultDeploymentConfigurationTest.class, new Properties());
  33. assertEquals(value, config.getSystemProperty(prop));
  34. }
  35. }