@@ -0,0 +1,3418 @@
+package com.kaching.platform.testing;%0A%0Aimport static com.kaching.platform.testing.VisibilityTestRunner.Intent.PRIVATE;%0Aimport static org.junit.Assert.*;%0A%0Aimport org.junit.Test;%0A%0Apublic class VisibilityTestRunnerTest %7B%0A%0A  @Test%0A  public void privateFieldMustBeVisibleByOwner() %7B%0A    VisibilityTestRunner runner = new VisibilityTestRunner(getClass());%0A    assertTrue(runner.isVisible(%0A        new ParsedElements.ParsedField(%0A            new ParsedElements.ParsedClass(%22java/util/HashMap%22), %22size%22),%0A        new ParsedElements.ParsedClass(%22java/util/HashMap%22), PRIVATE));%0A  %7D%0A  %0A  @Test%0A  public void privateFieldMustBeVisibleByInnerClass() %7B%0A    VisibilityTestRunner runner = new VisibilityTestRunner(getClass());%0A    assertTrue(runner.isVisible(%0A        new ParsedElements.ParsedField(%0A            new ParsedElements.ParsedClass(%22java/util/HashMap%22), %22size%22),%0A        new ParsedElements.ParsedClass(%22java/util/HashMap$Entry%22), PRIVATE));%0A  %7D%0A  %0A  @Test%0A  public void privateFieldMustBeVisibleByOuterClass() %7B%0A    VisibilityTestRunner runner = new VisibilityTestRunner(getClass());%0A    assertTrue(runner.isVisible(%0A        new ParsedElements.ParsedField(%0A            new ParsedElements.ParsedClass(%22java/util/HashMap$Entry%22), %22key%22),%0A        new ParsedElements.ParsedClass(%22java/util/HashMap%22), PRIVATE));%0A  %7D%0A  %0A  @Test%0A  public void privateFieldMustBeVisibleByAnonymousClass() %7B%0A    VisibilityTestRunner runner = new VisibilityTestRunner(getClass());%0A    assertTrue(runner.isVisible(%0A        new ParsedElements.ParsedField(%0A            new ParsedElements.ParsedClass(%22java/util/HashMap%22), %22size%22),%0A        new ParsedElements.ParsedClass(%22java/util/HashMap$1%22), PRIVATE));%0A  %7D%0A  %0A  @Test%0A  public void privateFieldMustNotBeVisibleByDifferentClass() %7B%0A    VisibilityTestRunner runner = new VisibilityTestRunner(getClass());%0A    assertFalse(runner.isVisible(%0A        new ParsedElements.ParsedField(%0A            new ParsedElements.ParsedClass(%22java/util/HashMap%22), %22size%22),%0A        new ParsedElements.ParsedClass(%22java/util/ArrayList%22), PRIVATE));%0A  %7D%0A  %0A  @Test%0A  public void privateFieldMustNotBeVisibleBySubclass() %7B%0A    VisibilityTestRunner runner = new VisibilityTestRunner(getClass());%0A    assertFalse(runner.isVisible(%0A        new ParsedElements.ParsedField(%0A            new ParsedElements.ParsedClass(%22java/util/HashMap%22), %22size%22),%0A        new ParsedElements.ParsedClass(%22org/apache/commons/collections/MultiHashMap%22), PRIVATE));%0A  %7D%0A  %0A  @Test%0A  public void privateInnerClassMustBeVisibleByOwner() %7B%0A    VisibilityTestRunner runner = new VisibilityTestRunner(getClass());%0A    assertTrue(runner.isVisible(%0A        new ParsedElements.ParsedClass(%22java/util/HashMap$Entry%22),%0A        new ParsedElements.ParsedClass(%22java/util/HashMap%22), PRIVATE));%0A  %7D%0A  %0A  @Test%0A  public void privateInnerClassMustBeVisibleByOtherInnerClass() %7B%0A    VisibilityTestRunner runner = new VisibilityTestRunner(getClass());%0A    assertTrue(runner.isVisible(%0A        new ParsedElements.ParsedClass(%22java/util/HashMap$Entry%22),%0A        new ParsedElements.ParsedClass(%22java/util/HashMap$KeySet%22), PRIVATE));%0A  %7D%0A  %0A  @Test%0A  public void privateInnerClassMustNotBeVisibleByDifferentClass() %7B%0A    VisibilityTestRunner runner = new VisibilityTestRunner(getClass());%0A    assertFalse(runner.isVisible(%0A        new ParsedElements.ParsedClass(%22java/util/HashMap$Entry%22),%0A        new ParsedElements.ParsedClass(%22java/util/ArrayList%22), PRIVATE));%0A  %7D%0A%0A%7D%0A

Test the visibility check itself