Author: tchemit Date: 2008-03-31 20:40:16 +0000 (Mon, 31 Mar 2008) New Revision: 247 Added: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/mock/ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/mock/MockHandlerProvider.java trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/mock/MockVCSConfig.java trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/mock/MockVCSHandler.java trunk/lutinvcs/lutinvcs-core/src/main/resources/META-INF/services/org.codelutin.vcs.VCSHandlerProvider Log: add mock vcs handler Copied: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/mock/MockHandlerProvider.java (from rev 240, trunk/lutinvcs/lutinvcs-provider-cvs/src/main/java/org/codelutin/vcs/CVSHandlerProvider.java) =================================================================== --- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/mock/MockHandlerProvider.java (rev 0) +++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/mock/MockHandlerProvider.java 2008-03-31 20:40:16 UTC (rev 247) @@ -0,0 +1,30 @@ +/** + * # #% Copyright (C) 2008 Code Lutin, Tony Chemit + * This program is free software; you + * can redistribute it and/or modify it under the terms of the GNU General + * Public License as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. This program is + * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU General Public License for more details. You + * should have received a copy of the GNU General Public License along with this + * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place + * - Suite 330, Boston, MA 02111-1307, USA. + * # #% + */ +package org.codelutin.vcs.mock; + +import org.codelutin.vcs.VCSConfig; +import org.codelutin.vcs.VCSHandlerProvider; + +/** @author chemit */ +public class MockHandlerProvider implements VCSHandlerProvider<MockVCSHandler> { + + public String getName() { + return "MOCK"; + } + + public MockVCSHandler newInstance(VCSConfig config) { + return new MockVCSHandler(config); + } +} \ No newline at end of file Added: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/mock/MockVCSConfig.java =================================================================== --- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/mock/MockVCSConfig.java (rev 0) +++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/mock/MockVCSConfig.java 2008-03-31 20:40:16 UTC (rev 247) @@ -0,0 +1,126 @@ +/** + * # #% Copyright (C) 2008 Code Lutin, Tony Chemit + * This program is free software; you + * can redistribute it and/or modify it under the terms of the GNU General + * Public License as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. This program is + * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU General Public License for more details. You + * should have received a copy of the GNU General Public License along with this + * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place + * - Suite 330, Boston, MA 02111-1307, USA. + * # #% + */ +package org.codelutin.vcs.mock; + +import org.codelutin.vcs.ConnectionState; +import org.codelutin.vcs.VCSConfig; +import org.codelutin.vcs.VCSType; +import org.codelutin.vcs.VCSTypeRepo; + +import java.io.File; +import java.net.URL; + +/** @author chemit */ +public class MockVCSConfig implements VCSConfig { + + File localRoot; + URL remoteRoot; + + boolean init; + + public boolean canConnect() { + return false; + } + + public boolean isConnected() { + return false; + } + + public ConnectionState getConnectionState() { + return null; + } + + public VCSType getType() { + return VCSType.MOCK; + } + + public boolean isUseSshConnexion() { + return false; + } + + public String getHostName() { + return null; + } + + public File getKeyFile() { + return null; + } + + public String getUserName() { + return null; + } + + public boolean isNoPassPhrase() { + return false; + } + + public String getPassphrase() { + return null; + } + + public String getRemotePath() { + return null; + } + + public String getRemoteDatabase() { + return remoteRoot.toString(); + } + + public String getRemoteDatabasePath() { + return remoteRoot.toString(); + } + + public File getLocalDatabasePath() { + return localRoot; + } + + public VCSTypeRepo getTypeRepo() { + return null; + } + + public boolean isOffline() { + return false; + } + + public boolean isReadOnly() { + return false; + } + + public boolean isInit() { + return init; + } + + public void validate() { + } + + public void setUseSshConnexion(boolean useSshConnexion) { + } + + public File getSource() { + return null; + } + + public void setLocalRoot(File localRoot) { + this.localRoot = localRoot; + } + + public void setRemoteRoot(URL remoteRoot) { + this.remoteRoot = remoteRoot; + } + + public void setInit(boolean init) { + this.init = init; + } +} Added: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/mock/MockVCSHandler.java =================================================================== --- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/mock/MockVCSHandler.java (rev 0) +++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/mock/MockVCSHandler.java 2008-03-31 20:40:16 UTC (rev 247) @@ -0,0 +1,127 @@ +/** + * # #% Copyright (C) 2008 Code Lutin, Tony Chemit + * This program is free software; you + * can redistribute it and/or modify it under the terms of the GNU General + * Public License as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. This program is + * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU General Public License for more details. You + * should have received a copy of the GNU General Public License along with this + * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place + * - Suite 330, Boston, MA 02111-1307, USA. + * # #% + */ +package org.codelutin.vcs.mock; + +import org.codelutin.vcs.AbstractVCSHandler; +import org.codelutin.vcs.VCSConfig; +import org.codelutin.vcs.VCSException; +import org.codelutin.vcs.VCSState; + +import java.io.File; +import java.io.IOException; +import java.util.Collection; +import java.util.List; + +/** @author chemit */ +public class MockVCSHandler extends AbstractVCSHandler { + + protected MockVCSHandler(VCSConfig config) { + super(config, "", ""); + } + + public void initWorkingCopy() throws VCSException { + } + + public String getRemoteUrl() { + return null; + } + + public VCSState getState(File fileState, Collection tmp) throws VCSException { + return null; + } + + public VCSState getState(File file, Collection tmp, boolean noremote) throws VCSException { + return null; + } + + public boolean isOnRemote(File file) { + return false; + } + + public boolean isUpToDate(File file) throws VCSException { + return false; + } + + public void makeRemoteDir(String commitMessage, String... dirNames) throws VCSException { + } + + public void deleteRemoteDir(String commitMessage, String... dirNames) throws VCSException { + } + + public long add(List<File> files, String msg) throws VCSException { + return 0; + } + + public void delete(List<File> files, String msg) throws VCSException { + } + + public void revert(List<File> files) throws VCSException { + } + + public long commit(List<File> files, String msg) throws VCSException { + return 0; + } + + public void update(File file, Object revision) throws VCSException { + } + + public void update(File file) throws VCSException { + } + + public void checkout(File destDir, String module, boolean recurse) throws VCSException { + } + + public void checkoutFile(File destDir, String module) throws VCSException { + } + + public long checkoutOnlyTheDirectory(File root, Object revision) throws VCSException { + return 0; + } + + public List<String> getRemoteStorageNames(File directory) throws VCSException { + return null; + } + + public Object getRevision(File f) throws VCSException { + return null; + } + + public List getLog(Object startRevision, Object endRevision, File file) throws VCSException { + return null; + } + + public String getFileContent(File file, Object revision) throws VCSException, IOException { + return null; + } + + public String getChangeLog(File file) throws VCSException { + return null; + } + + public String getDiff(File file) throws VCSException, IOException { + return null; + } + + public String getDiff(File file, Object againstRevision) throws VCSException, IOException { + return null; + } + + public void testConnection() throws VCSException { + } + + public boolean hasProtocoleChanged() throws VCSException { + return false; + } +} Copied: trunk/lutinvcs/lutinvcs-core/src/main/resources/META-INF/services/org.codelutin.vcs.VCSHandlerProvider (from rev 240, trunk/lutinvcs/lutinvcs-provider-cvs/src/main/resources/META-INF/services/org.codelutin.vcs.VCSHandlerProvider) =================================================================== --- trunk/lutinvcs/lutinvcs-core/src/main/resources/META-INF/services/org.codelutin.vcs.VCSHandlerProvider (rev 0) +++ trunk/lutinvcs/lutinvcs-core/src/main/resources/META-INF/services/org.codelutin.vcs.VCSHandlerProvider 2008-03-31 20:40:16 UTC (rev 247) @@ -0,0 +1 @@ +org.codelutin.vcs.mock.MockHandlerProvider \ No newline at end of file
participants (1)
-
tchemit@users.labs.libre-entreprise.org