test_class.declarator: reader
test_class.modifier: private
test_class.original_string: private SingleWriterMultipleReaderFile reader;
test_class.type: SingleWriterMultipleReaderFile
test_class.var_name: reader
test_class.declarator: activeFile
test_class.modifier: private
test_class.original_string: private File activeFile;
test_class.type: File
test_class.var_name: activeFile
test_class.declarator: workFile
test_class.modifier: private
test_class.original_string: private File workFile;
test_class.type: File
test_class.var_name: workFile
test_class.declarator: fos
test_class.modifier: private
test_class.original_string: private FileOutputStream fos;
test_class.type: FileOutputStream
test_class.var_name: fos
test_class.file: app/src/test/java/org/jak_linux/dns66/SingleWriterMultipleReaderFileTest.java
test_class.identifier: SingleWriterMultipleReaderFileTest
test_case.body: @Test
      public void testFinishWrite_success() throws Exception {
          doCallRealMethod().when(reader).finishWrite(any(FileOutputStream.class));
  
          when(workFile.renameTo(activeFile)).thenReturn(true);
  
          try {
              reader.finishWrite(fos);
              Mockito.verify(fos).close();
          } catch (IOException e) {
              fail("Successful rename commits transaction");
          }
      }
test_case.class_method_signature: SingleWriterMultipleReaderFileTest.testFinishWrite_success()
test_case.full_signature: @Test public void testFinishWrite_success()
test_case.identifier: testFinishWrite_success
test_case.invocations: finishWrite when doCallRealMethod any thenReturn when renameTo finishWrite close verify fail
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testFinishWrite_success()
focal_class.declarator: activeFile
focal_class.original_string: File activeFile;
focal_class.type: File
focal_class.var_name: activeFile
focal_class.declarator: workFile
focal_class.original_string: File workFile;
focal_class.type: File
focal_class.var_name: workFile
focal_class.file: app/src/main/java/org/jak_linux/dns66/SingleWriterMultipleReaderFile.java
focal_class.identifier: SingleWriterMultipleReaderFile
focal_class.class_method_signature: SingleWriterMultipleReaderFile.SingleWriterMultipleReaderFile(File file)
focal_class.full_signature: public  SingleWriterMultipleReaderFile(File file)
focal_class.identifier: SingleWriterMultipleReaderFile
focal_class.modifiers: public
focal_class.parameters: (File file)
focal_class.signature:  SingleWriterMultipleReaderFile(File file)
focal_class.class_method_signature: SingleWriterMultipleReaderFile.openRead()
focal_class.full_signature: public InputStream openRead()
focal_class.identifier: openRead
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: InputStream
focal_class.signature: InputStream openRead()
focal_class.class_method_signature: SingleWriterMultipleReaderFile.startWrite()
focal_class.full_signature: public FileOutputStream startWrite()
focal_class.identifier: startWrite
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: FileOutputStream
focal_class.signature: FileOutputStream startWrite()
focal_class.class_method_signature: SingleWriterMultipleReaderFile.finishWrite(FileOutputStream stream)
focal_class.full_signature: public void finishWrite(FileOutputStream stream)
focal_class.identifier: finishWrite
focal_class.modifiers: public
focal_class.parameters: (FileOutputStream stream)
focal_class.return: void
focal_class.signature: void finishWrite(FileOutputStream stream)
focal_class.class_method_signature: SingleWriterMultipleReaderFile.failWrite(FileOutputStream stream)
focal_class.full_signature: public void failWrite(FileOutputStream stream)
focal_class.identifier: failWrite
focal_class.modifiers: public
focal_class.parameters: (FileOutputStream stream)
focal_class.return: void
focal_class.signature: void failWrite(FileOutputStream stream)
focal_method.body: public void finishWrite(FileOutputStream stream) throws IOException {
          try {
              stream.close();
          } catch (IOException e) {
              failWrite(stream);
              throw e;
          }
  
          if (!workFile.renameTo(activeFile)) {
              failWrite(stream);
              throw new IOException("Cannot commit transaction");
          }
      }
focal_method.class_method_signature: SingleWriterMultipleReaderFile.finishWrite(FileOutputStream stream)
focal_method.full_signature: public void finishWrite(FileOutputStream stream)
focal_method.identifier: finishWrite
focal_method.invocations: close failWrite renameTo failWrite
focal_method.modifiers: public
focal_method.parameters: (FileOutputStream stream)
focal_method.return: void
focal_method.signature: void finishWrite(FileOutputStream stream)