/*******************************************************************************
 * Copyright 2011 Google Inc. All Rights Reserved.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * 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 com.google.gwt.eclipse.core.runtime;

import com.google.gdt.eclipse.core.TestUtilities;
import com.google.gwt.eclipse.core.preferences.GWTPreferences;

import junit.framework.TestCase;

import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;

/*
 * TODO: once our testing infrastructure includes older SDKs, add capability
 * tests for them.
 */
/**
 * Tests for the {@link GwtCapabilityChecker}.
 */
public class GwtCapabilityCheckerTest extends TestCase {

  public void testCapabilitiesOfGwtProjectsRuntime() throws CoreException {
    GwtRuntimeTestUtilities.importGwtSourceProjects();
    try {
      GWTRuntime gwtRuntime = GWTRuntime.getFactory().newInstance(
          "GWT Projects",
          ResourcesPlugin.getWorkspace().getRoot().getLocation());
      assertLatestGwtCapabilities(gwtRuntime);
    } finally {
      GwtRuntimeTestUtilities.removeGwtSourceProjects();
    }
  }

  public void testCapabilitiesOfLatestGwtSdk() throws Exception {
    GwtRuntimeTestUtilities.addDefaultRuntime();
    try {
      assertLatestGwtCapabilities(GWTPreferences.getDefaultRuntime());
    } finally {
      GwtRuntimeTestUtilities.removeDefaultRuntime();
    }
  }

  @Override
  protected void setUp() throws Exception {
    TestUtilities.setUp();
  }

  private void assertLatestGwtCapabilities(GWTRuntime gwtRuntime) {
    GwtCapabilityChecker checker = new GwtCapabilityChecker(gwtRuntime);
    assertTrue(checker.doesCompilerAllowMultipleModules());
  }

}

@@ -978,59 +978,8 @@
 e;%0A%0A
-import org.eclipse.core.resources.ResourcesPlugin;%0A
 impo
@@ -1238,16 +1238,96 @@
 Case %7B%0A%0A
+  // TODO(nbashirbello): Enable this test when Pulse build agents can run jdk-7%0A
   public
@@ -1389,32 +1389,35 @@
 eException %7B%0A   
+ //
  GwtRuntimeTestU
@@ -1451,24 +1451,27 @@
 jects();%0A   
+ //
  try %7B%0A     
@@ -1469,17 +1469,18 @@
 y %7B%0A    
- 
+//
  GWTRunt
@@ -1537,21 +1537,18 @@
 ce(%0A    
-     
+//
  %22GWT Pr
@@ -1560,21 +1560,18 @@
 s%22,%0A    
-     
+//
  Resourc
@@ -1620,25 +1620,26 @@
 ion());%0A    
- 
+//
  assertLates
@@ -1667,24 +1667,27 @@
 untime);%0A   
+ //
  %7D finally %7B
@@ -1683,33 +1683,34 @@
 %7D finally %7B%0A    
- 
+//
  GwtRuntimeTestU
@@ -1744,24 +1744,27 @@
 jects();%0A   
+ //
  %7D%0A  %7D%0A%0A  pu

Disable the GwtCapabilityCheckerTest until the Pulse build agents support jdk-7. ------------- Created by MOE: http://code.google.com/p/moe-java MOE_MIGRATED_REVID=55553626