public class org.apache.zookeeper.common.AtomicFileWritingIdiomTest extends org.apache.zookeeper.ZKTestCase
{
public void <init>()
{
org.apache.zookeeper.common.AtomicFileWritingIdiomTest v;
v := @this: org.apache.zookeeper.common.AtomicFileWritingIdiomTest;
specialinvoke v.<org.apache.zookeeper.ZKTestCase: void <init>()>();
return;
}
public void testOutputStreamSuccess(java.io.File) throws java.io.IOException
{
org.apache.zookeeper.common.AtomicFileWritingIdiomTest v;
java.io.File v, v, v;
org.apache.zookeeper.common.AtomicFileWritingIdiomTest$1 v;
org.apache.zookeeper.common.AtomicFileWritingIdiom v;
java.lang.String v, v;
boolean v;
v := @this: org.apache.zookeeper.common.AtomicFileWritingIdiomTest;
v := @parameter: java.io.File;
v = new java.io.File;
specialinvoke v.<java.io.File: void <init>(java.io.File,java.lang.String)>(v, "target.txt");
v = new java.io.File;
specialinvoke v.<java.io.File: void <init>(java.io.File,java.lang.String)>(v, "target.txt.tmp");
specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest: void createFile(java.io.File,java.lang.String)>(v, "before");
v = specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest: java.lang.String getContent(java.io.File)>(v);
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(java.lang.Object,java.lang.Object)>("before", v);
v = new org.apache.zookeeper.common.AtomicFileWritingIdiom;
v = new org.apache.zookeeper.common.AtomicFileWritingIdiomTest$1;
specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest$1: void <init>(org.apache.zookeeper.common.AtomicFileWritingIdiomTest,java.io.File)>(v, v);
specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiom: void <init>(java.io.File,org.apache.zookeeper.common.AtomicFileWritingIdiom$OutputStreamStatement)>(v, v);
v = virtualinvoke v.<java.io.File: boolean exists()>();
staticinvoke <org.junit.jupiter.api.Assertions: void assertFalse(boolean,java.lang.String)>(v, "tmp file should have been deleted");
v = specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest: java.lang.String getContent(java.io.File)>(v);
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(java.lang.Object,java.lang.Object)>("after", v);
return;
}
public void testWriterSuccess(java.io.File) throws java.io.IOException
{
org.apache.zookeeper.common.AtomicFileWritingIdiomTest v;
java.io.File v, v, v;
org.apache.zookeeper.common.AtomicFileWritingIdiomTest$2 v;
org.apache.zookeeper.common.AtomicFileWritingIdiom v;
java.lang.String v, v;
boolean v;
v := @this: org.apache.zookeeper.common.AtomicFileWritingIdiomTest;
v := @parameter: java.io.File;
v = new java.io.File;
specialinvoke v.<java.io.File: void <init>(java.io.File,java.lang.String)>(v, "target.txt");
v = new java.io.File;
specialinvoke v.<java.io.File: void <init>(java.io.File,java.lang.String)>(v, "target.txt.tmp");
specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest: void createFile(java.io.File,java.lang.String)>(v, "before");
v = specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest: java.lang.String getContent(java.io.File)>(v);
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(java.lang.Object,java.lang.Object)>("before", v);
v = new org.apache.zookeeper.common.AtomicFileWritingIdiom;
v = new org.apache.zookeeper.common.AtomicFileWritingIdiomTest$2;
specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest$2: void <init>(org.apache.zookeeper.common.AtomicFileWritingIdiomTest,java.io.File)>(v, v);
specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiom: void <init>(java.io.File,org.apache.zookeeper.common.AtomicFileWritingIdiom$WriterStatement)>(v, v);
v = virtualinvoke v.<java.io.File: boolean exists()>();
staticinvoke <org.junit.jupiter.api.Assertions: void assertFalse(boolean,java.lang.String)>(v, "tmp file should have been deleted");
v = specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest: java.lang.String getContent(java.io.File)>(v);
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(java.lang.Object,java.lang.Object)>("after", v);
return;
}
public void testOutputStreamFailure(java.io.File) throws java.io.IOException
{
org.apache.zookeeper.common.AtomicFileWritingIdiomTest v;
java.lang.RuntimeException v;
java.io.File v, v, v;
org.apache.zookeeper.common.AtomicFileWritingIdiomTest$3 v;
org.apache.zookeeper.common.AtomicFileWritingIdiom v;
java.lang.String v, v;
boolean v, v;
v := @this: org.apache.zookeeper.common.AtomicFileWritingIdiomTest;
v := @parameter: java.io.File;
v = new java.io.File;
specialinvoke v.<java.io.File: void <init>(java.io.File,java.lang.String)>(v, "target.txt");
v = new java.io.File;
specialinvoke v.<java.io.File: void <init>(java.io.File,java.lang.String)>(v, "target.txt.tmp");
specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest: void createFile(java.io.File,java.lang.String)>(v, "before");
v = specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest: java.lang.String getContent(java.io.File)>(v);
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(java.lang.Object,java.lang.Object)>("before", v);
v = 0;
label:
v = new org.apache.zookeeper.common.AtomicFileWritingIdiom;
v = new org.apache.zookeeper.common.AtomicFileWritingIdiomTest$3;
specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest$3: void <init>(org.apache.zookeeper.common.AtomicFileWritingIdiomTest,java.io.File)>(v, v);
specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiom: void <init>(java.io.File,org.apache.zookeeper.common.AtomicFileWritingIdiom$OutputStreamStatement)>(v, v);
label:
goto label;
label:
v := @caughtexception;
v = 1;
label:
v = virtualinvoke v.<java.io.File: boolean exists()>();
staticinvoke <org.junit.jupiter.api.Assertions: void assertFalse(boolean,java.lang.String)>(v, "tmp file should have been deleted");
staticinvoke <org.junit.jupiter.api.Assertions: void assertTrue(boolean,java.lang.String)>(v, "should have raised an exception");
v = specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest: java.lang.String getContent(java.io.File)>(v);
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(java.lang.Object,java.lang.Object)>("before", v);
return;
catch java.lang.RuntimeException from label to label with label;
}
public void testWriterFailure(java.io.File) throws java.io.IOException
{
org.apache.zookeeper.common.AtomicFileWritingIdiomTest v;
java.lang.RuntimeException v;
java.io.File v, v, v;
org.apache.zookeeper.common.AtomicFileWritingIdiomTest$4 v;
org.apache.zookeeper.common.AtomicFileWritingIdiom v;
java.lang.String v, v;
boolean v, v;
v := @this: org.apache.zookeeper.common.AtomicFileWritingIdiomTest;
v := @parameter: java.io.File;
v = new java.io.File;
specialinvoke v.<java.io.File: void <init>(java.io.File,java.lang.String)>(v, "target.txt");
v = new java.io.File;
specialinvoke v.<java.io.File: void <init>(java.io.File,java.lang.String)>(v, "target.txt.tmp");
specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest: void createFile(java.io.File,java.lang.String)>(v, "before");
v = specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest: java.lang.String getContent(java.io.File)>(v);
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(java.lang.Object,java.lang.Object)>("before", v);
v = 0;
label:
v = new org.apache.zookeeper.common.AtomicFileWritingIdiom;
v = new org.apache.zookeeper.common.AtomicFileWritingIdiomTest$4;
specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest$4: void <init>(org.apache.zookeeper.common.AtomicFileWritingIdiomTest,java.io.File)>(v, v);
specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiom: void <init>(java.io.File,org.apache.zookeeper.common.AtomicFileWritingIdiom$WriterStatement)>(v, v);
label:
goto label;
label:
v := @caughtexception;
v = 1;
label:
v = virtualinvoke v.<java.io.File: boolean exists()>();
staticinvoke <org.junit.jupiter.api.Assertions: void assertFalse(boolean,java.lang.String)>(v, "tmp file should have been deleted");
staticinvoke <org.junit.jupiter.api.Assertions: void assertTrue(boolean,java.lang.String)>(v, "should have raised an exception");
v = specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest: java.lang.String getContent(java.io.File)>(v);
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(java.lang.Object,java.lang.Object)>("before", v);
return;
catch java.lang.RuntimeException from label to label with label;
}
public void testOutputStreamFailureIOException(java.io.File) throws java.io.IOException
{
org.apache.zookeeper.common.AtomicFileWritingIdiomTest v;
java.io.IOException v;
java.io.File v, v, v;
org.apache.zookeeper.common.AtomicFileWritingIdiomTest$5 v;
org.apache.zookeeper.common.AtomicFileWritingIdiom v;
java.lang.String v, v;
boolean v, v;
v := @this: org.apache.zookeeper.common.AtomicFileWritingIdiomTest;
v := @parameter: java.io.File;
v = new java.io.File;
specialinvoke v.<java.io.File: void <init>(java.io.File,java.lang.String)>(v, "target.txt");
v = new java.io.File;
specialinvoke v.<java.io.File: void <init>(java.io.File,java.lang.String)>(v, "target.txt.tmp");
specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest: void createFile(java.io.File,java.lang.String)>(v, "before");
v = specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest: java.lang.String getContent(java.io.File)>(v);
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(java.lang.Object,java.lang.Object)>("before", v);
v = 0;
label:
v = new org.apache.zookeeper.common.AtomicFileWritingIdiom;
v = new org.apache.zookeeper.common.AtomicFileWritingIdiomTest$5;
specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest$5: void <init>(org.apache.zookeeper.common.AtomicFileWritingIdiomTest,java.io.File)>(v, v);
specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiom: void <init>(java.io.File,org.apache.zookeeper.common.AtomicFileWritingIdiom$OutputStreamStatement)>(v, v);
label:
goto label;
label:
v := @caughtexception;
v = 1;
label:
v = virtualinvoke v.<java.io.File: boolean exists()>();
staticinvoke <org.junit.jupiter.api.Assertions: void assertFalse(boolean,java.lang.String)>(v, "tmp file should have been deleted");
staticinvoke <org.junit.jupiter.api.Assertions: void assertTrue(boolean,java.lang.String)>(v, "should have raised an exception");
v = specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest: java.lang.String getContent(java.io.File)>(v);
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(java.lang.Object,java.lang.Object)>("before", v);
return;
catch java.io.IOException from label to label with label;
}
public void testWriterFailureIOException(java.io.File) throws java.io.IOException
{
org.apache.zookeeper.common.AtomicFileWritingIdiomTest v;
java.io.IOException v;
java.io.File v, v, v;
org.apache.zookeeper.common.AtomicFileWritingIdiomTest$6 v;
org.apache.zookeeper.common.AtomicFileWritingIdiom v;
java.lang.String v, v;
boolean v, v;
v := @this: org.apache.zookeeper.common.AtomicFileWritingIdiomTest;
v := @parameter: java.io.File;
v = new java.io.File;
specialinvoke v.<java.io.File: void <init>(java.io.File,java.lang.String)>(v, "target.txt");
v = new java.io.File;
specialinvoke v.<java.io.File: void <init>(java.io.File,java.lang.String)>(v, "target.txt.tmp");
specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest: void createFile(java.io.File,java.lang.String)>(v, "before");
v = specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest: java.lang.String getContent(java.io.File)>(v);
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(java.lang.Object,java.lang.Object)>("before", v);
v = 0;
label:
v = new org.apache.zookeeper.common.AtomicFileWritingIdiom;
v = new org.apache.zookeeper.common.AtomicFileWritingIdiomTest$6;
specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest$6: void <init>(org.apache.zookeeper.common.AtomicFileWritingIdiomTest,java.io.File)>(v, v);
specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiom: void <init>(java.io.File,org.apache.zookeeper.common.AtomicFileWritingIdiom$WriterStatement)>(v, v);
label:
goto label;
label:
v := @caughtexception;
v = 1;
label:
v = virtualinvoke v.<java.io.File: boolean exists()>();
staticinvoke <org.junit.jupiter.api.Assertions: void assertFalse(boolean,java.lang.String)>(v, "tmp file should have been deleted");
staticinvoke <org.junit.jupiter.api.Assertions: void assertTrue(boolean,java.lang.String)>(v, "should have raised an exception");
v = specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest: java.lang.String getContent(java.io.File)>(v);
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(java.lang.Object,java.lang.Object)>("before", v);
return;
catch java.io.IOException from label to label with label;
}
public void testOutputStreamFailureError(java.io.File) throws java.io.IOException
{
org.apache.zookeeper.common.AtomicFileWritingIdiomTest v;
java.lang.Error v;
java.io.File v, v, v;
org.apache.zookeeper.common.AtomicFileWritingIdiomTest$7 v;
org.apache.zookeeper.common.AtomicFileWritingIdiom v;
java.lang.String v, v;
boolean v, v;
v := @this: org.apache.zookeeper.common.AtomicFileWritingIdiomTest;
v := @parameter: java.io.File;
v = new java.io.File;
specialinvoke v.<java.io.File: void <init>(java.io.File,java.lang.String)>(v, "target.txt");
v = new java.io.File;
specialinvoke v.<java.io.File: void <init>(java.io.File,java.lang.String)>(v, "target.txt.tmp");
specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest: void createFile(java.io.File,java.lang.String)>(v, "before");
v = specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest: java.lang.String getContent(java.io.File)>(v);
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(java.lang.Object,java.lang.Object)>("before", v);
v = 0;
label:
v = new org.apache.zookeeper.common.AtomicFileWritingIdiom;
v = new org.apache.zookeeper.common.AtomicFileWritingIdiomTest$7;
specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest$7: void <init>(org.apache.zookeeper.common.AtomicFileWritingIdiomTest,java.io.File)>(v, v);
specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiom: void <init>(java.io.File,org.apache.zookeeper.common.AtomicFileWritingIdiom$OutputStreamStatement)>(v, v);
label:
goto label;
label:
v := @caughtexception;
v = 1;
label:
v = virtualinvoke v.<java.io.File: boolean exists()>();
staticinvoke <org.junit.jupiter.api.Assertions: void assertFalse(boolean,java.lang.String)>(v, "tmp file should have been deleted");
staticinvoke <org.junit.jupiter.api.Assertions: void assertTrue(boolean,java.lang.String)>(v, "should have raised an exception");
v = specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest: java.lang.String getContent(java.io.File)>(v);
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(java.lang.Object,java.lang.Object)>("before", v);
return;
catch java.lang.Error from label to label with label;
}
public void testWriterFailureError(java.io.File) throws java.io.IOException
{
org.apache.zookeeper.common.AtomicFileWritingIdiomTest v;
java.lang.Error v;
java.io.File v, v, v;
org.apache.zookeeper.common.AtomicFileWritingIdiom v;
java.lang.String v, v;
org.apache.zookeeper.common.AtomicFileWritingIdiomTest$8 v;
boolean v, v;
v := @this: org.apache.zookeeper.common.AtomicFileWritingIdiomTest;
v := @parameter: java.io.File;
v = new java.io.File;
specialinvoke v.<java.io.File: void <init>(java.io.File,java.lang.String)>(v, "target.txt");
v = new java.io.File;
specialinvoke v.<java.io.File: void <init>(java.io.File,java.lang.String)>(v, "target.txt.tmp");
specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest: void createFile(java.io.File,java.lang.String)>(v, "before");
v = specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest: java.lang.String getContent(java.io.File)>(v);
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(java.lang.Object,java.lang.Object)>("before", v);
v = 0;
label:
v = new org.apache.zookeeper.common.AtomicFileWritingIdiom;
v = new org.apache.zookeeper.common.AtomicFileWritingIdiomTest$8;
specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest$8: void <init>(org.apache.zookeeper.common.AtomicFileWritingIdiomTest,java.io.File)>(v, v);
specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiom: void <init>(java.io.File,org.apache.zookeeper.common.AtomicFileWritingIdiom$WriterStatement)>(v, v);
label:
goto label;
label:
v := @caughtexception;
v = 1;
label:
v = virtualinvoke v.<java.io.File: boolean exists()>();
staticinvoke <org.junit.jupiter.api.Assertions: void assertFalse(boolean,java.lang.String)>(v, "tmp file should have been deleted");
staticinvoke <org.junit.jupiter.api.Assertions: void assertTrue(boolean,java.lang.String)>(v, "should have raised an exception");
v = specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest: java.lang.String getContent(java.io.File)>(v);
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(java.lang.Object,java.lang.Object)>("before", v);
return;
catch java.lang.Error from label to label with label;
}
public void testOutputStreamSuccessNE(java.io.File) throws java.io.IOException
{
org.apache.zookeeper.common.AtomicFileWritingIdiomTest v;
java.io.File v, v, v;
org.apache.zookeeper.common.AtomicFileWritingIdiom v;
java.lang.String v;
org.apache.zookeeper.common.AtomicFileWritingIdiomTest$9 v;
boolean v;
v := @this: org.apache.zookeeper.common.AtomicFileWritingIdiomTest;
v := @parameter: java.io.File;
v = new java.io.File;
specialinvoke v.<java.io.File: void <init>(java.io.File,java.lang.String)>(v, "target.txt");
v = new java.io.File;
specialinvoke v.<java.io.File: void <init>(java.io.File,java.lang.String)>(v, "target.txt.tmp");
virtualinvoke v.<java.io.File: boolean delete()>();
v = virtualinvoke v.<java.io.File: boolean exists()>();
staticinvoke <org.junit.jupiter.api.Assertions: void assertFalse(boolean,java.lang.String)>(v, "file should not exist");
v = new org.apache.zookeeper.common.AtomicFileWritingIdiom;
v = new org.apache.zookeeper.common.AtomicFileWritingIdiomTest$9;
specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest$9: void <init>(org.apache.zookeeper.common.AtomicFileWritingIdiomTest,java.io.File)>(v, v);
specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiom: void <init>(java.io.File,org.apache.zookeeper.common.AtomicFileWritingIdiom$OutputStreamStatement)>(v, v);
v = specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest: java.lang.String getContent(java.io.File)>(v);
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(java.lang.Object,java.lang.Object)>("after", v);
return;
}
public void testWriterSuccessNE(java.io.File) throws java.io.IOException
{
org.apache.zookeeper.common.AtomicFileWritingIdiomTest v;
java.io.File v, v, v;
org.apache.zookeeper.common.AtomicFileWritingIdiomTest$10 v;
org.apache.zookeeper.common.AtomicFileWritingIdiom v;
java.lang.String v;
boolean v, v;
v := @this: org.apache.zookeeper.common.AtomicFileWritingIdiomTest;
v := @parameter: java.io.File;
v = new java.io.File;
specialinvoke v.<java.io.File: void <init>(java.io.File,java.lang.String)>(v, "target.txt");
v = new java.io.File;
specialinvoke v.<java.io.File: void <init>(java.io.File,java.lang.String)>(v, "target.txt.tmp");
virtualinvoke v.<java.io.File: boolean delete()>();
v = virtualinvoke v.<java.io.File: boolean exists()>();
staticinvoke <org.junit.jupiter.api.Assertions: void assertFalse(boolean,java.lang.String)>(v, "file should not exist");
v = new org.apache.zookeeper.common.AtomicFileWritingIdiom;
v = new org.apache.zookeeper.common.AtomicFileWritingIdiomTest$10;
specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest$10: void <init>(org.apache.zookeeper.common.AtomicFileWritingIdiomTest,java.io.File)>(v, v);
specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiom: void <init>(java.io.File,org.apache.zookeeper.common.AtomicFileWritingIdiom$WriterStatement)>(v, v);
v = virtualinvoke v.<java.io.File: boolean exists()>();
staticinvoke <org.junit.jupiter.api.Assertions: void assertFalse(boolean,java.lang.String)>(v, "tmp file should have been deleted");
v = specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest: java.lang.String getContent(java.io.File)>(v);
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(java.lang.Object,java.lang.Object)>("after", v);
return;
}
public void testOutputStreamFailureNE(java.io.File) throws java.io.IOException
{
org.apache.zookeeper.common.AtomicFileWritingIdiomTest v;
java.lang.RuntimeException v;
org.apache.zookeeper.common.AtomicFileWritingIdiomTest$11 v;
java.io.File v, v, v;
org.apache.zookeeper.common.AtomicFileWritingIdiom v;
boolean v, v, v, v;
v := @this: org.apache.zookeeper.common.AtomicFileWritingIdiomTest;
v := @parameter: java.io.File;
v = new java.io.File;
specialinvoke v.<java.io.File: void <init>(java.io.File,java.lang.String)>(v, "target.txt");
v = new java.io.File;
specialinvoke v.<java.io.File: void <init>(java.io.File,java.lang.String)>(v, "target.txt.tmp");
virtualinvoke v.<java.io.File: boolean delete()>();
v = virtualinvoke v.<java.io.File: boolean exists()>();
staticinvoke <org.junit.jupiter.api.Assertions: void assertFalse(boolean,java.lang.String)>(v, "file should not exist");
v = 0;
label:
v = new org.apache.zookeeper.common.AtomicFileWritingIdiom;
v = new org.apache.zookeeper.common.AtomicFileWritingIdiomTest$11;
specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest$11: void <init>(org.apache.zookeeper.common.AtomicFileWritingIdiomTest,java.io.File)>(v, v);
specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiom: void <init>(java.io.File,org.apache.zookeeper.common.AtomicFileWritingIdiom$OutputStreamStatement)>(v, v);
label:
goto label;
label:
v := @caughtexception;
v = 1;
label:
v = virtualinvoke v.<java.io.File: boolean exists()>();
staticinvoke <org.junit.jupiter.api.Assertions: void assertFalse(boolean,java.lang.String)>(v, "tmp file should have been deleted");
staticinvoke <org.junit.jupiter.api.Assertions: void assertTrue(boolean,java.lang.String)>(v, "should have raised an exception");
v = virtualinvoke v.<java.io.File: boolean exists()>();
staticinvoke <org.junit.jupiter.api.Assertions: void assertFalse(boolean,java.lang.String)>(v, "file should not exist");
return;
catch java.lang.RuntimeException from label to label with label;
}
public void testWriterFailureNE(java.io.File) throws java.io.IOException
{
org.apache.zookeeper.common.AtomicFileWritingIdiomTest v;
org.apache.zookeeper.common.AtomicFileWritingIdiomTest$12 v;
java.lang.RuntimeException v;
java.io.File v, v, v;
org.apache.zookeeper.common.AtomicFileWritingIdiom v;
boolean v, v, v, v;
v := @this: org.apache.zookeeper.common.AtomicFileWritingIdiomTest;
v := @parameter: java.io.File;
v = new java.io.File;
specialinvoke v.<java.io.File: void <init>(java.io.File,java.lang.String)>(v, "target.txt");
v = new java.io.File;
specialinvoke v.<java.io.File: void <init>(java.io.File,java.lang.String)>(v, "target.txt.tmp");
virtualinvoke v.<java.io.File: boolean delete()>();
v = virtualinvoke v.<java.io.File: boolean exists()>();
staticinvoke <org.junit.jupiter.api.Assertions: void assertFalse(boolean,java.lang.String)>(v, "file should not exist");
v = 0;
label:
v = new org.apache.zookeeper.common.AtomicFileWritingIdiom;
v = new org.apache.zookeeper.common.AtomicFileWritingIdiomTest$12;
specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest$12: void <init>(org.apache.zookeeper.common.AtomicFileWritingIdiomTest,java.io.File)>(v, v);
specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiom: void <init>(java.io.File,org.apache.zookeeper.common.AtomicFileWritingIdiom$WriterStatement)>(v, v);
label:
goto label;
label:
v := @caughtexception;
v = 1;
label:
v = virtualinvoke v.<java.io.File: boolean exists()>();
staticinvoke <org.junit.jupiter.api.Assertions: void assertFalse(boolean,java.lang.String)>(v, "tmp file should have been deleted");
staticinvoke <org.junit.jupiter.api.Assertions: void assertTrue(boolean,java.lang.String)>(v, "should have raised an exception");
v = virtualinvoke v.<java.io.File: boolean exists()>();
staticinvoke <org.junit.jupiter.api.Assertions: void assertFalse(boolean,java.lang.String)>(v, "file should not exist");
return;
catch java.lang.RuntimeException from label to label with label;
}
private java.lang.String getContent(java.io.File, java.nio.charset.Charset) throws java.io.IOException
{
byte[] v;
org.apache.zookeeper.common.AtomicFileWritingIdiomTest v;
java.io.FileInputStream v;
java.io.File v;
java.nio.charset.Charset v;
int v, v;
java.lang.StringBuilder v;
java.lang.String v, v;
v := @this: org.apache.zookeeper.common.AtomicFileWritingIdiomTest;
v := @parameter: java.io.File;
v := @parameter: java.nio.charset.Charset;
v = new java.lang.StringBuilder;
specialinvoke v.<java.lang.StringBuilder: void <init>()>();
v = new java.io.FileInputStream;
specialinvoke v.<java.io.FileInputStream: void <init>(java.io.File)>(v);
v = newarray (byte)[20];
label:
v = virtualinvoke v.<java.io.FileInputStream: int read(byte[])>(v);
v = (int) -1;
if v == v goto label;
v = new java.lang.String;
specialinvoke v.<java.lang.String: void <init>(byte[],int,int,java.nio.charset.Charset)>(v, 0, v, v);
virtualinvoke v.<java.lang.StringBuilder: java.lang.StringBuilder append(java.lang.String)>(v);
goto label;
label:
virtualinvoke v.<java.io.FileInputStream: void close()>();
v = virtualinvoke v.<java.lang.StringBuilder: java.lang.String toString()>();
return v;
}
private java.lang.String getContent(java.io.File) throws java.io.IOException
{
java.nio.charset.Charset v;
org.apache.zookeeper.common.AtomicFileWritingIdiomTest v;
java.lang.String v;
java.io.File v;
v := @this: org.apache.zookeeper.common.AtomicFileWritingIdiomTest;
v := @parameter: java.io.File;
v = <java.nio.charset.StandardCharsets: java.nio.charset.Charset US_ASCII>;
v = specialinvoke v.<org.apache.zookeeper.common.AtomicFileWritingIdiomTest: java.lang.String getContent(java.io.File,java.nio.charset.Charset)>(v, v);
return v;
}
private void createFile(java.io.File, java.lang.String) throws java.io.IOException
{
byte[] v;
java.nio.charset.Charset v;
org.apache.zookeeper.common.AtomicFileWritingIdiomTest v;
java.io.FileOutputStream v;
java.lang.String v;
java.io.File v;
v := @this: org.apache.zookeeper.common.AtomicFileWritingIdiomTest;
v := @parameter: java.io.File;
v := @parameter: java.lang.String;
v = new java.io.FileOutputStream;
specialinvoke v.<java.io.FileOutputStream: void <init>(java.io.File)>(v);
v = <java.nio.charset.StandardCharsets: java.nio.charset.Charset US_ASCII>;
v = virtualinvoke v.<java.lang.String: byte[] getBytes(java.nio.charset.Charset)>(v);
virtualinvoke v.<java.io.FileOutputStream: void write(byte[])>(v);
virtualinvoke v.<java.io.FileOutputStream: void close()>();
return;
}
}