[hg] main-silver: fixing failing tests

  • From: Ondrej Vrabec < >
  • To:
  • Subject: [hg] main-silver: fixing failing tests
  • Date: Fri, 16 Aug 2013 08:56:47 -0700

changeset 434e2f3a2ce5 in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/434e2f3a2ce5
description:
        fixing failing tests

diffstat:

 
bugtracking/src/org/netbeans/modules/bugtracking/issuetable/Bundle.properties 
                        |   3 +-
 
bugtracking/src/org/netbeans/modules/bugtracking/issuetable/QueryTableCellRenderer.java
               |   3 +-
 
bugtracking/test/unit/src/org/netbeans/modules/bugtracking/issuetable/QueryTableCellRendererTest.java
 |  18 +++++-----
 3 files changed, 12 insertions(+), 12 deletions(-)

diffs (89 lines):

diff --git 
a/bugtracking/src/org/netbeans/modules/bugtracking/issuetable/Bundle.properties
 
b/bugtracking/src/org/netbeans/modules/bugtracking/issuetable/Bundle.properties
--- 
a/bugtracking/src/org/netbeans/modules/bugtracking/issuetable/Bundle.properties
+++ 
b/bugtracking/src/org/netbeans/modules/bugtracking/issuetable/Bundle.properties
@@ -58,7 +58,8 @@
 LBL_IssueStatusObsolete=Archived
 
 MSG_IssueStatusNew=\ - this task is new
-MSG_IssueStatusModified=\ - this task is modified -
+# {0} - list of modifications
+MSG_IssueStatusModified=\ - this task is modified - {0}
 MSG_IssueStatusObsolete=\ - this task doesn't belong to the query anymore
 
 CTL_Issue_Summary_Title=Summary
diff --git 
a/bugtracking/src/org/netbeans/modules/bugtracking/issuetable/QueryTableCellRenderer.java
 
b/bugtracking/src/org/netbeans/modules/bugtracking/issuetable/QueryTableCellRenderer.java
--- 
a/bugtracking/src/org/netbeans/modules/bugtracking/issuetable/QueryTableCellRenderer.java
+++ 
b/bugtracking/src/org/netbeans/modules/bugtracking/issuetable/QueryTableCellRenderer.java
@@ -359,8 +359,7 @@
                             break;
                         case MODIFIED :
                             
sb.append("<br>").append(issueModifiedFormat.format(new Object[] { 
labelModified }, new StringBuffer(), null)); // NOI18N
-                            sb.append(msgModified);
-                            sb.append(p.getRecentChanges());
+                            sb.append(MessageFormat.format(msgModified, 
p.getRecentChanges()));
                             break;
                     }
                 }
diff --git 
a/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/issuetable/QueryTableCellRendererTest.java
 
b/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/issuetable/QueryTableCellRendererTest.java
--- 
a/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/issuetable/QueryTableCellRendererTest.java
+++ 
b/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/issuetable/QueryTableCellRendererTest.java
@@ -60,7 +60,6 @@
 import org.junit.Test;
 import static org.junit.Assert.*;
 import org.netbeans.modules.bugtracking.*;
-import org.netbeans.modules.bugtracking.IssueImpl;
 import org.netbeans.modules.bugtracking.QueryImpl;
 import org.netbeans.modules.bugtracking.RepositoryImpl;
 import 
org.netbeans.modules.bugtracking.issuetable.QueryTableCellRenderer.TableCellStyle;
@@ -69,7 +68,7 @@
 import org.netbeans.modules.bugtracking.spi.*;
 import org.netbeans.modules.bugtracking.cache.IssueCache;
 import org.netbeans.modules.bugtracking.cache.IssueCache.IssueAccessor;
-import org.openide.nodes.Node;
+import org.netbeans.modules.bugtracking.util.UIUtils;
 import org.openide.nodes.Node.Property;
 import org.openide.util.Exceptions;
 import org.openide.util.Lookup;
@@ -110,9 +109,9 @@
         RendererRepository rendererRepository = new RendererRepository();
         RendererQuery rendererQuery = new RendererQuery(rendererRepository);
 
-        MessageFormat issueNewFormat       = getFormat("issueNewFormat");    
  // NOI18N
-        MessageFormat issueObsoleteFormat  = 
getFormat("issueObsoleteFormat"); // NOI18N
-        MessageFormat issueModifiedFormat  = 
getFormat("issueModifiedFormat"); // NOI18N
+        MessageFormat issueNewFormat       = getFormat("issueNewFormat", 
UIUtils.getTaskNewColor());           // NOI18N
+        MessageFormat issueObsoleteFormat  = 
getFormat("issueObsoleteFormat", UIUtils.getTaskObsoleteColor()); // NOI18N
+        MessageFormat issueModifiedFormat  = 
getFormat("issueModifiedFormat", UIUtils.getTaskModifiedColor()); // NOI18N
 
         Color newHighlightColor            = new Color(0x00b400);
         Color modifiedHighlightColor       = new Color(0x0000ff);
@@ -188,7 +187,7 @@
         assertEquals(defaultStyle.getBackground(), result.getBackground());
         assertEquals(defaultStyle.getForeground(), result.getForeground());
         assertEquals(issueModifiedFormat, result.getFormat());
-        assertEquals("<html>some value<br><font 
color=\"#0000FF\">Modified</font> - this task is modified - changed</html>", 
result.getTooltip());
+        assertEquals("<html>some value<br><font 
color=\"#0000ff\">Modified</font> - this task is modified - changed</html>", 
result.getTooltip());
 
 
         // modified issue, selected
@@ -202,7 +201,7 @@
         assertEquals(modifiedHighlightColor, result.getBackground());
         assertEquals(defaultStyle.getForeground(), result.getForeground());
         assertEquals(null, result.getFormat());
-        assertEquals("<html>some value<br><font 
color=\"#0000FF\">Modified</font> - this task is modified - changed</html>", 
result.getTooltip());
+        assertEquals("<html>some value<br><font 
color=\"#0000ff\">Modified</font> - this task is modified - changed</html>", 
result.getTooltip());
 
         // new issue, not selected
         rendererQuery.containsIssue = true;
@@ -273,8 +272,9 @@
         assertTrue(evenBackground.equals(new Color(0xf3f6fd)) || 
unevenBackground.equals(new Color(0xf3f6fd)));
     }
 
-    private static MessageFormat getFormat(String key) {
-        String format = NbBundle.getMessage(IssueTable.class, key);
+    private static MessageFormat getFormat (String key, Color c) {
+        String format = NbBundle.getMessage(IssueTable.class, key,
+                new Object[] { UIUtils.getColorString(c), "{0}" }); //NOI18N
         return new MessageFormat(format);
     }
 

[hg] main-silver: fixing failing tests

Ondrej Vrabec 08/16/2013

Project Features

About this Project

ConnectedDeveloper was started in November 2009, is owned by tpavek, and has 66 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close