Search in sources :

Example 1 with ImmutableResourceException

use of org.apache.tools.ant.types.resources.ImmutableResourceException in project ant by apache.

the class ResourceOutputTest method testpropertyoutput2.

@Test
public void testpropertyoutput2() throws IOException {
    project.setNewProperty("bar", "bar");
    PropertyResource r = new PropertyResource(project, "bar");
    try {
        testoutput(r);
        fail("should have caught ImmutableResourceException");
    } catch (ImmutableResourceException e) {
    // TODO assert exception message
    }
    assertEquals("bar", project.getProperty("bar"));
}
Also used : ImmutableResourceException(org.apache.tools.ant.types.resources.ImmutableResourceException) PropertyResource(org.apache.tools.ant.types.resources.PropertyResource) Test(org.junit.Test)

Example 2 with ImmutableResourceException

use of org.apache.tools.ant.types.resources.ImmutableResourceException in project ant by apache.

the class ResourceOutputTest method teststringoutput2.

@Test
public void teststringoutput2() throws IOException {
    StringResource r = new StringResource("bar");
    try {
        testoutput(r);
        fail("should have caught ImmutableResourceException");
    } catch (ImmutableResourceException e) {
    // TODO assert exception message
    }
    assertEquals("bar", r.getValue());
}
Also used : StringResource(org.apache.tools.ant.types.resources.StringResource) ImmutableResourceException(org.apache.tools.ant.types.resources.ImmutableResourceException) Test(org.junit.Test)

Aggregations

ImmutableResourceException (org.apache.tools.ant.types.resources.ImmutableResourceException)2 Test (org.junit.Test)2 PropertyResource (org.apache.tools.ant.types.resources.PropertyResource)1 StringResource (org.apache.tools.ant.types.resources.StringResource)1