Revision 2381 org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.lib/org.gvsig.vcsgis.lib.impl/src/test/java/org/gvsig/cvsgis/lib/impl/TestCheckout.java
TestCheckout.java | ||
---|---|---|
1 |
package org.gvsig.cvsgis.lib.impl;
|
|
1 |
package org.gvsig.vcsgis.lib.impl;
|
|
2 | 2 |
|
3 | 3 |
import java.io.File; |
4 | 4 |
import junit.framework.TestCase; |
5 | 5 |
import static junit.framework.TestCase.assertEquals; |
6 | 6 |
import org.apache.commons.io.FileUtils; |
7 |
import static org.gvsig.cvsgis.lib.CvsGisManager.DEFAULT_BRANCH_NAME;
|
|
8 |
import org.gvsig.cvsgis.lib.cvsgis;
|
|
7 |
import static org.gvsig.vcsgis.lib.VCSGisManager.DEFAULT_BRANCH_NAME;
|
|
8 |
import org.gvsig.vcsgis.lib.vcsgis;
|
|
9 | 9 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
10 | 10 |
import org.gvsig.fmap.dal.store.jdbc2.JDBCServerExplorer; |
11 | 11 |
import org.gvsig.tools.library.impl.DefaultLibrariesInitializer; |
12 | 12 |
import org.slf4j.Logger; |
13 | 13 |
import org.slf4j.LoggerFactory; |
14 |
import org.gvsig.cvsgis.lib.cvsgisadmin;
|
|
15 |
import org.gvsig.cvsgis.lib.CvsGisRepository;
|
|
16 |
import org.gvsig.cvsgis.lib.CvsGisWorkspace;
|
|
14 |
import org.gvsig.vcsgis.lib.vcsgisadmin;
|
|
15 |
import org.gvsig.vcsgis.lib.VCSGisRepository;
|
|
16 |
import org.gvsig.vcsgis.lib.VCSGisWorkspace;
|
|
17 | 17 |
import org.gvsig.tools.dispose.DisposeUtils; |
18 | 18 |
|
19 | 19 |
public class TestCheckout extends TestCase { |
... | ... | |
45 | 45 |
File ws1file = TestUtils.getFile(FileUtils.getFile("test-dbs","ws-addco1")); |
46 | 46 |
File ws2file = TestUtils.getFile(FileUtils.getFile("test-dbs","ws-addco2")); |
47 | 47 |
|
48 |
int r = cvsgisadmin.init(server);
|
|
49 |
assertEquals("cvsgisadmin.init status", 0, r);
|
|
48 |
int r = vcsgisadmin.init(server);
|
|
49 |
assertEquals("vcsgisadmin.init status", 0, r);
|
|
50 | 50 |
|
51 |
CvsGisRepository repo = cvsgisadmin.open_repository(server);
|
|
51 |
VCSGisRepository repo = vcsgisadmin.open_repository(server);
|
|
52 | 52 |
TestUtils.h2sql_repository(repo); |
53 | 53 |
|
54 |
r = cvsgis.init_workspace(ws1file, repo, "Test checkout1");
|
|
55 |
assertEquals("cvsgis.init_workspace1 status", 0, r);
|
|
54 |
r = vcsgis.init_workspace(ws1file, repo, "Test checkout1");
|
|
55 |
assertEquals("vcsgis.init_workspace1 status", 0, r);
|
|
56 | 56 |
|
57 |
CvsGisWorkspace ws1 = cvsgis.open_workspace(ws1file);
|
|
58 |
assertNotNull("cvsgis.open_workspace1 status", ws1);
|
|
57 |
VCSGisWorkspace ws1 = vcsgis.open_workspace(ws1file);
|
|
58 |
assertNotNull("vcsgis.open_workspace1 status", ws1);
|
|
59 | 59 |
TestUtils.h2sql_workspace(ws1); |
60 | 60 |
|
61 | 61 |
FeatureStore store1 = TestUtils.openSourceStore1(); |
... | ... | |
64 | 64 |
ws1.commit(); |
65 | 65 |
assertEquals("ws1.commit status", 0, r); |
66 | 66 |
|
67 |
r = cvsgis.init_workspace(ws2file, repo, "Test checkout2");
|
|
68 |
assertEquals("cvsgis.init_workspace2 status", 0, r);
|
|
69 |
CvsGisWorkspace ws2 = cvsgis.open_workspace(ws2file);
|
|
70 |
assertNotNull("cvsgis.open_workspace2 status", ws2);
|
|
67 |
r = vcsgis.init_workspace(ws2file, repo, "Test checkout2");
|
|
68 |
assertEquals("vcsgis.init_workspace2 status", 0, r);
|
|
69 |
VCSGisWorkspace ws2 = vcsgis.open_workspace(ws2file);
|
|
70 |
assertNotNull("vcsgis.open_workspace2 status", ws2);
|
|
71 | 71 |
TestUtils.h2sql_workspace(ws2); |
72 | 72 |
|
73 | 73 |
r = ws2.checkout("sourceStore1", DEFAULT_BRANCH_NAME); |
Also available in: Unified diff