コード例 #1
0
 /**
  * Test parsing of jboss-web.xml which doesn't have any distinct-name set
  *
  * @throws Exception
  */
 @Test
 public void testDistinctNameAbsence() throws Exception {
   final MetaDataElementParser.DTDInfo resolver = new MetaDataElementParser.DTDInfo();
   final JBossWebMetaData jBossWebMetaData =
       JBossWebMetaDataParser.parse(getReader("no-distinct-name-jboss-web.xml", resolver));
   Assert.assertNull("Distinct name was expected to be null", jBossWebMetaData.getDistinctName());
 }
コード例 #2
0
 /**
  * Test parsing of a simple distinct-name (which doesn't have any reference to system properties)
  * in jboss-web.xml
  *
  * @throws Exception
  */
 @Test
 public void testSimpleDistinctName() throws Exception {
   final MetaDataElementParser.DTDInfo resolver = new MetaDataElementParser.DTDInfo();
   final JBossWebMetaData jBossWebMetaData =
       JBossWebMetaDataParser.parse(getReader("simple-distinct-name-jboss-web.xml", resolver));
   Assert.assertEquals(
       "Unexpected distinct name", "simple-foo-bar", jBossWebMetaData.getDistinctName());
 }
コード例 #3
0
 /**
  * Test parsing of distinct-name which contains reference to a system property
  *
  * @throws Exception
  */
 @Test
 public void testDistinctNameWithExpression() throws Exception {
   // set the system property first
   System.setProperty("org.jboss.test.metadata.web.sysprop.foo", "bar");
   final MetaDataElementParser.DTDInfo resolver = new MetaDataElementParser.DTDInfo();
   final JBossWebMetaData jBossWebMetaData =
       JBossWebMetaDataParser.parse(getReader("expression-distinct-name-jboss-web.xml", resolver));
   Assert.assertEquals(
       "Unexpected distinct name", "bar-distinct-name", jBossWebMetaData.getDistinctName());
 }