- // Test write combinations
- assertNotNull(XACMLPolicyWriter.writePolicyFile(filename, policySet));
- assertNotNull(XACMLPolicyWriter.writePolicyFile(filename, policyType));
- assertNotNull(XACMLPolicyWriter.getXmlAsInputStream(policyType));
- XACMLPolicyWriter.writePolicyFile(os, policySet);
- assertNotNull(os.toString());
- XACMLPolicyWriter.writePolicyFile(os, policyType);
- assertNotNull(os.toString());
- }
+ // ensure its deleted after writePolicyFile() re-creates it
+ tmpfile.deleteOnExit();
+
+ // Test write combinations
+ assertNotNull(XACMLPolicyWriter.writePolicyFile(filename, policySet));
+ assertNotNull(XACMLPolicyWriter.writePolicyFile(filename, policyType));
+ assertNotNull(XACMLPolicyWriter.getXmlAsInputStream(policyType));
+ XACMLPolicyWriter.writePolicyFile(os, policySet);
+ assertNotNull(os.toString());
+ XACMLPolicyWriter.writePolicyFile(os, policyType);
+ assertNotNull(os.toString());
+ }