See https://dev.eclipse.org/mhonarc/lists/jgit-dev/msg03040.html Change-Id: If51f3c750684d82cb6443f1578636c9f5ca56e2b Signed-off-by: Andrey Loskutov <loskutov@gmx.de>tags/v4.2.0.201601211800-r
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |||||
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig"> | |||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> | |||||
<listEntry value="/org.eclipse.jgit.pgm.test/tst"/> | |||||
</listAttribute> | |||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> | |||||
<listEntry value="2"/> | |||||
</listAttribute> | |||||
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> | |||||
<mapAttribute key="org.eclipse.debug.core.environmentVariables"> | |||||
<mapEntry key="LANG" value="de_DE.UTF-8"/> | |||||
</mapAttribute> | |||||
<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> | |||||
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/> | |||||
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/> | |||||
</listAttribute> | |||||
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=org.eclipse.jgit.pgm.test/tst"/> | |||||
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/> | |||||
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/> | |||||
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/> | |||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/> | |||||
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH"> | |||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7" path="1" type="4"/> "/> | |||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento exportedEntriesOnly="false" project="org.eclipse.jgit.pgm.test"/> </runtimeClasspathEntry> "/> | |||||
</listAttribute> | |||||
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/> | |||||
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> | |||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/> | |||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.jgit.pgm.test"/> | |||||
</launchConfiguration> |
import static org.junit.Assert.assertArrayEquals; | import static org.junit.Assert.assertArrayEquals; | ||||
import static org.junit.Assert.assertEquals; | import static org.junit.Assert.assertEquals; | ||||
import static org.junit.Assert.assertNotNull; | import static org.junit.Assert.assertNotNull; | ||||
import static org.junit.Assert.fail; | |||||
import org.eclipse.jgit.api.Git; | import org.eclipse.jgit.api.Git; | ||||
import org.eclipse.jgit.dircache.DirCache; | import org.eclipse.jgit.dircache.DirCache; | ||||
@Test | @Test | ||||
public void testAddNothing() throws Exception { | public void testAddNothing() throws Exception { | ||||
assertEquals("fatal: Argument \"filepattern\" is required", // | |||||
executeUnchecked("git add")[0]); | |||||
try { | |||||
execute("git add"); | |||||
fail("Must die"); | |||||
} catch (Die e) { | |||||
// expected, requires argument | |||||
} | |||||
} | } | ||||
@Test | @Test |
*/ | */ | ||||
package org.eclipse.jgit.pgm; | package org.eclipse.jgit.pgm; | ||||
import static org.junit.Assert.assertEquals; | |||||
import static org.junit.Assert.assertFalse; | import static org.junit.Assert.assertFalse; | ||||
import static org.junit.Assert.assertTrue; | import static org.junit.Assert.assertTrue; | ||||
import static org.junit.Assert.fail; | |||||
import java.io.File; | import java.io.File; | ||||
import java.util.Arrays; | import java.util.Arrays; | ||||
@Test | @Test | ||||
public void testMissingPath() throws Exception { | public void testMissingPath() throws Exception { | ||||
assertEquals("fatal: Argument \"path\" is required", | |||||
executeUnchecked("git repo")[0]); | |||||
try { | |||||
execute("git repo"); | |||||
fail("Must die"); | |||||
} catch (Die e) { | |||||
// expected, requires argument | |||||
} | |||||
} | } | ||||
/** | /** |
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |||||
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig"> | |||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> | |||||
<listEntry value="/org.eclipse.jgit.test/tst"/> | |||||
</listAttribute> | |||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> | |||||
<listEntry value="2"/> | |||||
</listAttribute> | |||||
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> | |||||
<mapAttribute key="org.eclipse.debug.core.environmentVariables"> | |||||
<mapEntry key="LANG" value="de_DE.UTF-8"/> | |||||
</mapAttribute> | |||||
<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> | |||||
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/> | |||||
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/> | |||||
</listAttribute> | |||||
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=org.eclipse.jgit.test/tst"/> | |||||
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/> | |||||
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/> | |||||
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/> | |||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/> | |||||
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH"> | |||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6" path="1" type="4"/> "/> | |||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento exportedEntriesOnly="false" project="org.eclipse.jgit.test"/> </runtimeClasspathEntry> "/> | |||||
</listAttribute> | |||||
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/> | |||||
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> | |||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/> | |||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.jgit.test"/> | |||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx256m"/> | |||||
</launchConfiguration> |