Updating to NBMs from NetBeans 8.0.1 as some of them are required to run on JDK8
1 package org.apidesign.sidemeanings.test;
3 import org.apidesign.sidemeanings.Protected;
6 public class ProtectedTest {
8 @Test public void testCallTenDoubleIncrementOnDirtyAPI() {
9 // BEGIN: sidemeanings.Protected.Dirty.test
10 class DoubleIncrement extends Protected.Dirty {
12 protected void increment() {
17 DoubleIncrement doubleIncr = new DoubleIncrement();
18 doubleIncr.incrementTenTimes();
19 doubleIncr.assertCounter(20);
20 // END: sidemeanings.Protected.Dirty.test
23 @Test public void testCallTenDoubleIncrementOnCleanAPI() {
24 // BEGIN: sidemeanings.Protected.Clean.test
25 class DoubleIncrement extends Protected.Clean {
27 protected void increment() {
28 // cannot be access directly, it is abstract:
30 // we need to call default implementation instead
35 DoubleIncrement doubleIncr = new DoubleIncrement();
36 doubleIncr.incrementTenTimes();
37 doubleIncr.assertCounter(20);
38 // END: sidemeanings.Protected.Clean.test