JBoss Tools SVN: r35935 - trunk/documentation/whatsnew/openshift.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-24 09:33:54 -0400 (Mon, 24 Oct 2011)
New Revision: 35935
Modified:
trunk/documentation/whatsnew/openshift/openshift-news-0.1.0.M4.html
Log:
[JBIDE-10011] creating openshift n&n
Modified: trunk/documentation/whatsnew/openshift/openshift-news-0.1.0.M4.html
===================================================================
--- trunk/documentation/whatsnew/openshift/openshift-news-0.1.0.M4.html 2011-10-24 13:19:09 UTC (rev 35934)
+++ trunk/documentation/whatsnew/openshift/openshift-news-0.1.0.M4.html 2011-10-24 13:33:54 UTC (rev 35935)
@@ -38,22 +38,20 @@
We developed a wizard that allows you to create an application on OpenShift Express and import it to your Eclipse workspace.
The wizard holds all operations involved in creating a new application on OpenShift Express.
<p></p><img src="images/new-openshift-express-wizard.png" alt="new openshift express application"/></p>
- A frist step would require you to supply your credentials. A link would open the signup page if you have no account on
- OpenShift Express yet.
- <p></p><img src="images/credentials.png" alt="credentials"/></p>
+ the first page requires you to privide your OpenShift Express credentials. If you have no account yet, you may get to the signup page by clicking the link on the top of this page.<p></p><img src="images/credentials.png" alt="credentials"/></p>
You may eventually have to create a domain first.
<p></p><img src="images/domain.png" alt="domain"/></p>
- The wizard allows you to create a new application.
+ Once you have a domain, the wizard allows you to create a new application.
<p></p><img src="images/new-application.png" alt="new application"/></p>
- It then lists your application.
+ And then lists all your applications.
<p></p><img src="images/applications.png" alt="applications"/></p>
A dialog lists the details for your new application.
<p></p><img src="images/application-info.png" alt="application info"/></p>
The last step involved determines to what local location the git repository is cloned to.
- You may also tell our tooling to create a server adapter that will allow you to publish changes to the
+ You may also instruct the tooling to create an Eclipse WTP server adapter for your application. It will allow you to publish changes to the
OpenShift Express PaaS.
<p></p><img src="images/import-project.png" alt="import project"/></p>
- The wizard will clone the repo...
+ The wizard will then clone the repo...
<p></p><img src="images/git-repository.png" alt="git repository"/></p>
...import the OpenShift Express application to your workspace...
<p></p><img src="images/imported-project.png" alt="imported project"/></p>
13 years, 2 months
JBoss Tools SVN: r35934 - trunk/documentation/whatsnew/openshift.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-24 09:19:09 -0400 (Mon, 24 Oct 2011)
New Revision: 35934
Modified:
trunk/documentation/whatsnew/openshift/openshift-news-0.1.0.M4.html
Log:
[JBIDE-10011] creating openshift n&n
Modified: trunk/documentation/whatsnew/openshift/openshift-news-0.1.0.M4.html
===================================================================
--- trunk/documentation/whatsnew/openshift/openshift-news-0.1.0.M4.html 2011-10-24 13:07:23 UTC (rev 35933)
+++ trunk/documentation/whatsnew/openshift/openshift-news-0.1.0.M4.html 2011-10-24 13:19:09 UTC (rev 35934)
@@ -35,7 +35,7 @@
<tr>
<td valign="top" align="left"><a name="itemname3" id="itemname3"></a><b>New Wizard</b></td>
<td valign="top">
- We developed a wizard that would allow you to import an OpenShift Express application to your Eclipse workspace.
+ We developed a wizard that allows you to create an application on OpenShift Express and import it to your Eclipse workspace.
The wizard holds all operations involved in creating a new application on OpenShift Express.
<p></p><img src="images/new-openshift-express-wizard.png" alt="new openshift express application"/></p>
A frist step would require you to supply your credentials. A link would open the signup page if you have no account on
@@ -71,12 +71,13 @@
<tr>
<td valign="top" align="left"><a name="itemname3" id="itemname3"></a><b>REST Client</b></td>
<td valign="top">
- We also developed a REST client in Java for OpenShift Express. It pretty much offers all features that
- are currently offered by the rhc-* command line tools. Even though it's pretty new,
- it's code base is pretty well tested since it's covered well by unit-tests and used in our application wizard
- and in the <a href="https://github.com/forge/plugin-openshift-express">Forge OpenShift Express plugin</a>.
- The plugin is currently still an eclipse plugin, but we will strip its Eclipse dependencies and move it to github
- at some point.
+ We also developed a client for the OpenShift Express REST service. It pretty much offers all features that
+ are currently available in the rhc-* command line tools (create/rename a domain, create/destroy applications,
+ list all existing applications, available cartridges, read the application log etc.). <br/>
+ Even though it's pretty new, it's code base is pretty well tested since it's well covered by unit-tests and
+ used in our application wizard and the <a href="https://github.com/forge/plugin-openshift-express">Forge OpenShift Express plugin</a>.
+ The plug-in is currently still an osgi bundle, but we will strip its Eclipse dependencies and move it to github
+ at some point.</br>
You may check the current code in our <a href="http://anonsvn.jboss.org/repos/jbosstools/trunk/openshift/plugins/org.jbo...">SVN</a>.
<p><small><a href="https://issues.jboss.org/browse/JBIDE-9591">Related Jira</a></small></p>
</td>
13 years, 2 months
JBoss Tools SVN: r35933 - in trunk/documentation/whatsnew/openshift: images and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-24 09:07:23 -0400 (Mon, 24 Oct 2011)
New Revision: 35933
Added:
trunk/documentation/whatsnew/openshift/images/server-adapter-editor.png
trunk/documentation/whatsnew/openshift/openshift-news-0.1.0.M4.html
Removed:
trunk/documentation/whatsnew/openshift/images/server-adapter.-editor.png
Modified:
trunk/documentation/whatsnew/openshift/images/import-project.png
Log:
[JBIDE-10011] creating openshift n&n
Modified: trunk/documentation/whatsnew/openshift/images/import-project.png
===================================================================
(Binary files differ)
Copied: trunk/documentation/whatsnew/openshift/images/server-adapter-editor.png (from rev 35931, trunk/documentation/whatsnew/openshift/images/server-adapter.-editor.png)
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/openshift/images/server-adapter-editor.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted: trunk/documentation/whatsnew/openshift/images/server-adapter.-editor.png
===================================================================
(Binary files differ)
Added: trunk/documentation/whatsnew/openshift/openshift-news-0.1.0.M4.html
===================================================================
--- trunk/documentation/whatsnew/openshift/openshift-news-0.1.0.M4.html (rev 0)
+++ trunk/documentation/whatsnew/openshift/openshift-news-0.1.0.M4.html 2011-10-24 13:07:23 UTC (rev 35933)
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Language" content="en-us" />
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<link rel="stylesheet" href="../whatsnew.css" />
+<title>OpenShift Tools 0.1.0.M4 What's New</title>
+<script type="text/javascript">
+
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-17645367-5']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+
+</script></head>
+<body>
+<h1>OpenShift 0.1.0.M4 What's New</h1>
+
+<p align="right"><a href="../index.html">< Main Index</a> <a
+ href="../modeshape/modeshape-news-3.3.0.M4.html">Modeshape Tools
+ ></a></p>
+ <table border="0" cellpadding="10" cellspacing="0" width="80%">
+ <tr>
+ <td colspan="2"> <hr />
+ <h3>OpenShift Express Application Wizard</h3><hr />
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" align="left"><a name="itemname3" id="itemname3"></a><b>New Wizard</b></td>
+ <td valign="top">
+ We developed a wizard that would allow you to import an OpenShift Express application to your Eclipse workspace.
+ The wizard holds all operations involved in creating a new application on OpenShift Express.
+ <p></p><img src="images/new-openshift-express-wizard.png" alt="new openshift express application"/></p>
+ A frist step would require you to supply your credentials. A link would open the signup page if you have no account on
+ OpenShift Express yet.
+ <p></p><img src="images/credentials.png" alt="credentials"/></p>
+ You may eventually have to create a domain first.
+ <p></p><img src="images/domain.png" alt="domain"/></p>
+ The wizard allows you to create a new application.
+ <p></p><img src="images/new-application.png" alt="new application"/></p>
+ It then lists your application.
+ <p></p><img src="images/applications.png" alt="applications"/></p>
+ A dialog lists the details for your new application.
+ <p></p><img src="images/application-info.png" alt="application info"/></p>
+ The last step involved determines to what local location the git repository is cloned to.
+ You may also tell our tooling to create a server adapter that will allow you to publish changes to the
+ OpenShift Express PaaS.
+ <p></p><img src="images/import-project.png" alt="import project"/></p>
+ The wizard will clone the repo...
+ <p></p><img src="images/git-repository.png" alt="git repository"/></p>
+ ...import the OpenShift Express application to your workspace...
+ <p></p><img src="images/imported-project.png" alt="imported project"/></p>
+ ...and create the Eclipse WTP server adapter for you.
+ <p></p><img src="images/server-adapter.png" alt="server adapter"/></p>
+ <p></p><img src="images/server-adapter-editor.png" alt="server adapter editor"/></p>
+ <p><small><a href="https://issues.jboss.org/browse/JBIDE-9793">Related Jira</a></small></p>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2"> <hr />
+ <h3>OpenShift Express REST client</h3><hr />
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" align="left"><a name="itemname3" id="itemname3"></a><b>REST Client</b></td>
+ <td valign="top">
+ We also developed a REST client in Java for OpenShift Express. It pretty much offers all features that
+ are currently offered by the rhc-* command line tools. Even though it's pretty new,
+ it's code base is pretty well tested since it's covered well by unit-tests and used in our application wizard
+ and in the <a href="https://github.com/forge/plugin-openshift-express">Forge OpenShift Express plugin</a>.
+ The plugin is currently still an eclipse plugin, but we will strip its Eclipse dependencies and move it to github
+ at some point.
+ You may check the current code in our <a href="http://anonsvn.jboss.org/repos/jbosstools/trunk/openshift/plugins/org.jbo...">SVN</a>.
+ <p><small><a href="https://issues.jboss.org/browse/JBIDE-9591">Related Jira</a></small></p>
+ </td>
+ </tr>
+ </table>
+</body>
+
+</html>
+
+
Property changes on: trunk/documentation/whatsnew/openshift/openshift-news-0.1.0.M4.html
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 2 months
JBoss Tools SVN: r35932 - trunk/documentation/whatsnew.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-24 08:30:16 -0400 (Mon, 24 Oct 2011)
New Revision: 35932
Modified:
trunk/documentation/whatsnew/index.html
Log:
[JBIDE-10011] creating openshift n&n
Modified: trunk/documentation/whatsnew/index.html
===================================================================
--- trunk/documentation/whatsnew/index.html 2011-10-24 12:26:52 UTC (rev 35931)
+++ trunk/documentation/whatsnew/index.html 2011-10-24 12:30:16 UTC (rev 35932)
@@ -37,6 +37,7 @@
<p align="right"><b>3.3.0.M4</b>
<td valign="top">
<p><a href="vpe/vpe-news-3.3.0.M4.html">Visual Page Editor 3.3.0.M4</a></p>
+ <p><a href="openshift/openshift-news-0.1.0.M4.html">Openshift Application Wizard 0.1.0.M4</a></p>
</td>
</tr>
<tr>
13 years, 2 months
JBoss Tools SVN: r35931 - in trunk/documentation/whatsnew: openshift and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-24 08:26:52 -0400 (Mon, 24 Oct 2011)
New Revision: 35931
Added:
trunk/documentation/whatsnew/openshift/
trunk/documentation/whatsnew/openshift/images/
trunk/documentation/whatsnew/openshift/images/application-info.png
trunk/documentation/whatsnew/openshift/images/applications.png
trunk/documentation/whatsnew/openshift/images/credentials.png
trunk/documentation/whatsnew/openshift/images/domain.png
trunk/documentation/whatsnew/openshift/images/git-repository.png
trunk/documentation/whatsnew/openshift/images/import-project.png
trunk/documentation/whatsnew/openshift/images/imported-project.png
trunk/documentation/whatsnew/openshift/images/new-application.png
trunk/documentation/whatsnew/openshift/images/new-openshift-express-wizard.png
trunk/documentation/whatsnew/openshift/images/server-adapter.-editor.png
trunk/documentation/whatsnew/openshift/images/server-adapter.png
trunk/documentation/whatsnew/openshift/images/starter-app.png
Log:
[JBIDE-10011] creating openshift n&n
Added: trunk/documentation/whatsnew/openshift/images/application-info.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/openshift/images/application-info.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/openshift/images/applications.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/openshift/images/applications.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/openshift/images/credentials.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/openshift/images/credentials.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/openshift/images/domain.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/openshift/images/domain.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/openshift/images/git-repository.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/openshift/images/git-repository.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/openshift/images/import-project.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/openshift/images/import-project.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/openshift/images/imported-project.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/openshift/images/imported-project.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/openshift/images/new-application.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/openshift/images/new-application.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/openshift/images/new-openshift-express-wizard.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/openshift/images/new-openshift-express-wizard.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/openshift/images/server-adapter.-editor.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/openshift/images/server-adapter.-editor.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/openshift/images/server-adapter.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/openshift/images/server-adapter.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/openshift/images/starter-app.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/openshift/images/starter-app.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
13 years, 2 months
JBoss Tools SVN: r35930 - trunk/openshift/plugins.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-10-24 07:53:45 -0400 (Mon, 24 Oct 2011)
New Revision: 35930
Added:
trunk/openshift/plugins/pom.xml
Log:
JBIDE-10013 - missed plugins pom.xml
Added: trunk/openshift/plugins/pom.xml
===================================================================
--- trunk/openshift/plugins/pom.xml (rev 0)
+++ trunk/openshift/plugins/pom.xml 2011-10-24 11:53:45 UTC (rev 35930)
@@ -0,0 +1,19 @@
+<project
+xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>openshift</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools.openshift</groupId>
+ <artifactId>plugins</artifactId>
+ <name>openshift.plugins</name>
+ <packaging>pom</packaging>
+ <modules>
+ <module>org.jboss.ide.eclipse.as.egit.core</module>
+ <module>org.jboss.ide.eclipse.as.egit.ui</module>
+ <module>org.jboss.tools.openshift.express.client</module>
+ <module>org.jboss.tools.openshift.express.ui</module>
+ </modules>
+</project>
13 years, 2 months
JBoss Tools SVN: r35929 - in trunk/openshift/tests: org.jboss.tools.openshift.egit.test and 11 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-10-24 07:48:54 -0400 (Mon, 24 Oct 2011)
New Revision: 35929
Added:
trunk/openshift/tests/org.jboss.tools.openshift.egit.test/
trunk/openshift/tests/org.jboss.tools.openshift.egit.test/.classpath
trunk/openshift/tests/org.jboss.tools.openshift.egit.test/.project
trunk/openshift/tests/org.jboss.tools.openshift.egit.test/.settings/
trunk/openshift/tests/org.jboss.tools.openshift.egit.test/.settings/org.eclipse.jdt.core.prefs
trunk/openshift/tests/org.jboss.tools.openshift.egit.test/META-INF/
trunk/openshift/tests/org.jboss.tools.openshift.egit.test/META-INF/MANIFEST.MF
trunk/openshift/tests/org.jboss.tools.openshift.egit.test/build.properties
trunk/openshift/tests/org.jboss.tools.openshift.egit.test/pom.xml
trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/
trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/
trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/
trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/
trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/
trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/
trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/
trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/
trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/EGitTestActivator.java
trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/EGitUtilsTest.java
trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/util/
trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/util/MockSystemReader.java
trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/util/TestProject.java
trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/util/TestRepository.java
trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/util/TestUtils.java
Log:
JBIDE-10013 - missed egit tests
Added: trunk/openshift/tests/org.jboss.tools.openshift.egit.test/.classpath
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.egit.test/.classpath (rev 0)
+++ trunk/openshift/tests/org.jboss.tools.openshift.egit.test/.classpath 2011-10-24 11:48:54 UTC (rev 35929)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/openshift/tests/org.jboss.tools.openshift.egit.test/.project
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.egit.test/.project (rev 0)
+++ trunk/openshift/tests/org.jboss.tools.openshift.egit.test/.project 2011-10-24 11:48:54 UTC (rev 35929)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.openshift.egit.test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: trunk/openshift/tests/org.jboss.tools.openshift.egit.test/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.egit.test/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/openshift/tests/org.jboss.tools.openshift.egit.test/.settings/org.eclipse.jdt.core.prefs 2011-10-24 11:48:54 UTC (rev 35929)
@@ -0,0 +1,8 @@
+#Tue Aug 16 13:32:00 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Added: trunk/openshift/tests/org.jboss.tools.openshift.egit.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.egit.test/META-INF/MANIFEST.MF (rev 0)
+++ trunk/openshift/tests/org.jboss.tools.openshift.egit.test/META-INF/MANIFEST.MF 2011-10-24 11:48:54 UTC (rev 35929)
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: EGit Tests
+Bundle-SymbolicName: org.jboss.ide.eclipse.as.egit.test
+Bundle-Version: 2.3.0.qualifier
+Bundle-Activator: org.jboss.tools.openshift.egit.internal.test.EGitTestActivator
+Bundle-Vendor: JBoss by Red Hat
+Require-Bundle: org.eclipse.egit.core;bundle-version="1.0.0",
+ org.eclipse.jgit;bundle-version="[1.0.0,2.0.1]",
+ org.eclipse.core.runtime,
+ org.eclipse.core.resources;bundle-version="[3.7.100,4.0.0)",
+ org.eclipse.core.filesystem;bundle-version="1.3.100",
+ org.junit;bundle-version="[4.8.2,5.0.0)",
+ org.jboss.tools.openshift.egit.core;bundle-version="1.0.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy
Added: trunk/openshift/tests/org.jboss.tools.openshift.egit.test/build.properties
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.egit.test/build.properties (rev 0)
+++ trunk/openshift/tests/org.jboss.tools.openshift.egit.test/build.properties 2011-10-24 11:48:54 UTC (rev 35929)
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
Added: trunk/openshift/tests/org.jboss.tools.openshift.egit.test/pom.xml
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.egit.test/pom.xml (rev 0)
+++ trunk/openshift/tests/org.jboss.tools.openshift.egit.test/pom.xml 2011-10-24 11:48:54 UTC (rev 35929)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools.openshift</groupId>
+ <artifactId>tests</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools.openshift.tests</groupId>
+ <artifactId>org.jboss.tools.openshift.egit.test</artifactId>
+ <packaging>eclipse-test-plugin</packaging>
+</project>
Added: trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/EGitTestActivator.java
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/EGitTestActivator.java (rev 0)
+++ trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/EGitTestActivator.java 2011-10-24 11:48:54 UTC (rev 35929)
@@ -0,0 +1,30 @@
+package org.jboss.tools.openshift.egit.internal.test;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class EGitTestActivator implements BundleActivator {
+
+ private static BundleContext context;
+
+ static BundleContext getContext() {
+ return context;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext bundleContext) throws Exception {
+ EGitTestActivator.context = bundleContext;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext bundleContext) throws Exception {
+ EGitTestActivator.context = null;
+ }
+
+}
Added: trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/EGitUtilsTest.java
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/EGitUtilsTest.java (rev 0)
+++ trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/EGitUtilsTest.java 2011-10-24 11:48:54 UTC (rev 35929)
@@ -0,0 +1,148 @@
+package org.jboss.tools.openshift.egit.internal.test;
+
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.net.URISyntaxException;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.egit.core.Activator;
+import org.jboss.tools.openshift.egit.core.EGitUtils;
+import org.jboss.tools.openshift.egit.internal.test.util.TestProject;
+import org.jboss.tools.openshift.egit.internal.test.util.TestRepository;
+import org.jboss.tools.openshift.egit.internal.test.util.TestUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class EGitUtilsTest {
+
+ private static final String GIT_EMAIL = "dummyUser(a)redhat.com";
+ private static final String GIT_USER = "dummyUser";
+ private static final String REPO2_REMOTE_NAME = "openshift";
+
+ protected final TestUtils testUtils = new TestUtils();
+
+ private TestRepository testRepository;
+ private TestRepository testRepository2;
+ private TestProject testProject;
+ private TestProject testProject2;
+ private TestRepository clonedTestRepository;
+
+ @Before
+ public void setUp() throws Exception {
+ Activator.getDefault().getRepositoryCache().clear();
+
+ this.testProject = new TestProject(true);
+
+ this.testRepository = new TestRepository(TestUtils.createGitDir(testProject));
+ testRepository.createMockSystemReader(ResourcesPlugin.getWorkspace().getRoot().getLocation());
+ testRepository.setUserAndEmail(GIT_USER, GIT_EMAIL);
+ testRepository.connect(testProject.getProject());
+
+ this.testProject2 = new TestProject(true);
+
+ this.testRepository2 = new TestRepository(TestUtils.createGitDir(testProject2));
+ testRepository2.setUserAndEmail(GIT_USER, GIT_EMAIL);
+ testRepository2.connect(testProject2.getProject());
+
+ this.clonedTestRepository = cloneRepository(testRepository);
+ clonedTestRepository.addRemoteTo(REPO2_REMOTE_NAME, testRepository2.getRepository());
+ }
+
+ private TestRepository cloneRepository(TestRepository repository) throws URISyntaxException,
+ InvocationTargetException, InterruptedException, IOException {
+ File workspaceDir = ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile();
+ File clonedRepositoryFile =
+ new File(workspaceDir, "clonedRepository-" + String.valueOf(System.currentTimeMillis()));
+ return testRepository.cloneRepository(clonedRepositoryFile);
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ testRepository.dispose();
+ clonedTestRepository.dispose();
+ testRepository2.dispose();
+ Activator.getDefault().getRepositoryCache().clear();
+
+ testProject.dispose();
+ testProject2.dispose();
+ }
+
+ @Test
+ public void canCommitFileInProject() throws Exception {
+ String fileName = "a.txt";
+ String fileContent = "adietish(a)redhat.com";
+
+ IFile file = testUtils.addFileToProject(
+ testProject.getProject(),
+ fileName,
+ fileContent);
+ testRepository.track(file);
+
+ EGitUtils.commit(testProject.getProject(), null);
+
+ testUtils.assertRepositoryContainsFilesWithContent(
+ testRepository.getRepository(),
+ new String[] { testUtils.getPathInRepository(file), fileContent });
+ }
+
+ @Test
+ public void fileAddedToCloneIsInOriginAfterPush() throws Exception {
+ String fileName = "b.txt";
+ String fileContent = "adietish(a)redhat.com";
+
+ File file = clonedTestRepository.createFile(fileName, fileContent);
+ clonedTestRepository.addAndCommit(file, "adding a file");
+
+ EGitUtils.push(clonedTestRepository.getRepository(), null);
+
+ // does origin contain file added to clone?
+ testUtils.assertRepositoryContainsFilesWithContent(
+ clonedTestRepository.getRepository(),
+ fileName,
+ fileContent);
+ }
+
+ @Test
+ public void fileAddedToCloneIsInRemoteAfterPush() throws Exception {
+ String fileName = "c.txt";
+ String fileContent = "adietish(a)redhat.com";
+
+ File file = clonedTestRepository.createFile(fileName, fileContent);
+ clonedTestRepository.addAndCommit(file, "adding a file");
+
+ EGitUtils.push(REPO2_REMOTE_NAME, clonedTestRepository.getRepository(), null);
+
+ // does origin contain file added to clone?
+ testUtils.assertRepositoryContainsFilesWithContent(
+ testRepository2.getRepository(),
+ fileName,
+ fileContent);
+ }
+
+ @Test
+ public void forcedPushRemovesFileInRemote() throws Exception {
+ String fileName = "c.txt";
+ String fileContent = "adietish(a)redhat.com";
+
+ IFile fileInRepo2 = testUtils.addFileToProject(
+ testProject2.getProject(),
+ fileName,
+ fileContent);
+ testRepository2.track(fileInRepo2);
+
+ File fileInClone = clonedTestRepository.createFile(fileName, fileContent);
+ clonedTestRepository.addAndCommit(fileInClone, "adding a file");
+
+ EGitUtils.push(REPO2_REMOTE_NAME, clonedTestRepository.getRepository(), null);
+
+ // does origin contain file added to clone?
+ testUtils.assertRepositoryContainsFilesWithContent(
+ clonedTestRepository.getRepository(),
+ fileName,
+ fileContent);
+ }
+
+}
Added: trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/util/MockSystemReader.java
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/util/MockSystemReader.java (rev 0)
+++ trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/util/MockSystemReader.java 2011-10-24 11:48:54 UTC (rev 35929)
@@ -0,0 +1,143 @@
+/*
+ * Copyright (C) 2009, Google Inc.
+ * Copyright (C) 2009, Robin Rosenberg <robin.rosenberg(a)dewire.com>
+ * Copyright (C) 2009, Yann Simon <yann.simon.fr(a)gmail.com>
+ * and other copyright owners as documented in the project's IP log.
+ *
+ * This program and the accompanying materials are made available
+ * under the terms of the Eclipse Distribution License v1.0 which
+ * accompanies this distribution, is reproduced below, and is
+ * available at http://www.eclipse.org/org/documents/edl-v10.php
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ *
+ * - Neither the name of the Eclipse Foundation, Inc. nor the
+ * names of its contributors may be used to endorse or promote
+ * products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.jboss.tools.openshift.egit.internal.test.util;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.TimeZone;
+
+import org.eclipse.jgit.errors.ConfigInvalidException;
+import org.eclipse.jgit.lib.Config;
+import org.eclipse.jgit.lib.Constants;
+import org.eclipse.jgit.storage.file.FileBasedConfig;
+import org.eclipse.jgit.util.FS;
+import org.eclipse.jgit.util.SystemReader;
+
+public class MockSystemReader extends SystemReader {
+ private final class MockConfig extends FileBasedConfig {
+ private MockConfig(File cfgLocation, FS fs) {
+ super(cfgLocation, fs);
+ }
+
+ @Override
+ public void load() throws IOException, ConfigInvalidException {
+ // Do nothing
+ }
+
+ @Override
+ public boolean isOutdated() {
+ return false;
+ }
+ }
+
+ final Map<String, String> values = new HashMap<String, String>();
+
+ FileBasedConfig userGitConfig;
+
+ FileBasedConfig systemGitConfig;
+
+ public MockSystemReader() {
+ init(Constants.OS_USER_NAME_KEY);
+ init(Constants.GIT_AUTHOR_NAME_KEY);
+ init(Constants.GIT_AUTHOR_EMAIL_KEY);
+ init(Constants.GIT_COMMITTER_NAME_KEY);
+ init(Constants.GIT_COMMITTER_EMAIL_KEY);
+ userGitConfig = new MockConfig(null, null);
+ systemGitConfig = new MockConfig(null, null);
+ }
+
+ private void init(final String n) {
+ setProperty(n, n);
+ }
+
+ public void clearProperties() {
+ values.clear();
+ }
+
+ public void setProperty(String key, String value) {
+ values.put(key, value);
+ }
+
+ @Override
+ public String getenv(String variable) {
+ return values.get(variable);
+ }
+
+ @Override
+ public String getProperty(String key) {
+ return values.get(key);
+ }
+
+ @Override
+ public FileBasedConfig openUserConfig(Config parent, FS fs) {
+ assert parent == null || parent == systemGitConfig;
+ return userGitConfig;
+ }
+
+ @Override
+ public FileBasedConfig openSystemConfig(Config parent, FS fs) {
+ assert parent == null;
+ return systemGitConfig;
+ }
+
+ @Override
+ public String getHostname() {
+ return "fake.host.example.com";
+ }
+
+ @Override
+ public long getCurrentTime() {
+ return 1250379778668L; // Sat Aug 15 20:12:58 GMT-03:30 2009
+ }
+
+ @Override
+ public int getTimezone(long when) {
+ return TimeZone.getTimeZone("GMT-03:30").getOffset(when) / (60 * 1000);
+ }
+
+}
Added: trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/util/TestProject.java
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/util/TestProject.java (rev 0)
+++ trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/util/TestProject.java 2011-10-24 11:48:54 UTC (rev 35929)
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg(a)dewire.com>
+ * Copyright (C) 2006, Shawn O. Pearce <spearce(a)spearce.org>
+ * Copyright (C) 2011, Andre Dietisheim <adietish(a)redhat.com>
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.jboss.tools.openshift.egit.internal.test.util;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jgit.util.FileUtils;
+
+public class TestProject {
+ public IProject project;
+
+ private String location;
+ private TestUtils testUtils = new TestUtils();
+
+ /**
+ * @throws CoreException
+ * If project already exists
+ */
+ public TestProject() throws CoreException {
+ this(false);
+ }
+
+ public TestProject(boolean remove) throws CoreException {
+ this(remove, "Project-" + System.currentTimeMillis());
+ }
+
+ /**
+ * @param remove
+ * should project be removed if already exists
+ * @param projectName
+ * @throws CoreException
+ */
+ public TestProject(final boolean remove, String projectName) throws CoreException {
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ project = root.getProject(projectName);
+ if (remove)
+ project.delete(true, null);
+ project.create(null);
+ project.open(null);
+ location = project.getLocation().toOSString();
+ }
+
+ public IProject getProject() {
+ return project;
+ }
+
+ public IFile createFile(String name, byte[] content) throws Exception {
+ IFile file = project.getFile(name);
+ InputStream inputStream = new ByteArrayInputStream(content);
+ file.create(inputStream, true, null);
+
+ return file;
+ }
+
+ public IFolder createFolder(String name) throws Exception {
+ IFolder folder = project.getFolder(name);
+ folder.create(true, true, null);
+
+ IFile keep = project.getFile(name + "/keep");
+ keep.create(new ByteArrayInputStream(new byte[] {0}), true, null);
+
+ return folder;
+ }
+
+ public void dispose() throws CoreException, IOException {
+ if (project.exists())
+ project.delete(true, true, null);
+ else {
+ File f = new File(location);
+ if (f.exists())
+ FileUtils.delete(f, FileUtils.RECURSIVE | FileUtils.RETRY);
+ }
+ }
+
+ public String getFileContent(String filepath) throws Exception {
+ IFile file = project.getFile(filepath);
+ InputStream stream = file.getContents();
+ return testUtils.slurpAndClose(stream);
+ }
+}
Added: trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/util/TestRepository.java
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/util/TestRepository.java (rev 0)
+++ trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/util/TestRepository.java 2011-10-24 11:48:54 UTC (rev 35929)
@@ -0,0 +1,608 @@
+/*******************************************************************************
+ * Copyright (C) 2011, Mathias Kinzler <mathias.kinzler(a)sap.com>
+ * Copyright (C) 2010, Jens Baumgart <jens.baumgart(a)sap.com>
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.jboss.tools.openshift.egit.internal.test.util;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.lang.reflect.InvocationTargetException;
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.regex.Pattern;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.egit.core.Activator;
+import org.eclipse.egit.core.RepositoryCache;
+import org.eclipse.egit.core.op.BranchOperation;
+import org.eclipse.egit.core.op.CloneOperation;
+import org.eclipse.egit.core.op.ConnectProviderOperation;
+import org.eclipse.egit.core.op.DisconnectProviderOperation;
+import org.eclipse.jgit.api.CommitCommand;
+import org.eclipse.jgit.api.Git;
+import org.eclipse.jgit.api.errors.ConcurrentRefUpdateException;
+import org.eclipse.jgit.api.errors.JGitInternalException;
+import org.eclipse.jgit.api.errors.NoFilepatternException;
+import org.eclipse.jgit.api.errors.NoHeadException;
+import org.eclipse.jgit.api.errors.NoMessageException;
+import org.eclipse.jgit.api.errors.WrongRepositoryStateException;
+import org.eclipse.jgit.dircache.DirCache;
+import org.eclipse.jgit.dircache.DirCacheEntry;
+import org.eclipse.jgit.errors.UnmergedPathException;
+import org.eclipse.jgit.lib.ConfigConstants;
+import org.eclipse.jgit.lib.Constants;
+import org.eclipse.jgit.lib.ObjectId;
+import org.eclipse.jgit.lib.Ref;
+import org.eclipse.jgit.lib.RefUpdate;
+import org.eclipse.jgit.lib.Repository;
+import org.eclipse.jgit.lib.StoredConfig;
+import org.eclipse.jgit.revwalk.RevCommit;
+import org.eclipse.jgit.revwalk.RevWalk;
+import org.eclipse.jgit.storage.file.FileRepository;
+import org.eclipse.jgit.transport.RemoteConfig;
+import org.eclipse.jgit.transport.URIish;
+import org.eclipse.jgit.treewalk.TreeWalk;
+import org.eclipse.jgit.util.FileUtils;
+import org.eclipse.jgit.util.SystemReader;
+
+/**
+ * Helper class for creating and filling a test repository
+ *
+ */
+public class TestRepository {
+
+ Repository repository;
+
+ String workdirPrefix;
+
+ private File gitDir;
+
+ /**
+ * Creates a new test repository
+ *
+ * @param gitDir
+ * @throws IOException
+ */
+ public TestRepository(File gitDir) throws IOException {
+ FileRepository tmpRepository = new FileRepository(gitDir);
+ tmpRepository.create();
+ tmpRepository.close();
+ // use repository instance from RepositoryCache!
+ this.gitDir = gitDir;
+ this.repository = Activator.getDefault().getRepositoryCache().lookupRepository(gitDir);
+ this.workdirPrefix = getWorkdirPrefix(repository);
+ workdirPrefix = workdirPrefix.replace('\\', '/');
+ if (!workdirPrefix.endsWith("/")) //$NON-NLS-1$
+ workdirPrefix += "/"; //$NON-NLS-1$
+ }
+
+ private String getWorkdirPrefix(Repository repository) {
+ String workdirPrefix = repository.getWorkTree().getAbsolutePath();
+ try {
+ workdirPrefix = repository.getWorkTree().getCanonicalPath();
+ } catch (IOException err) {
+ // ignore;
+ }
+ return workdirPrefix;
+ }
+
+ /**
+ * Creates a test repository from an existing Repository
+ *
+ * @param repository
+ * @throws IOException
+ */
+ public TestRepository(Repository repository) throws IOException {
+ this.repository = repository;
+ try {
+ workdirPrefix = repository.getWorkTree().getCanonicalPath();
+ } catch (IOException err) {
+ workdirPrefix = repository.getWorkTree().getAbsolutePath();
+ }
+ workdirPrefix = workdirPrefix.replace('\\', '/');
+ if (!workdirPrefix.endsWith("/")) //$NON-NLS-1$
+ workdirPrefix += "/"; //$NON-NLS-1$
+ }
+
+ /**
+ * @return the wrapped repository
+ */
+ public Repository getRepository() {
+ return repository;
+ }
+
+ /**
+ * create an initial commit containing a file "dummy" in the
+ *
+ * @param message
+ * commit message
+ * @return commit object
+ * @throws IOException
+ * @throws NoHeadException
+ * @throws NoMessageException
+ * @throws ConcurrentRefUpdateException
+ * @throws JGitInternalException
+ * @throws WrongRepositoryStateException
+ */
+ public RevCommit createInitialCommit(String message) throws IOException,
+ NoHeadException, NoMessageException, ConcurrentRefUpdateException,
+ JGitInternalException, WrongRepositoryStateException {
+ String repoPath = repository.getWorkTree().getAbsolutePath();
+ File file = new File(repoPath, "dummy");
+ if (!file.exists())
+ FileUtils.createNewFile(file);
+ track(file);
+ return commit(message);
+ }
+
+ /**
+ * Create a file or get an existing one
+ *
+ * @param project
+ * instance of project inside with file will be created
+ * @param name
+ * name of file
+ * @return nearly created file
+ * @throws IOException
+ */
+ public File createFile(IProject project, String name) throws IOException {
+ String path = project.getLocation().append(name).toOSString();
+ int lastSeparator = path.lastIndexOf(File.separator);
+ FileUtils.mkdirs(new File(path.substring(0, lastSeparator)), true);
+
+ File file = new File(path);
+ if (!file.exists())
+ FileUtils.createNewFile(file);
+
+ return file;
+ }
+
+ public File createFile(String name, String data) throws IOException {
+ File file = new File(repository.getWorkTree(), name);
+ write(file, data);
+ return file;
+ }
+
+ private void write(final File file, final String data) throws IOException {
+ FileUtils.mkdirs(file.getParentFile(), true);
+ Writer w = new OutputStreamWriter(new FileOutputStream(file), "UTF-8");
+ try {
+ w.write(data);
+ } finally {
+ w.close();
+ }
+ }
+
+ /**
+ * Track, add to index and finally commit given file
+ *
+ * @param project
+ * @param file
+ * @param commitMessage
+ * @return commit object
+ * @throws Exception
+ */
+ public RevCommit addAndCommit(IProject project, File file, String commitMessage)
+ throws Exception {
+ track(file);
+ addToIndex(project, file);
+
+ return commit(commitMessage);
+ }
+
+ public RevCommit addAndCommit(File file, String commitMessage)
+ throws Exception {
+ track(file);
+ addToIndex(file);
+
+ return commit(commitMessage);
+ }
+
+ /**
+ * Appends file content to given file, then track, add to index and finally
+ * commit it.
+ *
+ * @param project
+ * @param file
+ * @param content
+ * @param commitMessage
+ * @return commit object
+ * @throws Exception
+ */
+ public RevCommit appendContentAndCommit(IProject project, File file,
+ byte[] content, String commitMessage) throws Exception {
+ return appendContentAndCommit(project, file, new String(content),
+ commitMessage);
+ }
+
+ /**
+ * Appends file content to given file, then track, add to index and finally
+ * commit it.
+ *
+ * @param project
+ * @param file
+ * @param content
+ * @param commitMessage
+ * @return commit object
+ * @throws Exception
+ */
+ public RevCommit appendContentAndCommit(IProject project, File file,
+ String content, String commitMessage) throws Exception {
+ appendFileContent(file, content);
+ track(file);
+ addToIndex(project, file);
+
+ return commit(commitMessage);
+ }
+
+ /**
+ * Commits the current index
+ *
+ * @param message
+ * commit message
+ * @return commit object
+ *
+ * @throws NoHeadException
+ * @throws NoMessageException
+ * @throws UnmergedPathException
+ * @throws ConcurrentRefUpdateException
+ * @throws JGitInternalException
+ * @throws WrongRepositoryStateException
+ */
+ public RevCommit commit(String message) throws NoHeadException,
+ NoMessageException, UnmergedPathException,
+ ConcurrentRefUpdateException, JGitInternalException,
+ WrongRepositoryStateException {
+ Git git = new Git(repository);
+ CommitCommand commitCommand = git.commit();
+ commitCommand.setAuthor("J. Git", "j.git(a)egit.org");
+ commitCommand.setCommitter(commitCommand.getAuthor());
+ commitCommand.setMessage(message);
+ return commitCommand.call();
+ }
+
+ public void track(IFile file) throws IOException {
+ track(new File(file.getLocation().toOSString()));
+ }
+
+ /**
+ * Adds file to version control
+ *
+ * @param file
+ * @throws IOException
+ */
+ public void track(File file) throws IOException {
+ String repoPath = getRepoRelativePath(
+ new Path(file.getPath()).toString());
+ try {
+ new Git(repository).add().addFilepattern(repoPath).call();
+ } catch (NoFilepatternException e) {
+ throw new IOException(e.getMessage());
+ }
+ }
+
+ /**
+ * Creates a new branch and immediately checkout it.
+ *
+ * @param refName
+ * starting point for the new branch
+ * @param newRefName
+ * @throws Exception
+ */
+ public void createAndCheckoutBranch(String refName, String newRefName) throws Exception {
+ createBranch(refName, newRefName);
+ checkoutBranch(newRefName);
+ }
+
+ /**
+ * Creates a new branch
+ *
+ * @param refName
+ * starting point for the new branch
+ * @param newRefName
+ * @throws IOException
+ */
+ public void createBranch(String refName, String newRefName)
+ throws IOException {
+ RefUpdate updateRef;
+ updateRef = repository.updateRef(newRefName);
+ Ref startRef = repository.getRef(refName);
+ ObjectId startAt = repository.resolve(refName);
+ String startBranch;
+ if (startRef != null)
+ startBranch = refName;
+ else
+ startBranch = startAt.name();
+ startBranch = Repository.shortenRefName(startBranch);
+ updateRef.setNewObjectId(startAt);
+ updateRef
+ .setRefLogMessage("branch: Created from " + startBranch, false); //$NON-NLS-1$
+ updateRef.update();
+ }
+
+ /**
+ * Checkouts branch
+ *
+ * @param refName
+ * full name of branch
+ * @throws CoreException
+ */
+ public void checkoutBranch(String refName) throws CoreException {
+ new BranchOperation(repository, refName).execute(null);
+ }
+
+ /**
+ * Adds the given file to the index
+ *
+ * @param project
+ * @param file
+ * @throws Exception
+ */
+ public void addToIndex(IProject project, File file) throws Exception {
+ IFile iFile = getIFile(project, file);
+ addToIndex(iFile);
+ }
+
+ /**
+ * Adds the given file to the index
+ *
+ * @param file
+ * @throws CoreException
+ * @throws IOException
+ */
+ public void addToIndex(IFile file) throws CoreException, IOException {
+ String repoPath = getRepoRelativePath(file.getLocation().toOSString());
+ try {
+ new Git(repository).add().addFilepattern(repoPath).call();
+ } catch (NoFilepatternException e) {
+ throw new IOException(e.getMessage());
+ }
+ }
+
+ public void addToIndex(File file) throws CoreException, IOException {
+ String repoPath = getRepoRelativePath(file.getAbsolutePath());
+ try {
+ new Git(repository).add().addFilepattern(repoPath).call();
+ } catch (NoFilepatternException e) {
+ throw new IOException(e.getMessage());
+ }
+ }
+
+ /**
+ * Appends content to end of given file.
+ *
+ * @param file
+ * @param content
+ * @throws IOException
+ */
+ public void appendFileContent(File file, byte[] content) throws IOException {
+ appendFileContent(file, new String(content), true);
+ }
+
+ /**
+ * Appends content to end of given file.
+ *
+ * @param file
+ * @param content
+ * @throws IOException
+ */
+ public void appendFileContent(File file, String content) throws IOException {
+ appendFileContent(file, content, true);
+ }
+
+ /**
+ * Appends content to given file.
+ *
+ * @param file
+ * @param content
+ * @param append
+ * if true, then bytes will be written to the end of the file
+ * rather than the beginning
+ * @throws IOException
+ */
+ public void appendFileContent(File file, byte[] content, boolean append)
+ throws IOException {
+ appendFileContent(file, new String(content), append);
+ }
+
+ /**
+ * Appends content to given file.
+ *
+ * @param file
+ * @param content
+ * @param append
+ * if true, then bytes will be written to the end of the file
+ * rather than the beginning
+ * @throws IOException
+ */
+ public void appendFileContent(File file, String content, boolean append)
+ throws IOException {
+ FileWriter fw = null;
+ try {
+ fw = new FileWriter(file, append);
+ fw.append(content);
+ } finally {
+ if (fw != null)
+ fw.close();
+ }
+ }
+
+ /**
+ * Checks if a file with the given path exists in the HEAD tree
+ *
+ * @param path
+ * @return true if the file exists
+ * @throws IOException
+ */
+ public boolean inHead(String path) throws IOException {
+ ObjectId headId = repository.resolve(Constants.HEAD);
+ RevWalk rw = new RevWalk(repository);
+ TreeWalk tw = null;
+ try {
+ tw = TreeWalk.forPath(repository, path, rw.parseTree(headId));
+ return tw != null;
+ } finally {
+ rw.release();
+ rw.dispose();
+ if (tw != null)
+ tw.release();
+ }
+ }
+
+ public boolean inIndex(String path) throws IOException {
+ return getDirCacheEntry(path) != null;
+ }
+
+ public boolean removedFromIndex(String path) throws IOException {
+ DirCacheEntry dc = getDirCacheEntry(path);
+ if (dc == null)
+ return true;
+
+ Ref ref = repository.getRef(Constants.HEAD);
+ RevCommit c = new RevWalk(repository).parseCommit(ref.getObjectId());
+ TreeWalk tw = TreeWalk.forPath(repository, path, c.getTree());
+
+ return tw == null || dc.getObjectId().equals(tw.getObjectId(0));
+ }
+
+ public long lastModifiedInIndex(String path) throws IOException {
+ String repoPath = getRepoRelativePath(path);
+ DirCache dc = DirCache.read(repository.getIndexFile(), repository.getFS());
+
+ return dc.getEntry(repoPath).getLastModified();
+ }
+
+ public int getDirCacheEntryLength(String path) throws IOException {
+ String repoPath = getRepoRelativePath(path);
+ DirCache dc = DirCache.read(repository.getIndexFile(), repository.getFS());
+
+ return dc.getEntry(repoPath).getLength();
+ }
+
+ public String getRepoRelativePath(String path) {
+ final int pfxLen = workdirPrefix.length();
+ final int pLen = path.length();
+ if (pLen > pfxLen)
+ return path.substring(pfxLen);
+ else if (path.length() == pfxLen - 1)
+ return ""; //$NON-NLS-1$
+ return null;
+ }
+
+ public IFile getIFile(IProject project, File file) throws CoreException {
+ String relativePath = getRepoRelativePath(file.getAbsolutePath());
+
+ String quotedProjectName = Pattern.quote(project.getName());
+ relativePath = relativePath.replaceFirst(quotedProjectName, "");
+
+ IFile iFile = project.getFile(relativePath);
+ iFile.refreshLocal(0, null);
+
+ return iFile;
+ }
+
+ public void dispose() throws IOException {
+ repository.close();
+ remove();
+ repository = null;
+ }
+
+ public void remove() throws IOException {
+ File repositoryDirectory = repository.getDirectory();
+ File repositoryParent = repositoryDirectory.getParentFile();
+ if (repositoryParent.exists()) {
+ FileUtils.delete(repositoryParent, FileUtils.RECURSIVE | FileUtils.RETRY);
+ }
+ }
+
+ /**
+ * Connect a project to this repository
+ *
+ * @param project
+ * @throws CoreException
+ */
+ public void connect(IProject project) throws CoreException {
+ ConnectProviderOperation op = new ConnectProviderOperation(project,
+ this.getRepository().getDirectory());
+ op.execute(null);
+ }
+
+ /**
+ * Disconnects provider from project
+ *
+ * @param project
+ * @throws CoreException
+ */
+ public void disconnect(IProject project) throws CoreException {
+ Collection<IProject> projects = Collections.singleton(project
+ .getProject());
+ DisconnectProviderOperation disconnect = new DisconnectProviderOperation(
+ projects);
+ disconnect.execute(null);
+ }
+
+ private DirCacheEntry getDirCacheEntry(String path) throws IOException {
+ String repoPath = getRepoRelativePath(path);
+ DirCache dc = DirCache.read(repository.getIndexFile(), repository.getFS());
+
+ return dc.getEntry(repoPath);
+ }
+
+ public TestRepository cloneRepository(File path) throws URISyntaxException, InvocationTargetException,
+ InterruptedException, IOException {
+ URIish uri = new URIish("file:///" + repository.getDirectory().toString());
+ CloneOperation clop =
+ new CloneOperation(uri, true, null, path, Constants.R_HEADS + Constants.MASTER,
+ Constants.DEFAULT_REMOTE_NAME, 0);
+ clop.run(null);
+ RepositoryCache repositoryCache = Activator.getDefault().getRepositoryCache();
+ Repository clonedRepository = repositoryCache
+ .lookupRepository(new File(path, Constants.DOT_GIT));
+ return new TestRepository(clonedRepository);
+ }
+
+ public void setUserAndEmail(String user, String email) {
+ StoredConfig config = repository.getConfig();
+ config.setString(
+ ConfigConstants.CONFIG_USER_SECTION, null, ConfigConstants.CONFIG_KEY_NAME, user);
+ config.setString(
+ ConfigConstants.CONFIG_USER_SECTION, null, ConfigConstants.CONFIG_KEY_EMAIL, email);
+ }
+
+ public void createMockSystemReader(IPath ceilingPath) {
+ MockSystemReader mockSystemReader = new MockSystemReader();
+ SystemReader.setInstance(mockSystemReader);
+ mockSystemReader.setProperty(Constants.GIT_CEILING_DIRECTORIES_KEY, ceilingPath.toOSString());
+ }
+
+ public File getGitDir() {
+ return gitDir;
+ }
+
+ public void addRemoteTo(String remoteName, Repository remoteRepository)
+ throws URISyntaxException, MalformedURLException,
+ IOException {
+ StoredConfig config = repository.getConfig();
+ RemoteConfig remoteConfig = new RemoteConfig(config, remoteName);
+ URIish uri = new URIish(remoteRepository.getDirectory().toURI().toURL());
+ remoteConfig.addURI(uri);
+ remoteConfig.update(config);
+ config.save();
+ }
+
+}
Added: trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/util/TestUtils.java
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/util/TestUtils.java (rev 0)
+++ trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/util/TestUtils.java 2011-10-24 11:48:54 UTC (rev 35929)
@@ -0,0 +1,271 @@
+/*******************************************************************************
+ * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg(a)dewire.com>
+ * Copyright (C) 2010, Jens Baumgart <jens.baumgart(a)sap.com>
+ * Copyright (C) 2010, Mathias Kinzler <mathias.kinzler(a)sap.com>
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.jboss.tools.openshift.egit.internal.test.util;
+
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.egit.core.project.RepositoryMapping;
+import org.eclipse.jgit.lib.Constants;
+import org.eclipse.jgit.lib.ObjectId;
+import org.eclipse.jgit.lib.Repository;
+import org.eclipse.jgit.treewalk.TreeWalk;
+import org.eclipse.jgit.util.FS;
+import org.eclipse.jgit.util.FileUtils;
+
+public class TestUtils {
+
+ public final static String AUTHOR = "The Author <The.author(a)some.com>";
+
+ public final static String COMMITTER = "The Commiter <The.committer(a)some.com>";
+
+ /**
+ * Create a "temporary" directory
+ *
+ * @param name
+ * the name of the directory
+ * @return a directory as child of a "temporary" folder in the user home
+ * directory; may or may not exist
+ * @throws IOException
+ */
+ public File createTempDir(String name) throws IOException {
+ File userHome = FS.DETECTED.userHome();
+ File rootDir = new File(userHome, "EGitCoreTestTempDir");
+ File result = new File(rootDir, name);
+ if (result.exists())
+ FileUtils.delete(result, FileUtils.RECURSIVE | FileUtils.RETRY);
+ return result;
+ }
+
+ public static File createGitDir(TestProject testProject) throws IOException {
+ return new File(testProject.getProject().getLocation().toFile(), Constants.DOT_GIT);
+ }
+
+ /**
+ * Cleanup: delete the "temporary" folder and all children
+ *
+ * @throws IOException
+ */
+ public void deleteTempDirs() throws IOException {
+ File userHome = FS.DETECTED.userHome();
+ File rootDir = new File(userHome, "EGitCoreTestTempDir");
+ if (rootDir.exists())
+ FileUtils.delete(rootDir, FileUtils.RECURSIVE | FileUtils.RETRY);
+ }
+
+ /**
+ * Read the stream into a String
+ *
+ * @param inputStream
+ * @return the contents of the stream
+ * @throws IOException
+ */
+ public String slurpAndClose(InputStream inputStream) throws IOException {
+ StringBuilder stringBuilder = new StringBuilder();
+ try {
+ int ch;
+ while ((ch = inputStream.read()) != -1) {
+ stringBuilder.append((char) ch);
+ }
+ } finally {
+ inputStream.close();
+ }
+ return stringBuilder.toString();
+ }
+
+ /**
+ * Add a file to an existing project
+ *
+ * @param project
+ * the project
+ * @param path
+ * e.g. "folder1/folder2/test.txt"
+ * @param content
+ * the contents
+ * @return the file
+ * @throws Exception
+ * if the file can not be created
+ */
+ public IFile addFileToProject(IProject project, String path, String content)
+ throws Exception {
+ IPath filePath = new Path(path);
+ IFolder folder = null;
+ for (int i = 0; i < filePath.segmentCount() - 1; i++) {
+ if (folder == null) {
+ folder = project.getFolder(filePath.segment(i));
+ } else {
+ folder = folder.getFolder(filePath.segment(i));
+ }
+ if (!folder.exists())
+ folder.create(false, true, null);
+ }
+ IFile file = project.getFile(filePath);
+ file.create(new ByteArrayInputStream(content.getBytes(project
+ .getDefaultCharset())), true, null);
+ return file;
+ }
+
+ /**
+ * Change the content of a file
+ *
+ * @param project
+ * @param file
+ * @param newContent
+ * @return the file
+ * @throws Exception
+ */
+ public IFile changeContentOfFile(IProject project, IFile file, String newContent)
+ throws Exception {
+ file.setContents(new ByteArrayInputStream(newContent.getBytes(project
+ .getDefaultCharset())), 0, null);
+ return file;
+ }
+
+ /**
+ * Create a project in the local file system
+ *
+ * @param parentFile
+ * the parent
+ * @param projectName
+ * project name
+ * @return the project with a location pointing to the local file system
+ * @throws Exception
+ */
+ public IProject createProjectInLocalFileSystem(File parentFile,
+ String projectName) throws Exception {
+ IProject project = ResourcesPlugin.getWorkspace().getRoot()
+ .getProject(projectName);
+ if (project.exists()) {
+ project.delete(true, null);
+ }
+ File testFile = new File(parentFile, projectName);
+ if (testFile.exists())
+ FileUtils.delete(testFile, FileUtils.RECURSIVE | FileUtils.RETRY);
+
+ IProjectDescription desc = ResourcesPlugin.getWorkspace()
+ .newProjectDescription(projectName);
+ desc.setLocation(new Path(new File(parentFile, projectName).getPath()));
+ project.create(desc, null);
+ project.open(null);
+ return project;
+ }
+
+ /**
+ * verifies that repository contains exactly the given files.
+ * @param repository
+ * @param paths
+ * @throws Exception
+ */
+ public void assertRepositoryContainsFiles(Repository repository,
+ String[] paths) throws Exception {
+ Set<String> expectedfiles = new HashSet<String>();
+ for (String path : paths)
+ expectedfiles.add(path);
+ TreeWalk treeWalk = new TreeWalk(repository);
+ treeWalk.addTree(repository.resolve("HEAD^{tree}"));
+ treeWalk.setRecursive(true);
+ while (treeWalk.next()) {
+ String path = treeWalk.getPathString();
+ if (!expectedfiles.contains(path))
+ fail("Repository contains unexpected expected file " + path);
+ expectedfiles.remove(path);
+ }
+ if (expectedfiles.size() > 0) {
+ StringBuilder message = new StringBuilder(
+ "Repository does not contain expected files: ");
+ for (String path : expectedfiles) {
+ message.append(path);
+ message.append(" ");
+ }
+ fail(message.toString());
+ }
+ }
+
+ /**
+ * verifies that repository contains exactly the given files with the given
+ * content. Usage example:<br>
+ *
+ * <code>
+ * assertRepositoryContainsFiles(repository, "foo/a.txt", "content of A",
+ * "foo/b.txt", "content of B")
+ * </code>
+ * @param repository
+ * @param args
+ * @throws Exception
+ */
+ public void assertRepositoryContainsFilesWithContent(Repository repository,
+ String... args) throws Exception {
+ HashMap<String, String> expectedfiles = mkmap(args);
+ TreeWalk treeWalk = new TreeWalk(repository);
+ treeWalk.addTree(repository.resolve("HEAD^{tree}"));
+ treeWalk.setRecursive(true);
+ while (treeWalk.next()) {
+ String path = treeWalk.getPathString();
+ assertTrue(expectedfiles.containsKey(path));
+ ObjectId objectId = treeWalk.getObjectId(0);
+ byte[] expectedContent = expectedfiles.get(path).getBytes();
+ byte[] repoContent = treeWalk.getObjectReader().open(objectId)
+ .getBytes();
+ if (!Arrays.equals(repoContent, expectedContent)) {
+ fail("File " + path + " has repository content "
+ + new String(repoContent)
+ + " instead of expected content "
+ + new String(expectedContent));
+ }
+ expectedfiles.remove(path);
+ }
+ if (expectedfiles.size() > 0) {
+ StringBuilder message = new StringBuilder(
+ "Repository does not contain expected files: ");
+ for (String path : expectedfiles.keySet()) {
+ message.append(path);
+ message.append(" ");
+ }
+ fail(message.toString());
+ }
+ }
+
+ private static HashMap<String, String> mkmap(String... args) {
+ if ((args.length % 2) > 0)
+ throw new IllegalArgumentException("needs to be pairs");
+ HashMap<String, String> map = new HashMap<String, String>();
+ for (int i = 0; i < args.length; i += 2) {
+ map.put(args[i], args[i+1]);
+ }
+ return map;
+ }
+
+ public String getPathInRepository(IResource resource) {
+ RepositoryMapping mapping = RepositoryMapping.getMapping(resource);
+ if (mapping == null) {
+ throw new IllegalArgumentException(resource + " is not in any repository");
+ }
+ return mapping.getRepoRelativePath(resource);
+ }
+
+}
13 years, 2 months
JBoss Tools SVN: r35928 - in trunk/openshift: plugins/org.jboss.tools.openshift.egit.ui/META-INF and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-10-24 07:30:48 -0400 (Mon, 24 Oct 2011)
New Revision: 35928
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.egit.core/META-INF/MANIFEST.MF
trunk/openshift/plugins/org.jboss.tools.openshift.egit.ui/META-INF/MANIFEST.MF
trunk/openshift/plugins/org.jboss.tools.openshift.express.client/META-INF/MANIFEST.MF
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java
trunk/openshift/tests/org.jboss.tools.openshift.express.client.test/META-INF/MANIFEST.MF
Log:
JBIDE-10013 - compile errors in workspace after transition
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.egit.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.egit.core/META-INF/MANIFEST.MF 2011-10-24 10:57:22 UTC (rev 35927)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.egit.core/META-INF/MANIFEST.MF 2011-10-24 11:30:48 UTC (rev 35928)
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: Bundle-Name
Bundle-SymbolicName: org.jboss.tools.openshift.egit.core;singleton:=true
-Bundle-Version: 2.3.0.qualifier
+Bundle-Version: 1.0.0.qualifier
Bundle-Activator: org.jboss.tools.openshift.egit.core.internal.EGitCoreActivator
Require-Bundle: org.jboss.ide.eclipse.as.core;bundle-version="2.3.0",
org.eclipse.jgit;bundle-version="[1.0.0,2.1.0)",
@@ -17,5 +17,5 @@
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: Bundle-Vendor
Export-Package: org.jboss.tools.openshift.egit.core,
- org.jboss.tools.openshift.egit.core.internal;x-friends:="org.jboss.ide.eclipse.as.egit.test",
+ org.jboss.tools.openshift.egit.core.internal,
org.jboss.tools.openshift.egit.core.module
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.egit.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.egit.ui/META-INF/MANIFEST.MF 2011-10-24 10:57:22 UTC (rev 35927)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.egit.ui/META-INF/MANIFEST.MF 2011-10-24 11:30:48 UTC (rev 35928)
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: EGit integration UI
Bundle-SymbolicName: org.jboss.tools.openshift.egit.ui;singleton:=true
-Bundle-Version: 2.3.0.qualifier
+Bundle-Version: 1.0.0.qualifier
Bundle-Activator: org.jboss.tools.openshift.egit.ui.EGitUIActivator
Require-Bundle: org.eclipse.egit.core;bundle-version="1.0.0",
org.eclipse.jgit;bundle-version="1.0.0",
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.client/META-INF/MANIFEST.MF
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.client/META-INF/MANIFEST.MF 2011-10-24 10:57:22 UTC (rev 35927)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.client/META-INF/MANIFEST.MF 2011-10-24 11:30:48 UTC (rev 35928)
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: OpenShift Core Plugin
Bundle-SymbolicName: org.jboss.tools.openshift.express.client
-Bundle-Version: 2.3.0.qualifier
+Bundle-Version: 1.0.0.qualifier
Bundle-Activator: org.jboss.tools.openshift.express.internal.client.OpenShiftCoreActivator
Bundle-Vendor: JBoss by Red Hat
Require-Bundle: org.eclipse.core.runtime,
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF 2011-10-24 10:57:22 UTC (rev 35927)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF 2011-10-24 11:30:48 UTC (rev 35928)
@@ -2,11 +2,9 @@
Bundle-ManifestVersion: 2
Bundle-Name: OpenShift UI
Bundle-SymbolicName: org.jboss.tools.openshift.express.ui;singleton:=true
-Bundle-Version: 2.3.0.qualifier
+Bundle-Version: 1.0.0.qualifier
Bundle-Activator: org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator
-Require-Bundle: org.jboss.tools.openshift.express.client;bundle-version="2.3.0",
- org.jboss.tools.openshift.egit.core,
- org.eclipse.egit.ui;bundle-version="[1.0.0,2.0.0)",
+Require-Bundle: org.eclipse.egit.ui;bundle-version="[1.0.0,2.0.0)",
org.eclipse.egit.core;bundle-version="[1.1.0,2.0.0)",
org.eclipse.jgit;bundle-version="[1.1.0,2.1.0)",
com.jcraft.jsch;bundle-version="0.1.44",
@@ -25,7 +23,9 @@
org.eclipse.wst.server.ui;bundle-version="[1.1.3,2.0.0)",
org.eclipse.ui.ide;bundle-version="3.7.0",
org.eclipse.m2e.core.ui;bundle-version="1.0.100",
- org.eclipse.wst.common.modulecore;bundle-version="1.2.100"
+ org.eclipse.wst.common.modulecore;bundle-version="1.2.100",
+ org.jboss.tools.openshift.express.client,
+ org.jboss.tools.openshift.egit.core
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: org.jboss.tools.common.databinding,
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java 2011-10-24 10:57:22 UTC (rev 35927)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java 2011-10-24 11:30:48 UTC (rev 35928)
@@ -15,7 +15,7 @@
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
-import org.jboss.ide.eclipse.as.egit.core.EGitUtils;
+import org.jboss.tools.openshift.egit.core.EGitUtils;
public class ExpressPublishMethod implements IJBossServerPublishMethod {
Modified: trunk/openshift/tests/org.jboss.tools.openshift.express.client.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.express.client.test/META-INF/MANIFEST.MF 2011-10-24 10:57:22 UTC (rev 35927)
+++ trunk/openshift/tests/org.jboss.tools.openshift.express.client.test/META-INF/MANIFEST.MF 2011-10-24 11:30:48 UTC (rev 35928)
@@ -5,7 +5,7 @@
Bundle-Version: 2.3.0.qualifier
Bundle-Activator: org.jboss.tools.openshift.express.internal.client.test.Activator
Bundle-Vendor: JBoss by Red Hat
-Require-Bundle: org.jboss.tools.openshift.express.client;bundle-version="2.3.0",
+Require-Bundle: org.jboss.tools.openshift.express.client,
org.junit;bundle-version="[4.8.0,5.0.0)",
org.eclipse.core.runtime;bundle-version="[3.7.0,4.0.0)"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
13 years, 2 months
JBoss Tools SVN: r35926 - trunk/forge/plugins/org.jboss.tools.forge.runtime.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2011-10-24 05:26:08 -0400 (Mon, 24 Oct 2011)
New Revision: 35926
Modified:
trunk/forge/plugins/org.jboss.tools.forge.runtime/build.properties
Log:
remove warning about empty source..
Modified: trunk/forge/plugins/org.jboss.tools.forge.runtime/build.properties
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.runtime/build.properties 2011-10-24 09:13:50 UTC (rev 35925)
+++ trunk/forge/plugins/org.jboss.tools.forge.runtime/build.properties 2011-10-24 09:26:08 UTC (rev 35926)
@@ -3,6 +3,4 @@
modules/,\
jboss-modules.jar
src.includes = *
-jars.compile.order = .
-source.. =
-
+jars.compile.order = .
13 years, 2 months
JBoss Tools SVN: r35925 - trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-24 05:13:50 -0400 (Mon, 24 Oct 2011)
New Revision: 35925
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java
Log:
[JBIDE-9857] inserted space between service user id and service user version - correcting "Java OpenShift/0.1.0 (org.jboss.tools.openshift.express.ui2.3.0.qualifier)" to "Java OpenShift/0.1.0 (org.jboss.tools.openshift.express.ui 2.3.0.qualifier)"
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java 2011-10-24 09:00:26 UTC (rev 35924)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java 2011-10-24 09:13:50 UTC (rev 35925)
@@ -27,7 +27,9 @@
*/
public class CredentialsWizardPageModel extends ObservableUIPojo {
- private static final String ID = OpenShiftUIActivator.PLUGIN_ID
+ private static final String ID =
+ OpenShiftUIActivator.PLUGIN_ID
+ + ' '
+ OpenShiftUIActivator.getDefault().getBundle().getVersion();
private static final String RHLOGIN_PREFS_KEY = "org.jboss.tools.openshift.express.internal.ui.wizard.CredentialsWizardModel_RHLOGIN";
13 years, 2 months