/* 
 * Mutability Detector
 *
 * Copyright 2009 Graham Allan
 * 
 * Licensed 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.mutabilitydetector.benchmarks.inheritance;
import static org.mutabilitydetector.ImmutableAssert.assertDefinitelyNotImmutable;
import static org.mutabilitydetector.ImmutableAssert.assertImmutable;
import static org.mutabilitydetector.ImmutableAssert.assertIsImmutableResult;
import static org.mutabilitydetector.ImmutableAssert.assertNotImmutable;
import static org.mutabilitydetector.TestUtil.getIsImmutableResult;

import org.junit.Test;
import org.mutabilitydetector.IAnalysisSession.IsImmutable;
import org.mutabilitydetector.benchmarks.MutableByExtendingMutableType;
import org.mutabilitydetector.benchmarks.types.AbstractType.ImmutableSubtypeOfAbstractType;


public class TestSubclassingOfMutableType {


	@Test
	public void testSupertypeIsMaybeImmutable() throws Exception {
		assertIsImmutableResult(IsImmutable.MAYBE, getIsImmutableResult(ImmutableSupertype.class));
	}
	
	@Test
	public void testImmutableSubtypeIsReportedAsImmutable() throws Exception {
		assertImmutable(getIsImmutableResult(ImmutableSubtypeOfImmutableSupertype.class));
	}

	
	@Test
	public void testMutableSubtype() throws Exception {
		assertDefinitelyNotImmutable(getIsImmutableResult(MutableSubtypeOfImmutableSupertype.class));
	}
	
	@Test
	public void testClassExtendingObjectIsNotRenderedMutable() throws Exception {
		assertImmutable(getIsImmutableResult(ImmutableSubtypeWithNoSuperclass.class));
	}
	
	//@Test TODO replace when InheritedMutabilityChecker works properly.
	public void testClassIsNotMadeMutableJustByExtendingAbstractClass() throws Exception {
		assertImmutable(getIsImmutableResult(ImmutableSubtypeOfAbstractType.class));
	}
	
	@Test
	public void testImmutableSubclassIsMutableIfSuperclassIsMutable() throws Exception {
		assertNotImmutable(getIsImmutableResult(MutableByExtendingMutableType.class));
	}
}

@@ -1045,16 +1045,41 @@
 esult;%0A%0A
+import org.junit.Ignore;%0A
 import o
@@ -1367,26 +1367,25 @@
 e %7B%0A%0A%0A%09@Test
-%0A%09
+ 
 public void 
@@ -1532,34 +1532,33 @@
 s));%0A%09%7D%0A%09%0A%09@Test
-%0A%09
+ 
 public void test
@@ -1705,34 +1705,33 @@
 ));%0A%09%7D%0A%0A%09%0A%09@Test
-%0A%09
+ 
 public void test
@@ -1865,34 +1865,33 @@
 s));%0A%09%7D%0A%09%0A%09@Test
-%0A%09
+ 
 public void test
@@ -2043,34 +2043,17 @@
 %0A%09%0A%09
-//@Test TODO replace when 
+@Ignore(%22
 Inhe
@@ -2079,13 +2079,20 @@
 ker 
+doesn't 
 work
-s
  pro
@@ -2100,11 +2100,23 @@
 erly
-.%0A%09
+ yet.%22)%0A%09@Test 
 publ
@@ -2288,18 +2288,17 @@
 %09%0A%09@Test
-%0A%09
+ 
 public v

Add @Ignore to a test rather than commenting it out.