1   package org.jmage.filter.merge;
2   
3   import org.jmage.JmageException;
4   import org.jmage.mapper.JunitMapper;
5   
6   import java.io.IOException;
7   import java.net.URI;
8   import java.net.URISyntaxException;
9   import java.util.Properties;
10  
11  /***
12   * Test Textoverlay fails with alpha less than zero
13   */
14  public class TextOverlayALPHALT0 extends JunitMapper {
15  
16      public void setFilterChainURI() throws URISyntaxException {
17          request.setFilterChainURI(new URI("chain:org.jmage.filter.merge.TextOverlayFilter"));
18      }
19  
20      public void setProperties() {
21          Properties props = new Properties();
22          props.setProperty("FONT_URI", "file:///maxhandwriting.ttf");
23          props.setProperty("TEXT", "test");
24          props.setProperty("POSITION", "9");
25          props.setProperty("COLOR", "ffffff");
26          props.setProperty("FONT_SIZE", "144");
27          props.setProperty("FONT_STYLE", "BOLD");
28          props.setProperty("ANTIALIASING", "TRUE");
29          props.setProperty("BORDEROFFSET", "20");
30          props.setProperty("ORIENTATION", "360");
31          props.setProperty("OPACITY", "-110");
32          request.setFilterChainProperties(props);
33      }
34  
35      public void testFilter() throws JmageException, IOException {
36          boolean failed = false;
37          try {
38              dispatcher.dispatch(request);
39              this.writeResults(request);
40          } catch (Throwable t) {
41              failed = true;
42          }
43          assertTrue(failed);
44      }
45  }