public
Fork of myabc/nbgit
Description: NetBeans Git Module
Clone URL: git://github.com/lstoll/nbgit.git
Removed unused ServeAction.
Added dummy action, Stash Action.
Added XTest Integration Tests.
Attempted to configure XTest to build with org.openide.nodes API (not yet 
working).
myabc (author)
Wed Apr 09 19:34:48 -0700 2008
commit  1a045a690f89c480d9577fdebd12e9643210d2b9
tree    37493d0290ab7b57dae6b6c5452b73925d62111f
parent  da35830cd82b35605a97b4fc338d761eeeb46b45
...
9
10
11
 
 
 
 
 
 
12
...
9
10
11
12
13
14
15
16
17
18
0
@@ -9,3 +9,9 @@ nbm.homepage=http://open.ikonoklastik.com/
0
 nbm.module.author=Alex Coles
0
 nbm.needs.restart=true
0
 
0
+#qa-unit
0
+test.unit.cp.extra=
0
+test.unit.run.cp.extra=
0
+#qa-functional
0
+test.qa-functional.cp.extra=${openide.nodes.dir}/modules/org-openide-nodes.jar:\${openide.util.dir}/lib/org-openide-util.jar
0
+test.qa-functional.run.cp.extra=
0
\ No newline at end of file
...
104
105
106
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
108
109
...
237
238
239
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
240
241
242
...
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
...
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
0
@@ -104,6 +104,33 @@
0
                     </run-dependency>
0
                 </dependency>
0
                 <dependency>
0
+ <code-name-base>org.netbeans.modules.jellytools</code-name-base>
0
+ <build-prerequisite/>
0
+ <compile-dependency/>
0
+ <run-dependency>
0
+ <release-version>2</release-version>
0
+ <implementation-version/>
0
+ </run-dependency>
0
+ </dependency>
0
+ <dependency>
0
+ <code-name-base>org.netbeans.modules.jemmy.idemodule</code-name-base>
0
+ <build-prerequisite/>
0
+ <compile-dependency/>
0
+ <run-dependency>
0
+ <release-version>2</release-version>
0
+ <implementation-version/>
0
+ </run-dependency>
0
+ </dependency>
0
+ <dependency>
0
+ <code-name-base>org.netbeans.modules.junit</code-name-base>
0
+ <build-prerequisite/>
0
+ <compile-dependency/>
0
+ <run-dependency>
0
+ <release-version>2</release-version>
0
+ <implementation-version/>
0
+ </run-dependency>
0
+ </dependency>
0
+ <dependency>
0
                     <code-name-base>org.netbeans.modules.options.api</code-name-base>
0
                     <build-prerequisite/>
0
                     <compile-dependency/>
0
@@ -237,6 +264,24 @@
0
                     </run-dependency>
0
                 </dependency>
0
             </module-dependencies>
0
+ <test-dependencies>
0
+ <test-type>
0
+ <name>unit</name>
0
+ </test-type>
0
+ <test-type>
0
+ <name>qa-functional</name>
0
+ <test-dependency>
0
+ <code-name-base>org.openide.nodes</code-name-base>
0
+ <compile-dependency/>
0
+ <test/>
0
+ </test-dependency>
0
+ <test-dependency>
0
+ <code-name-base>org.openide.util</code-name-base>
0
+ <compile-dependency/>
0
+ <test/>
0
+ </test-dependency>
0
+ </test-type>
0
+ </test-dependencies>
0
             <public-packages/>
0
         </data>
0
     </configuration>
...
38
39
40
 
41
42
43
...
46
47
48
49
50
 
 
51
52
53
...
38
39
40
41
42
43
44
...
47
48
49
 
 
50
51
52
53
54
0
@@ -38,6 +38,7 @@
0
 # Version 2 license, then the option applies only if the new code is
0
 # made subject to such option by the copyright holder.
0
 
0
+CTL_SuperGitAction=GitAction
0
 OpenIDE-Module-Display-Category=Versioning
0
 OpenIDE-Module-Long-Description=\
0
     Integrates the Git version control system into NetBeans IDE. \
0
@@ -46,8 +47,8 @@ OpenIDE-Module-Name=Git
0
 OpenIDE-Module-Short-Description=Git Versioning System
0
 
0
 # Note: Changing the label below to &Git, breaks the app
0
-CTL_Git_MainMenu = &Git
0
-CTL_Git_DisplayName = Git
0
+CTL_Git_MainMenu = &Git2
0
+CTL_Git_DisplayName = Git2
0
 
0
 ## Annotator.java
0
 #{0} represents file name, {1} represents text annotations (branch name, status, etc.)
...
98
99
100
101
 
 
102
103
 
104
105
106
...
98
99
100
 
101
102
103
104
105
106
107
108
0
@@ -98,9 +98,11 @@ import org.openide.util.RequestProcessor;
0
 import org.openide.util.Utilities;
0
 
0
 /**
0
- * Responsible for coloring file labels and file icons in the IDE and providing IDE with menu items.
0
+ * Responsible for coloring file labels and file icons in the IDE and providing
0
+ * IDE with menu items.
0
  *
0
  * @author Maros Sandor
0
+ * @author alexbcoles
0
  */
0
 public class GitAnnotator extends VCSAnnotator {
0
 
...
44
45
46
47
48
 
 
49
50
51
52
53
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
55
56
...
59
60
61
62
63
64
 
65
66
67
...
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
 
 
 
 
 
 
85
86
87
88
89
90
91
92
93
94
95
 
 
96
97
98
99
100
101
102
103
104
105
106
107
 
 
108
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
110
111
112
 
 
113
...
44
45
46
 
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
...
94
95
96
 
 
 
97
98
99
100
...
103
104
105
 
 
 
 
 
 
 
106
107
108
109
110
111
112
113
114
115
116
117
 
 
 
 
 
 
 
 
 
 
118
119
120
 
 
 
 
 
 
 
 
 
 
 
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
 
180
181
182
0
@@ -44,13 +44,48 @@ made subject to such option by the copyright holder.
0
 <!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.1//EN" "http://www.netbeans.org/dtds/filesystem-1_1.dtd">
0
 <filesystem>
0
     <folder name="Actions">
0
- <attr name="position" intvalue="0"/>
0
         <folder name="Git">
0
+ <file name="org-netbeans-modules-git-SuperGitAction.instance"/>
0
+ <file name="org-netbeans-modules-git-ui-stash-StashAction.instance"/>
0
             <file name="org-netbeans-modules-git-ui-status-OpenVersioningAction.instance">
0
                 <attr name="instanceClass" stringvalue="org.netbeans.modules.git.ui.status.OpenVersioningAction"/>
0
             </file>
0
         </folder>
0
     </folder>
0
+
0
+ <folder name="Menu">
0
+ <folder name="Window">
0
+ <folder name="Versioning">
0
+ <file name="org-netbeans-modules-git-ui-status-OpenVersioningAction.shadow">
0
+ <attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/git/resources/icons/gitvcs-icon.png"/>
0
+ <attr name="originalFile" stringvalue="Actions/Git/org-netbeans-modules-git-ui-status-OpenVersioningAction.instance"/>
0
+ <attr name="position" intvalue="380"/>
0
+ </file>
0
+ </folder>
0
+ </folder>
0
+ </folder>
0
+
0
+ <folder name="Services">
0
+ <folder name="JavaHelp">
0
+ <file name="git-helpset.xml" url="git-helpset.xml">
0
+ <attr name="position" intvalue="3386"/>
0
+ </file>
0
+ </folder>
0
+ </folder>
0
+
0
+ <folder name="Windows2">
0
+ <folder name="Components">
0
+ <file name="gitversioning.settings" url="gitversioning.xml"/>
0
+ </folder>
0
+ <folder name="Modes">
0
+ <folder name="output">
0
+ <file name="gitversioning.wstcref" url="git_wstcref.xml">
0
+ <attr name="position" intvalue="625"/>
0
+ </file>
0
+ </folder>
0
+ </folder>
0
+ </folder>
0
+
0
     <folder name="Editors">
0
         <folder name="SideBar">
0
             <file name="org-netbeans-modules-git-ui-annotate-AnnotationBarManager.instance">
0
@@ -59,9 +94,7 @@ made subject to such option by the copyright holder.
0
             <!-- place in between line numbers sidebar and folding sidebar #57544 -->
0
         </folder>
0
         <folder name="AnnotationTypes">
0
- <file name="org-netbeans-modules-git-Annotation.xml" url="git_annotation.xml">
0
- <attr name="position" intvalue="7500"/>
0
- </file>
0
+ <file name="org-netbeans-modules-git-Annotation.xml" url="git_annotation.xml"/>
0
         </folder>
0
         <folder name="UpToDateStatusProvider">
0
             <file name="org-netbeans-modules-git-ui-annotate-AnnotationMarkInstaller.instance">
0
@@ -70,44 +103,80 @@ made subject to such option by the copyright holder.
0
         </folder>
0
     </folder>
0
 
0
- <folder name="Services">
0
- <folder name="JavaHelp">
0
- <file name="git-helpset.xml" url="git-helpset.xml">
0
- <attr name="position" stringvalue="3386"/>
0
- </file>
0
- </folder>
0
- </folder>
0
     <folder name="VersioningOptionsDialog">
0
         <file name="Git.instance">
0
             <attr name="instanceClass" stringvalue="org.netbeans.modules.git.options.GitAdvancedOption"/>
0
         </file>
0
     </folder>
0
+
0
+ <!--
0
+ <folder name="OptionsDialog">
0
+ <folder name="Actions">
0
+ <folder name="Subversion">
0
+ <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.subversion.resources.Bundle"/>
0
 
0
- <folder name="Windows2">
0
- <folder name="Components">
0
- <file name="gitversioning.settings" url="gitversioning.xml">
0
- <attr name="position" intvalue="1850"/>
0
- </file>
0
- </folder>
0
- <folder name="Modes">
0
- <folder name="output">
0
- <file name="gitversioning.wstcref" url="git_wstcref.xml">
0
- <attr name="position" intvalue="625"/>
0
+ <file name="OpenVersioning.shadow">
0
+ <attr name="originalFile" stringvalue="Actions/Subversion/org-netbeans-modules-subversion-ui-status-OpenVersioningAction.instance"/>
0
                 </file>
0
- </folder>
0
- </folder>
0
- </folder>
0
-
0
- <folder name="Menu">
0
- <folder name="Window">
0
- <folder name="Versioning">
0
- <file name="org-netbeans-modules-git-ui-status-OpenVersioningAction.shadow">
0
- <attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/git/resources/icons/gitvcs-icon.png"/>
0
- <attr name="originalFile" stringvalue="Actions/Git/org-netbeans-modules-git-ui-status-OpenVersioningAction.instance"/>
0
- <attr name="position" intvalue="380"/>
0
+ <file name="CheckoutAction.shadow">
0
+ <attr name="originalFile" stringvalue="Actions/Subversion/org-netbeans-modules-subversion-ui-checkout-CheckoutAction.instance"/>
0
                 </file>
0
+ <file name="ImportAction.shadow">
0
+ <attr name="originalFile" stringvalue="Actions/Subversion/org-netbeans-modules-subversion-ui-project-ImportAction.instance"/>
0
+ </file>
0
+ <file name="UpdateWithDependenciesAction.shadow">
0
+ <attr name="originalFile" stringvalue="Actions/Subversion/org-netbeans-modules-subversion-ui-UpdateWithDependenciesAction.instance"/>
0
+ </file>
0
+
0
+ <file name="StatusAction.shadow">
0
+ <attr name="originalFile" stringvalue="Actions/Subversion/org-netbeans-modules-subversion-ui-status-StatusAction.instance"/>
0
+ </file>
0
+ <file name="DiffAction.shadow">
0
+ <attr name="originalFile" stringvalue="Actions/Subversion/org-netbeans-modules-subversion-ui-diff-DiffAction.instance"/>
0
+ </file>
0
+ <file name="UpdateAction.shadow">
0
+ <attr name="originalFile" stringvalue="Actions/Subversion/org-netbeans-modules-subversion-ui-update-UpdateAction.instance"/>
0
+ </file>
0
+ <file name="CommitAction.shadow">
0
+ <attr name="originalFile" stringvalue="Actions/Subversion/org-netbeans-modules-subversion-ui-commit-CommitAction.instance"/>
0
+ </file>
0
+ <file name="ExcludeFromCommitAction.shadow">
0
+ <attr name="originalFile" stringvalue="Actions/Subversion/org-netbeans-modules-subversion-ui-commit-ExcludeFromCommitAction.instance"/>
0
+ </file>
0
+ <file name="ConflictResolvedAction.shadow">
0
+ <attr name="originalFile" stringvalue="Actions/Subversion/org-netbeans-modules-subversion-ui-commit-ConflictResolvedAction.instance"/>
0
+ </file>
0
+
0
+ <file name="CreateCopyAction.shadow">
0
+ <attr name="originalFile" stringvalue="Actions/Subversion/org-netbeans-modules-subversion-ui-copy-CreateCopyAction.instance"/>
0
+ </file>
0
+ <file name="SwitchToAction.shadow">
0
+ <attr name="originalFile" stringvalue="Actions/Subversion/org-netbeans-modules-subversion-ui-copy-SwitchToAction.instance"/>
0
+ </file>
0
+ <file name="MergeAction.shadow">
0
+ <attr name="originalFile" stringvalue="Actions/Subversion/org-netbeans-modules-subversion-ui-copy-MergeAction.instance"/>
0
+ </file>
0
+ <file name="BlameAction.shadow">
0
+ <attr name="originalFile" stringvalue="Actions/Subversion/org-netbeans-modules-subversion-ui-blame-BlameAction.instance"/>
0
+ </file>
0
+ <file name="SearchHistoryAction.shadow">
0
+ <attr name="originalFile" stringvalue="Actions/Subversion/org-netbeans-modules-subversion-ui-history-SearchHistoryAction.instance"/>
0
+ </file>
0
+ <file name="RevertModificationsAction.shadow">
0
+ <attr name="originalFile" stringvalue="Actions/Subversion/org-netbeans-modules-subversion-ui-update-RevertModificationsAction.instance"/>
0
+ </file>
0
+ <file name="ResolveConflictsAction.shadow">
0
+ <attr name="originalFile" stringvalue="Actions/Subversion/org-netbeans-modules-subversion-ui-update-ResolveConflictsAction.instance"/>
0
+ </file>
0
+ <file name="IgnoreAction.shadow">
0
+ <attr name="originalFile" stringvalue="Actions/Subversion/org-netbeans-modules-subversion-ui-ignore-IgnoreAction.instance"/>
0
+ </file>
0
+ <file name="SvnPropertiesAction.shadow">
0
+ <attr name="originalFile" stringvalue="Actions/Subversion/org-netbeans-modules-subversion-ui-properties-SvnPropertiesAction.instance"/>
0
+ </file>
0
             </folder>
0
         </folder>
0
     </folder>
0
-
0
+ -->
0
+
0
 </filesystem>
...
43
44
45
 
46
47
 
48
49
50
...
56
57
58
59
 
 
60
61
62
...
43
44
45
46
47
48
49
50
51
52
...
58
59
60
 
61
62
63
64
65
0
@@ -43,8 +43,10 @@ package org.netbeans.modules.git.ui.status;
0
 
0
 
0
 import java.awt.event.ActionEvent;
0
+import javax.swing.ImageIcon;
0
 import org.openide.util.HelpCtx;
0
 import org.openide.util.NbBundle;
0
+import org.openide.util.Utilities;
0
 
0
 /**
0
  * Open the Git view. It focuses recently opened view unless it's not
0
@@ -56,7 +58,8 @@ import org.openide.util.NbBundle;
0
 public class OpenVersioningAction extends ShowAllChangesAction {
0
 
0
     public OpenVersioningAction() {
0
- putValue("noIconInMenu", Boolean.TRUE); // NOI18N
0
+ putValue("noIconInMenu", Boolean.FALSE); // NOI18N
0
+ setIcon(new ImageIcon(Utilities.loadImage("org/netbeans/modules/git/resources/icons/versioning-view.png"))); // NOI18N
0
     }
0
 
0
     @Override
...
128
129
130
131
132
 
 
133
134
135
...
168
169
170
171
 
172
173
174
...
128
129
130
 
 
131
132
133
134
135
...
168
169
170
 
171
172
173
174
0
@@ -128,8 +128,8 @@ public class GitCommand {
0
     private static final String GIT_UPDATE_ALL_CMD = "update"; // NOI18N
0
     private static final String GIT_UPDATE_FORCE_ALL_CMD = "-C"; // NOI18N
0
     
0
- private static final String GIT_REMOVE_CMD = "remove"; // NOI18N
0
- private static final String GIT_REMOVE_FLAG_FORCE_CMD = "--force"; // NOI18N
0
+ private static final String GIT_REMOVE_CMD = "rm"; // NOI18N
0
+ private static final String GIT_REMOVE_FLAG_FORCE_CMD = "-f"; // NOI18N
0
     
0
     private static final String GIT_LOG_CMD = "log"; // NOI18N
0
     private static final String GIT_OUT_CMD = "out"; // NOI18N
0
@@ -168,7 +168,7 @@ public class GitCommand {
0
     private static final String GIT_EXPORT_CMD = "export"; // NOI18N
0
     private static final String GIT_IMPORT_CMD = "import"; // NOI18N
0
 
0
- private static final String GIT_RENAME_CMD = "rename"; // NOI18N
0
+ private static final String GIT_RENAME_CMD = "mv"; // NOI18N
0
     private static final String GIT_RENAME_AFTER_CMD = "-A"; // NOI18N
0
     private static final String GIT_PATH_DEFAULT_CMD = "paths"; // NOI18N
0
     private static final String GIT_PATH_DEFAULT_OPT = "default"; // NOI18N
...
5
6
7
 
 
 
8
 
 
 
 
 
 
 
 
 
 
 
 
 
9
10
11
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
 
 
14
...
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
0
@@ -5,10 +5,69 @@
0
 
0
 package org.netbeans.test.git.main.commit;
0
 
0
+import org.netbeans.junit.NbTestSuite;
0
+import org.netbeans.jellytools.JellyTestCase;
0
+
0
 /**
0
+ * A Test based on JellyTestCase. JellyTestCase redirects Jemmy output
0
+ * to a log file provided by NbTestCase. It can be inspected in results.
0
+ * It also sets timeouts necessary for NetBeans GUI testing.
0
+ *
0
+ * Any JemmyException (which is normally thrown as a result of an unsuccessful
0
+ * operation in Jemmy) going from a test is treated by JellyTestCase as a test
0
+ * failure; any other exception - as a test error.
0
+ *
0
+ * Additionally it:
0
+ * - closes all modal dialogs at the end of the test case (property jemmy.close.modal - default true)
0
+ * - generates component dump (XML file containing components information) in case of test failure (property jemmy.screen.xmldump - default false)
0
+ * - captures screen into a PNG file in case of test failure (property jemmy.screen.capture - default true)
0
+ * - waits at least 1000 ms between test cases (property jelly.wait.no.event - default true)
0
  *
0
  * @author alexbcoles
0
  */
0
-public class CommitDataTest {
0
+public class CommitDataTest extends JellyTestCase {
0
+
0
+ /** Default constructor.
0
+ * @param testName name of particular test case
0
+ */
0
+ public CommitDataTest(String name) {
0
+ super(name);
0
+ }
0
+
0
+ /** Creates suite from particular test cases. You can define order of testcases here. */
0
+ public static NbTestSuite suite() {
0
+ NbTestSuite suite = new NbTestSuite();
0
+ suite.addTest(new CommitDataTest("test1"));
0
+ suite.addTest(new CommitDataTest("test2"));
0
+ return suite;
0
+ }
0
+
0
+ /* Method allowing test execution directly from the IDE. */
0
+ public static void main(java.lang.String[] args) {
0
+ // run whole suite
0
+ junit.textui.TestRunner.run(suite());
0
+ // run only selected test case
0
+ //junit.textui.TestRunner.run(new CommitDataTest("test1"));
0
+ }
0
+
0
+ /** Called before every test case. */
0
+ @Override
0
+ public void setUp() {
0
+ System.out.println("######## "+getName()+" #######");
0
+ }
0
+
0
+ /** Called after every test case. */
0
+ @Override
0
+ public void tearDown() {
0
+ }
0
+
0
+ // Add test methods here, they have to start with 'test'.
0
+
0
+ /** Test case 1. */
0
+ public void test1() {
0
+ }
0
 
0
+ /** Test case 2. */
0
+ public void test2() {
0
+ }
0
 }
...
5
6
7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
9
 
10
11
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
...
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
0
@@ -5,10 +5,134 @@
0
 
0
 package org.netbeans.test.git.main.commit;
0
 
0
+import java.io.File;
0
+import java.io.PrintStream;
0
+import javax.swing.table.TableModel;
0
+import junit.textui.TestRunner;
0
+import org.netbeans.jellytools.JellyTestCase;
0
+import org.netbeans.jellytools.OutputOperator;
0
+import org.netbeans.jellytools.OutputTabOperator;
0
+import org.netbeans.jellytools.modules.javacvs.VersioningOperator;
0
+import org.netbeans.jellytools.nodes.Node;
0
+import org.netbeans.jellytools.nodes.SourcePackagesNode;
0
+import org.netbeans.jemmy.EventTool;
0
+import org.netbeans.jemmy.TimeoutExpiredException;
0
+import org.netbeans.junit.NbTestSuite;
0
+import org.netbeans.test.git.utils.TestKit;
0
+
0
 /**
0
  *
0
+ * @author peter pis
0
  * @author alexbcoles
0
  */
0
-public class IgnoreTest {
0
+public class IgnoreTest extends JellyTestCase {
0
+
0
+ public static final String PROJECT_NAME = "JavaApp";
0
+ public File projectPath;
0
+ public PrintStream stream;
0
+ String os_name;
0
+
0
+ /** Creates a new instance of IgnoreTest */
0
+ public IgnoreTest(String name) {
0
+ super(name);
0
+ }
0
+
0
+ @Override
0
+ protected void setUp() throws Exception {
0
+ os_name = System.getProperty("os.name");
0
+ //System.out.println(os_name);
0
+ System.out.println("### "+getName()+" ###");
0
+
0
+ }
0
+
0
+ protected boolean isUnix() {
0
+ boolean unix = false;
0
+ if (os_name.indexOf("Windows") == -1) {
0
+ unix = true;
0
+ }
0
+ return unix;
0
+ }
0
+
0
+ public static void main(String[] args) {
0
+ // TODO code application logic here
0
+ TestRunner.run(suite());
0
+ }
0
+
0
+ public static NbTestSuite suite() {
0
+ NbTestSuite suite = new NbTestSuite();
0
+ suite.addTest(new IgnoreTest("testIgnoreUnignoreFile"));
0
+ //suite.addTest(new IgnoreTest("testFinalRemove"));
0
+ return suite;
0
+ }
0
+
0
+ public void testIgnoreUnignoreFile() throws Exception {
0
+ //JemmyProperties.setCurrentTimeout("ComponentOperator.WaitComponentTimeout", 30000);
0
+ //JemmyProperties.setCurrentTimeout("DialogWaiter.WaitDialogTimeout", 30000);
0
+ try {
0
+ TestKit.showStatusLabels();
0
+ TestKit.closeProject(PROJECT_NAME);
0
+
0
+ OutputOperator oo = OutputOperator.invoke();
0
+
0
+ stream = new PrintStream(new File(getWorkDir(), getName() + ".log"));
0
+ TestKit.loadOpenProject(PROJECT_NAME, getDataDir());
0
 
0
+ TestKit.createNewElement(PROJECT_NAME, "javaapp", "NewClass");
0
+ Node node = new Node(new SourcePackagesNode(PROJECT_NAME), "javaapp|NewClass");
0
+ node.performPopupAction("Mercurial|Ignore");
0
+ OutputTabOperator oto = new OutputTabOperator("Mercurial");
0
+ oto.waitText("INFO: End of Ignore");
0
+
0
+ node = new Node(new SourcePackagesNode(PROJECT_NAME), "javaapp|NewClass");
0
+
0
+ org.openide.nodes.Node nodeIDE = (org.openide.nodes.Node) node.getOpenideNode();
0
+ String color = TestKit.getColor(nodeIDE.getHtmlDisplayName());
0
+ String status = TestKit.getStatus(nodeIDE.getHtmlDisplayName());
0
+ assertEquals("Wrong color of node - file color should be ignored!!!", TestKit.IGNORED_COLOR, color);
0
+ assertEquals("Wrong annotation of node - file status should be ignored!!!", TestKit.IGNORED_STATUS, status);
0
+
0
+ node = new Node(new SourcePackagesNode(PROJECT_NAME), "javaapp|NewClass");
0
+ TimeoutExpiredException tee = null;
0
+ try {
0
+ node.performPopupAction("Mercurial|Ignore");
0
+ } catch (Exception e) {
0
+ tee = (TimeoutExpiredException) e;
0
+ }
0
+ assertNotNull("Ignore action should be disabled!!!", tee);
0
+
0
+ //unignore file
0
+ oto = new OutputTabOperator("Mercurial");
0
+ oto.clear();
0
+ node = new Node(new SourcePackagesNode(PROJECT_NAME), "javaapp|NewClass");
0
+ node.performPopupAction("Mercurial|Unignore");
0
+ oto.waitText("INFO: End of Unignore");
0
+ node = new Node(new SourcePackagesNode(PROJECT_NAME), "javaapp|NewClass");
0
+ nodeIDE = (org.openide.nodes.Node) node.getOpenideNode();
0
+ color = TestKit.getColor(nodeIDE.getHtmlDisplayName());
0
+ status = TestKit.getStatus(nodeIDE.getHtmlDisplayName());
0
+ assertEquals("Wrong color of node - file color should be new!!!", TestKit.NEW_COLOR, color);
0
+ assertEquals("Wrong annotation of node - file status should be new!!!", TestKit.NEW_STATUS, status);
0
+
0
+ //verify content of Versioning view
0
+ node = new Node(new SourcePackagesNode(PROJECT_NAME), "javaapp|NewClass");
0
+ node.performPopupAction("Mercurial|Status");
0
+ new EventTool().waitNoEvent(1000);
0
+ VersioningOperator vo = VersioningOperator.invoke();
0
+ TableModel model = vo.tabFiles().getModel();
0
+ assertEquals("Versioning view should be empty", 1, model.getRowCount());
0
+ assertEquals("File should be listed in Versioning view", "NewClass.java", model.getValueAt(0, 0).toString());
0
+
0
+ stream.flush();
0
+ stream.close();
0
+
0
+ } catch (Exception e) {
0
+ throw new Exception("Test failed: " + e);
0
+ } finally {
0
+ TestKit.closeProject(PROJECT_NAME);
0
+ }
0
+ }
0
+
0
+ public void testFinalRemove() throws Exception {
0
+ TestKit.finalRemove();
0
+ }
0
 }

Comments

    No one has commented yet.