/** * Create the working copy for the beginning of the test. * Assumes that {@link #testName} has been set. * * @param repos the repository directory * @return the directory of the working copy * @throws Exception */ protected File createInitialWorkingCopy(File repos) throws SubversionException, IOException { // build a clean working directory String uri = makeReposUrl(repos); workingCopy = new File(workingCopies, this.testName); removeDirOrFile(workingCopy); // checkout the repository client.checkout(uri, workingCopy.getAbsolutePath(), null, true); // sanity check the working with its expected status checkStatus(); return workingCopy; }
/** * Create the working copy for the beginning of the test. * Assumes that {@link #testName} has been set. * * @param repos the repository directory * @return the directory of the working copy * @throws Exception */ protected File createInitialWorkingCopy(File repos) throws SubversionException, IOException { // build a clean working directory String uri = makeReposUrl(repos); workingCopy = new File(workingCopies, this.testName); removeDirOrFile(workingCopy); // checkout the repository client.checkout(uri, workingCopy.getAbsolutePath(), null, true); // sanity check the working with its expected status checkStatus(); return workingCopy; }
thisTest.checkStatus(); thisTest.checkStatus();
client.commit(new String[] { thisTest.getWCPath() }, "Move files", true), 2); thisTest.checkStatus();
thisTest.checkStatus(); thisTest.checkStatus();
client.commit(new String[] { thisTest.getWCPath() }, "Move files", true), 2); thisTest.checkStatus();
thisTest.checkStatus(); thisTest.checkStatus();
thisTest.checkStatus(); thisTest.checkStatus();
/** * Test basic SVNClient.mkdir with URL parameter functionality. * @throws Throwable */ public void testBasicMkdirUrl() throws Throwable { // build the test setup. OneTest thisTest = new OneTest(); // create Y and Y/Z directories in the repository addExpectedCommitItem(null, thisTest.getUrl(), "Y", NodeKind.none, CommitItemStateFlags.Add); addExpectedCommitItem(null, thisTest.getUrl(), "Y/Z", NodeKind.none, CommitItemStateFlags.Add); client.mkdir(new String[]{thisTest.getUrl() + "/Y", thisTest.getUrl() + "/Y/Z"}, "log_msg"); // add the new directories the expected working copy layout thisTest.getWc().addItem("Y", null); thisTest.getWc().setItemWorkingCopyRevision("Y", 2); thisTest.getWc().addItem("Y/Z", null); thisTest.getWc().setItemWorkingCopyRevision("Y/Z", 2); // update the working copy assertEquals("wrong revision from update", client.update(thisTest.getWCPath(), null, true), 2); // check the status of the working copy thisTest.checkStatus(); }
/** * Test the basis SVNClient.add functionality with files that * should be ignored. * @throws Throwable */ public void testBasicAddIgnores() throws Throwable { // create working copy OneTest thisTest = new OneTest(); // create dir File dir = new File(thisTest.getWorkingCopy(), "dir"); dir.mkdir(); // create dir/foo.c File fileC = new File(dir, "foo.c"); new FileOutputStream(fileC).close(); // create dir/foo.o (should be ignored) File fileO = new File(dir, "foo.o"); new FileOutputStream(fileO).close(); // add dir client.add(dir.getAbsolutePath(), true); thisTest.getWc().addItem("dir", null); thisTest.getWc().setItemTextStatus("dir",Status.Kind.added); thisTest.getWc().addItem("dir/foo.c", ""); thisTest.getWc().setItemTextStatus("dir/foo.c",Status.Kind.added); thisTest.getWc().addItem("dir/foo.o", ""); thisTest.getWc().setItemTextStatus("dir/foo.o",Status.Kind.ignored); thisTest.getWc().setItemNodeKind("dir/foo.o", NodeKind.unknown); // test the working copy status thisTest.checkStatus(); }
/** * Test the basis SVNClient.add functionality with files that * should be ignored. * @throws Throwable */ public void testBasicAddIgnores() throws Throwable { // create working copy OneTest thisTest = new OneTest(); // create dir File dir = new File(thisTest.getWorkingCopy(), "dir"); dir.mkdir(); // create dir/foo.c File fileC = new File(dir, "foo.c"); new FileOutputStream(fileC).close(); // create dir/foo.o (should be ignored) File fileO = new File(dir, "foo.o"); new FileOutputStream(fileO).close(); // add dir client.add(dir.getAbsolutePath(), true); thisTest.getWc().addItem("dir", null); thisTest.getWc().setItemTextStatus("dir",Status.Kind.added); thisTest.getWc().addItem("dir/foo.c", ""); thisTest.getWc().setItemTextStatus("dir/foo.c",Status.Kind.added); thisTest.getWc().addItem("dir/foo.o", ""); thisTest.getWc().setItemTextStatus("dir/foo.o",Status.Kind.ignored); thisTest.getWc().setItemNodeKind("dir/foo.o", NodeKind.unknown); // test the working copy status thisTest.checkStatus(); }
/** * Test basic SVNClient.mkdir with URL parameter functionality. * @throws Throwable */ public void testBasicMkdirUrl() throws Throwable { // build the test setup. OneTest thisTest = new OneTest(); // create Y and Y/Z directories in the repository addExpectedCommitItem(null, thisTest.getUrl(), "Y", NodeKind.none, CommitItemStateFlags.Add); addExpectedCommitItem(null, thisTest.getUrl(), "Y/Z", NodeKind.none, CommitItemStateFlags.Add); client.mkdir(new String[]{thisTest.getUrl() + "/Y", thisTest.getUrl() + "/Y/Z"}, "log_msg"); // add the new directories the expected working copy layout thisTest.getWc().addItem("Y", null); thisTest.getWc().setItemWorkingCopyRevision("Y", 2); thisTest.getWc().addItem("Y/Z", null); thisTest.getWc().setItemWorkingCopyRevision("Y/Z", 2); // update the working copy assertEquals("wrong revision from update", client.update(thisTest.getWCPath(), null, true), 2); // check the status of the working copy thisTest.checkStatus(); }
/** * Test the basic SVNClient.status functionality. * @throws Throwable */ public void testBasicStatus() throws Throwable { // build the test setup OneTest thisTest = new OneTest(); // check the status of the working copy thisTest.checkStatus(); // Test status of non-existent file File fileC = new File(thisTest.getWorkingCopy() + "/A", "foo.c"); Status s = client.singleStatus(fileToSVNPath(fileC, false), false); if (s != null) fail("File foo.c should not return a status."); }
/** * Test the basic SVNClient.status functionality. * @throws Throwable */ public void testBasicStatus() throws Throwable { // build the test setup OneTest thisTest = new OneTest(); // check the status of the working copy thisTest.checkStatus(); // Test status of non-existent file File fileC = new File(thisTest.getWorkingCopy() + "/A", "foo.c"); Status s = client.singleStatus(fileToSVNPath(fileC, false), false); if (s != null) fail("File foo.c should not return a status."); }
/** * Check if the working copy has the expected status. Does * not extract "out of date" information from the repository. * * @throws SubversionException If there's a problem getting * WC status. * @throws IOException If there's a problem comparing the * WC to the expected state. * @see #checkStatus(boolean) */ public void checkStatus() throws SubversionException, IOException { checkStatus(false); }
/** * Check if the working copy has the expected status. Does * not extract "out of date" information from the repository. * * @throws SubversionException If there's a problem getting * WC status. * @throws IOException If there's a problem comparing the * WC to the expected state. * @see #checkStatus(boolean) */ public void checkStatus() throws SubversionException, IOException { checkStatus(false); }