package com.perforce.cvs.unit.parser; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import java.io.File; import java.nio.file.Files; import org.junit.After; import org.junit.Before; import org.junit.Test; import com.perforce.common.asset.AssetWriter; import com.perforce.integration.SystemCaller; public class TestSymlink { @Before @After public void cleanup() throws Exception { String tmp = "rm" + " -rf tmp"; SystemCaller.exec(tmp, true, false); } @Test public void createDirOverLink() throws Exception { File base = new File("tmp"); assertFalse(base.exists()); base.mkdir(); assertTrue(base.exists()); File link = new File(base, "link"); File target = new File(base, "null"); Files.createSymbolicLink(link.toPath(), target.toPath()); assertFalse(link.exists()); String path = "tmp/link/dir1/dir2/"; File directory = new File(path); assertFalse(directory.exists()); AssetWriter writer = new AssetWriter(path + "foo.c"); writer.open(); assertTrue(directory.exists()); } @Test public void createDirOverFile() throws Exception { File base = new File("tmp"); assertFalse(base.exists()); base.mkdir(); assertTrue(base.exists()); File file = new File(base, "file"); file.createNewFile(); assertTrue(file.exists()); String path = "tmp/file/dir1/dir2/"; File directory = new File(path); assertFalse(directory.exists()); AssetWriter writer = new AssetWriter(path + "foo.c"); writer.open(); assertTrue(directory.exists()); } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 26953 | Paul Allen | Move //guest/perforce_software/p4convert to //guest/perforce_software/p4convert/main | ||
//guest/perforce_software/p4convert/src/test/java/com/perforce/cvs/unit/parser/TestSymlink.java | |||||
#4 | 14805 | Paul Allen |
Fix for missing 2.0 revision labels. - Test case 067 and minor update to Simlink test #review-14790 @russell_jackson ISSUE: The RCS only has a 1.1 branched to 2.0 and labels are missing on 2.0? http://users.csc.calpoly.edu/~jdalbey/205/Resources/cvsBranchMerge.html +---------+ Release-1 -> __! 1.2.2.1 !____ <- the maintenance branch / +---------+ \ / \ / \ +-----+/ +-----+ +-----+ \+-----+ ! 1.0 !---! 1.1 !----! 1.2 !----! 2.0 ! <- The main trunk +-----+ +-----+ +-----+ +-----+ |
||
#3 | 13958 | Paul Allen |
Login check to avoid 'nouser' trying to create an account. - minor fix to Symlink unit test |
||
#2 | 13927 | Paul Allen | Update MarkDown README for gradle build steps | ||
#1 | 13920 | Paul Allen | copy part 2 (no errors) | ||
//guest/paul_allen/p4convert-maven/src/test/java/com/perforce/cvs/unit/parser/TestSymlink.java | |||||
#1 | 13878 | Paul Allen | Move test/ to src/test/java | ||
//guest/paul_allen/p4convert-maven/test/com/perforce/cvs/unit/parser/TestSymlink.java | |||||
#1 | 13873 | Paul Allen | Branching using p4convert-maven | ||
//guest/perforce_software/p4convert/test/com/perforce/cvs/unit/parser/TestSymlink.java | |||||
#1 | 12551 | Paul Allen |
Import mode workspace path fix code and logging. The issues only seems to occure when the configuration option com.p4convert.svn.mergeInfoEnabled is true. The merge seems to create a symlink or label then merge a directory over the top. |