On 02/12/2018 23:05, Christopher Schultz wrote: > Mark, > > On 11/30/18 15:59, ma...@apache.org wrote: >> Author: markt Date: Fri Nov 30 20:59:37 2018 New Revision: 1847854 > >> URL: http://svn.apache.org/viewvc?rev=1847854&view=rev Log: >> Clean-up file created during test > > It was actually intentional to leave this file behind after the test,
Worth finding a different location for the file and telling svn and git to ignore it... > but after verifying that "different JVM instances" wasn't the problem > with the implementation (the stupidly non-thread-safeness of the > interceptor was) it's really no longer necessary. ... or may just remove those tests then. Mark > > Thanks, > -chris > >> Modified: >> tomcat/trunk/test/org/apache/catalina/tribes/group/interceptors/TestEn > cryptInterceptor.java > >> Modified: >> tomcat/trunk/test/org/apache/catalina/tribes/group/interceptors/TestEn > cryptInterceptor.java > > > URL: > http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/tribe > s/group/interceptors/TestEncryptInterceptor.java?rev=1847854&r1=1847853& > r2=1847854&view=diff >> ====================================================================== > ======== > > > --- > tomcat/trunk/test/org/apache/catalina/tribes/group/interceptors/TestEncr > yptInterceptor.java > (original) >> +++ >> tomcat/trunk/test/org/apache/catalina/tribes/group/interceptors/TestEn > cryptInterceptor.java >> Fri Nov 30 20:59:37 2018 @@ -25,6 +25,7 @@ import >> java.util.Collection; import org.hamcrest.core.IsEqual; import >> org.hamcrest.core.IsNot; > >> +import org.junit.AfterClass; import org.junit.Assert; import >> org.junit.Before; import org.junit.FixMethodOrder; @@ -51,6 +52,8 >> @@ import org.apache.catalina.tribes.io.XBy */ >> @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class >> TestEncryptInterceptor { + private static final String >> MESSAGE_FILE = "message.bin"; + private static final String >> encryptionKey128 = "cafebabedeadbeefbeefcafecafebabe"; private >> static final String encryptionKey192 = >> "cafebabedeadbeefbeefcafecafebabedeadbeefbeefcafe"; private static >> final String encryptionKey256 = >> "cafebabedeadbeefcafebabedeadbeefcafebabedeadbeefcafebabedeadbeef"; > > > @@ -58,6 +61,15 @@ public class TestEncryptInterceptor { >> EncryptInterceptor src; EncryptInterceptor dest; > >> + + @AfterClass + public static void cleanup() { + >> File f = new File(MESSAGE_FILE); + if (f.isFile()) { + >> Assert.assertTrue(f.delete()); + } + } + @Before public >> void setup() { src = new EncryptInterceptor(); @@ -294,7 +306,7 @@ >> public class TestEncryptInterceptor { > >> byte[] bytes = >> ((ValueCaptureInterceptor)src.getNext()).getValue(); > >> - try (FileOutputStream out = new >> FileOutputStream("message.bin")) { + try (FileOutputStream >> out = new FileOutputStream(MESSAGE_FILE)) { out.write(bytes); } > >> @@ -303,7 +315,7 @@ public class TestEncryptInterceptor { bytes = >> new byte[8192]; int read; > >> - try (FileInputStream in = new >> FileInputStream("message.bin")) { + try (FileInputStream in >> = new FileInputStream(MESSAGE_FILE)) { read = in.read(bytes); } > >> @@ -339,7 +351,7 @@ public class TestEncryptInterceptor { > >> @Test public void testPickup() throws Exception { - File >> file = new File("message.bin"); + File file = new >> File(MESSAGE_FILE); if(!file.exists()) { System.err.println("File >> message.bin does not exist. Skipping test."); return; @@ -350,7 >> +362,7 @@ public class TestEncryptInterceptor { byte[] bytes = new >> byte[8192]; int read; > >> - try (FileInputStream in = new >> FileInputStream("message.bin")) { + try (FileInputStream in >> = new FileInputStream(file)) { read = in.read(bytes); } > > > > >> --------------------------------------------------------------------- > > > To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org >> For additional commands, e-mail: dev-h...@tomcat.apache.org > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org > For additional commands, e-mail: dev-h...@tomcat.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org