You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2020/02/25 18:29:06 UTC

[GitHub] [netbeans] blackleg opened a new pull request #1979: Improve testing in notifications module

blackleg opened a new pull request #1979: Improve testing in notifications module
URL: https://github.com/apache/netbeans/pull/1979
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] eirikbakke commented on a change in pull request #1979: Add tests in notifications module

Posted by GitBox <gi...@apache.org>.
eirikbakke commented on a change in pull request #1979: Add tests in notifications module
URL: https://github.com/apache/netbeans/pull/1979#discussion_r386041662
 
 

 ##########
 File path: ide/notifications/test/unit/src/org/netbeans/modules/notifications/StatusLineElementTest.java
 ##########
 @@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.notifications;
+
+import java.awt.Component;
+import org.junit.Test;
+import org.netbeans.junit.NbTestCase;
+import org.openide.awt.StatusLineElementProvider;
+import org.openide.util.Lookup;
+
+/**
+ *
+ * @author Hector Espert
+ */
+public class StatusLineElementTest extends NbTestCase {
+
+    public StatusLineElementTest(String name) {
+        super(name);
+    }
+
+    @Test
+    public void testGetStatusLineElement() {
+        StatusLineElementProvider statusLineElementProvider = Lookup.getDefault().lookup(StatusLineElementProvider.class);
+        assertNotNull(statusLineElementProvider);
+        assertEquals(StatusLineElement.class, statusLineElementProvider.getClass());
+        
+        Component component = statusLineElementProvider.getStatusLineElement();
+        assertNotNull(component);
+        assertEquals(FlashingIcon.class, component.getClass());
 
 Review comment:
   Maybe adding a comment here why we must make an assumption about which implementation class is used for the default? This is testing something that is not really guaranteed from the API.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] blackleg commented on a change in pull request #1979: Add tests in notifications module

Posted by GitBox <gi...@apache.org>.
blackleg commented on a change in pull request #1979: Add tests in notifications module
URL: https://github.com/apache/netbeans/pull/1979#discussion_r386097476
 
 

 ##########
 File path: ide/notifications/test/unit/src/org/netbeans/modules/notifications/NotificationSettingsTest.java
 ##########
 @@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.notifications;
+
+import org.junit.Test;
+import org.netbeans.junit.NbTestCase;
+
+/**
+ *
+ * @author Hector Espert
+ */
+public class NotificationSettingsTest extends NbTestCase {
+
+    public NotificationSettingsTest(String name) {
+        super(name);
+    }
+
+    @Test
+    public void testIsSearchVisible() {
+        NotificationSettings.setSearchVisible(false);
+        assertFalse(NotificationSettings.isSearchVisible());
 
 Review comment:
   I didn't see these fail, but I preferred to test these because they aren't a simple setter/getter.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] eirikbakke commented on a change in pull request #1979: Add tests in notifications module

Posted by GitBox <gi...@apache.org>.
eirikbakke commented on a change in pull request #1979: Add tests in notifications module
URL: https://github.com/apache/netbeans/pull/1979#discussion_r386041785
 
 

 ##########
 File path: ide/notifications/test/unit/src/org/netbeans/modules/notifications/NotificationSettingsTest.java
 ##########
 @@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.notifications;
+
+import org.junit.Test;
+import org.netbeans.junit.NbTestCase;
+
+/**
+ *
+ * @author Hector Espert
+ */
+public class NotificationSettingsTest extends NbTestCase {
+
+    public NotificationSettingsTest(String name) {
+        super(name);
+    }
+
+    @Test
+    public void testIsSearchVisible() {
+        NotificationSettings.setSearchVisible(false);
+        assertFalse(NotificationSettings.isSearchVisible());
 
 Review comment:
   Did you ever see these fail? If so, it would be good to add a comment about it.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] blackleg commented on a change in pull request #1979: Add tests in notifications module

Posted by GitBox <gi...@apache.org>.
blackleg commented on a change in pull request #1979: Add tests in notifications module
URL: https://github.com/apache/netbeans/pull/1979#discussion_r386097853
 
 

 ##########
 File path: ide/notifications/test/unit/src/org/netbeans/modules/notifications/StatusLineElementTest.java
 ##########
 @@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.notifications;
+
+import java.awt.Component;
+import org.junit.Test;
+import org.netbeans.junit.NbTestCase;
+import org.openide.awt.StatusLineElementProvider;
+import org.openide.util.Lookup;
+
+/**
+ *
+ * @author Hector Espert
+ */
+public class StatusLineElementTest extends NbTestCase {
+
+    public StatusLineElementTest(String name) {
+        super(name);
+    }
+
+    @Test
+    public void testGetStatusLineElement() {
+        StatusLineElementProvider statusLineElementProvider = Lookup.getDefault().lookup(StatusLineElementProvider.class);
+        assertNotNull(statusLineElementProvider);
+        assertEquals(StatusLineElement.class, statusLineElementProvider.getClass());
+        
+        Component component = statusLineElementProvider.getStatusLineElement();
+        assertNotNull(component);
+        assertEquals(FlashingIcon.class, component.getClass());
 
 Review comment:
   I added an error message in assert method indicating that FlashingIcon is the default implementation.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists