You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2022/11/02 13:34:50 UTC

[GitHub] [commons-bcel] samabcde commented on a diff in pull request #162: improve test coverage to bcel/generic and UtilityTest

samabcde commented on code in PR #162:
URL: https://github.com/apache/commons-bcel/pull/162#discussion_r1011775699


##########
src/test/java/org/apache/bcel/generic/BREAKPOINTTest.java:
##########
@@ -0,0 +1,31 @@
+/*
+ * 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.apache.bcel.generic;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+class BREAKPOINTTest {
+    @Test
+    public void accept() {
+        CountVisitor countVisitor = new CountVisitor();
+        BREAKPOINT breakpoint = new BREAKPOINT();
+        breakpoint.accept(countVisitor);
+        assertEquals(1, countVisitor.getVisitBREAKPOINTCount());
+    }
+}

Review Comment:
   >58 new files for 1% more code coverage  
   
   This is due to wrong file name, surefire only includes:
   ```
             <includes>
               <include>**/*TestCase.java</include>
               <include>**/PerformanceTest.java</include>
             </includes>
   ```
   And what I added only target for increasing coverage. `CountVisitor` works like a mock to verify corresponding `visitXXX` method are called in the `accept()` method.
   
   >Files should end in a new line. Check all new files.
   Updated and I can see the new line in IDE. But Github diff does not show the newline, let me know if my fix actually work.
   



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org