1 /* 2 * Copyright (C) 2012 Google Inc. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.google.caliper.config; 18 19 import static org.junit.Assert.assertTrue; 20 21 import com.google.caliper.platform.jvm.JvmPlatform; 22 23 import org.junit.Test; 24 import org.junit.runner.RunWith; 25 import org.junit.runners.JUnit4; 26 27 import java.io.File; 28 29 /** 30 * Tests {@link VmConfig}. 31 * 32 * @author gak@google.com (Gregory Kick) 33 */ 34 @RunWith(JUnit4.class) 35 public class VmConfigTest { 36 37 38 @Test testExecutable()39 public void testExecutable() { 40 File javaExecutable = 41 new VmConfig.Builder(new JvmPlatform(), new File(System.getProperty("java.home"))) 42 .build() 43 .vmExecutable(); 44 assertTrue("Could not find: " + javaExecutable, javaExecutable.exists()); 45 assertTrue(javaExecutable + " is not a file", javaExecutable.isFile()); 46 } 47 } 48