blob: 7998866b9dc77a9a4ef3647ae67cb7cfed7bc44f [file] [log] [blame]
Paul Duffine2363012015-11-30 16:20:41 +00001/*
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
17package com.google.caliper.config;
18
19import static org.junit.Assert.assertTrue;
20
21import com.google.caliper.platform.jvm.JvmPlatform;
22
23import org.junit.Test;
24import org.junit.runner.RunWith;
25import org.junit.runners.JUnit4;
26
27import java.io.File;
28
29/**
30 * Tests {@link VmConfig}.
31 *
32 * @author gak@google.com (Gregory Kick)
33 */
34@RunWith(JUnit4.class)
35public class VmConfigTest {
36
37
38 @Test
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}