Package org.apache.wookie.feature

Examples of org.apache.wookie.feature.Feature


   */
  @Test
  public void loadFeature() throws Exception{
    File featureFile = new File(testDataFolder+"feature.xml");
    assertTrue(featureFile.exists());
    Feature feature = Features.loadFeature(featureFile, basePath);
    assertEquals("test:feature", feature.getName());
    assertEquals(0, feature.stylesheets().length);
    assertEquals(0, feature.scripts().length);
  }
View Full Code Here


  @Test(expected = Exception.class)
  public void loadFeatureInvalidName() throws Exception{
    File featureFile = new File(testDataFolder+"feature_invalid_name.xml");
    assertTrue(featureFile.exists());
    try {
      @SuppressWarnings("unused")
      Feature feature = Features.loadFeature(featureFile, basePath);
    } catch (Exception e) {
      assertEquals("Invalid feature: name is not a valid IRI", e.getMessage());
      throw e;
    }
View Full Code Here

   */
  @Test
  public void loadFeatureWithResources() throws Exception{
    File featureFile = new File(testDataFolder+"feature_with_resources.xml");
    assertTrue(featureFile.exists());  
    Feature feature = Features.loadFeature(featureFile, basePath);
    assertEquals(1, feature.stylesheets().length);
    assertEquals(0, feature.scripts().length);
    assertEquals("/test/test_styles.css", feature.stylesheets()[0]);
  }
View Full Code Here

   */
  @Test
  public void loadFeatureWithScripts() throws Exception{
    File featureFile = new File(testDataFolder+"feature_with_scripts.xml");
    assertTrue(featureFile.exists());  
    Feature feature = Features.loadFeature(featureFile, basePath);
    assertEquals(0, feature.stylesheets().length);
    assertEquals(2, feature.scripts().length);
    assertEquals("/test/test_script.js", feature.scripts()[0]);   
    assertEquals("/absolute_path_to_script.js", feature.scripts()[1]);   
  }
View Full Code Here

 
  @Test
  public void loadFeatureWithFlattenAttribute() throws Exception{
    File featureFile = new File(testDataFolder+"feature_with_flatten_attr.xml");
    assertTrue(featureFile.exists());  
    Feature feature = Features.loadFeature(featureFile, basePath);   
    assertTrue(feature.flattenOnExport());
  }
View Full Code Here

   */
  @Test
  public void loadFeature() throws Exception{
    File featureFile = new File(testDataFolder+"feature.xml");
    assertTrue(featureFile.exists());
    Feature feature = Features.loadFeature(featureFile, basePath);
    assertEquals("test:feature", feature.getName());
    assertEquals(0, feature.stylesheets().length);
    assertEquals(0, feature.scripts().length);
  }
View Full Code Here

  @Test(expected = Exception.class)
  public void loadFeatureInvalidName() throws Exception{
    File featureFile = new File(testDataFolder+"feature_invalid_name.xml");
    assertTrue(featureFile.exists());
    try {
      @SuppressWarnings("unused")
      Feature feature = Features.loadFeature(featureFile, basePath);
    } catch (Exception e) {
      assertEquals("Invalid feature: name is not a valid IRI", e.getMessage());
      throw e;
    }
View Full Code Here

   */
  @Test
  public void loadFeatureWithResources() throws Exception{
    File featureFile = new File(testDataFolder+"feature_with_resources.xml");
    assertTrue(featureFile.exists());  
    Feature feature = Features.loadFeature(featureFile, basePath);
    assertEquals(1, feature.stylesheets().length);
    assertEquals(0, feature.scripts().length);
    assertEquals("/test/test_styles.css", feature.stylesheets()[0]);
  }
View Full Code Here

   */
  @Test
  public void loadFeatureWithScripts() throws Exception{
    File featureFile = new File(testDataFolder+"feature_with_scripts.xml");
    assertTrue(featureFile.exists());  
    Feature feature = Features.loadFeature(featureFile, basePath);
    assertEquals(0, feature.stylesheets().length);
    assertEquals(2, feature.scripts().length);
    assertEquals("/test/test_script.js", feature.scripts()[0]);   
    assertEquals("/absolute_path_to_script.js", feature.scripts()[1]);   
  }
View Full Code Here

 
  @Test
  public void loadFeatureWithFlattenAttribute() throws Exception{
    File featureFile = new File(testDataFolder+"feature_with_flatten_attr.xml");
    assertTrue(featureFile.exists());  
    Feature feature = Features.loadFeature(featureFile, basePath);   
    assertTrue(feature.flattenOnExport());
  }
View Full Code Here

TOP

Related Classes of org.apache.wookie.feature.Feature

Copyright © 2018 www.massapicom. 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.