@Test public void testWithTemporalDirectory$maintainsOverride() { File directory=new File(System.getProperty("java.io.tmpdir")); String ctxConfigProperty = Deployment.contextTemporalDirectoryProperty("context"); System.setProperty(ctxConfigProperty,"ctx_dir"); System.setProperty(Deployment.APPLICATION_ENGINE_TMPDIR,"engine_dir"); try { assertThat(Deployment.newInstance().withTemporalDirectory(directory).temporalDirectory(),equalTo(directory)); } finally { System.clearProperty(ctxConfigProperty); System.clearProperty(Deployment.APPLICATION_ENGINE_TMPDIR); } }
Deployment withTemporalDirectory(File temporalDirectory) { checkNotNull(temporalDirectory,"Temporal directory cannot be null"); checkArgument(temporalDirectory.isDirectory(),"Path %s cannot be used as a temporal directory (it is not a directory)",temporalDirectory.getAbsolutePath()); checkArgument(temporalDirectory.canWrite(),"Path %s cannot be used as a temporal directory (cannot be written)",temporalDirectory.getAbsolutePath()); this.temporalDirectory=temporalDirectory; return this; }
Deployment { Deployment withTemporalDirectory(File temporalDirectory) { checkNotNull(temporalDirectory,"Temporal directory cannot be null"); checkArgument(temporalDirectory.isDirectory(),"Path %s cannot be used as a temporal directory (it is not a directory)",temporalDirectory.getAbsolutePath()); checkArgument(temporalDirectory.canWrite(),"Path %s cannot be used as a temporal directory (cannot be written)",temporalDirectory.getAbsolutePath()); this.temporalDirectory=temporalDirectory; return this; } }
Deployment { Deployment withTemporalDirectory(File temporalDirectory) { checkNotNull(temporalDirectory,"Temporal directory cannot be null"); checkArgument(temporalDirectory.isDirectory(),"Path %s cannot be used as a temporal directory (it is not a directory)",temporalDirectory.getAbsolutePath()); checkArgument(temporalDirectory.canWrite(),"Path %s cannot be used as a temporal directory (cannot be written)",temporalDirectory.getAbsolutePath()); this.temporalDirectory=temporalDirectory; return this; } private  Deployment(String contextPath, File temporalDirectory); }
Deployment { Deployment withTemporalDirectory(File temporalDirectory) { checkNotNull(temporalDirectory,"Temporal directory cannot be null"); checkArgument(temporalDirectory.isDirectory(),"Path %s cannot be used as a temporal directory (it is not a directory)",temporalDirectory.getAbsolutePath()); checkArgument(temporalDirectory.canWrite(),"Path %s cannot be used as a temporal directory (cannot be written)",temporalDirectory.getAbsolutePath()); this.temporalDirectory=temporalDirectory; return this; } private  Deployment(String contextPath, File temporalDirectory);  }
Deployment { Deployment withTemporalDirectory(File temporalDirectory) { checkNotNull(temporalDirectory,"Temporal directory cannot be null"); checkArgument(temporalDirectory.isDirectory(),"Path %s cannot be used as a temporal directory (it is not a directory)",temporalDirectory.getAbsolutePath()); checkArgument(temporalDirectory.canWrite(),"Path %s cannot be used as a temporal directory (cannot be written)",temporalDirectory.getAbsolutePath()); this.temporalDirectory=temporalDirectory; return this; } private  Deployment(String contextPath, File temporalDirectory);   }