1becc56d7ea523aa153219446232cbf5e561726f4Yifan Hong/*
2becc56d7ea523aa153219446232cbf5e561726f4Yifan Hong * Copyright (C) 2017 The Android Open Source Project
3becc56d7ea523aa153219446232cbf5e561726f4Yifan Hong *
4becc56d7ea523aa153219446232cbf5e561726f4Yifan Hong * Licensed under the Apache License, Version 2.0 (the "License");
5becc56d7ea523aa153219446232cbf5e561726f4Yifan Hong * you may not use this file except in compliance with the License.
6becc56d7ea523aa153219446232cbf5e561726f4Yifan Hong * You may obtain a copy of the License at
7becc56d7ea523aa153219446232cbf5e561726f4Yifan Hong *
8becc56d7ea523aa153219446232cbf5e561726f4Yifan Hong *      http://www.apache.org/licenses/LICENSE-2.0
9becc56d7ea523aa153219446232cbf5e561726f4Yifan Hong *
10becc56d7ea523aa153219446232cbf5e561726f4Yifan Hong * Unless required by applicable law or agreed to in writing, software
11becc56d7ea523aa153219446232cbf5e561726f4Yifan Hong * distributed under the License is distributed on an "AS IS" BASIS,
12becc56d7ea523aa153219446232cbf5e561726f4Yifan Hong * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13becc56d7ea523aa153219446232cbf5e561726f4Yifan Hong * See the License for the specific language governing permissions and
14becc56d7ea523aa153219446232cbf5e561726f4Yifan Hong * limitations under the License.
15becc56d7ea523aa153219446232cbf5e561726f4Yifan Hong */
16becc56d7ea523aa153219446232cbf5e561726f4Yifan Hong
17becc56d7ea523aa153219446232cbf5e561726f4Yifan Hongpackage android.os;
18becc56d7ea523aa153219446232cbf5e561726f4Yifan Hong
19becc56d7ea523aa153219446232cbf5e561726f4Yifan Hongimport junit.framework.Assert;
20becc56d7ea523aa153219446232cbf5e561726f4Yifan Hongimport junit.framework.TestCase;
21becc56d7ea523aa153219446232cbf5e561726f4Yifan Hong
22becc56d7ea523aa153219446232cbf5e561726f4Yifan Hongpublic class VintfObjectTest extends TestCase {
23ff5e95b1116ec79ca5060cb4f17a5fbb0a74dc21Yifan Hong    /**
24ff5e95b1116ec79ca5060cb4f17a5fbb0a74dc21Yifan Hong     * Sanity check for {@link VintfObject#report VintfObject.report()}.
25ff5e95b1116ec79ca5060cb4f17a5fbb0a74dc21Yifan Hong     */
26becc56d7ea523aa153219446232cbf5e561726f4Yifan Hong    public void testReport() {
27becc56d7ea523aa153219446232cbf5e561726f4Yifan Hong        String[] xmls = VintfObject.report();
28becc56d7ea523aa153219446232cbf5e561726f4Yifan Hong        assertTrue(xmls.length > 0);
29becc56d7ea523aa153219446232cbf5e561726f4Yifan Hong        // From /system/manifest.xml
30becc56d7ea523aa153219446232cbf5e561726f4Yifan Hong        assertTrue(String.join("", xmls).contains(
31becc56d7ea523aa153219446232cbf5e561726f4Yifan Hong                "<manifest version=\"1.0\" type=\"framework\">"));
3275ffd667a97f3b8adc83b2c214472b31c8f85249Yifan Hong        // From /system/compatibility-matrix.xml
3375ffd667a97f3b8adc83b2c214472b31c8f85249Yifan Hong        assertTrue(String.join("", xmls).contains(
34ff5e95b1116ec79ca5060cb4f17a5fbb0a74dc21Yifan Hong                "<compatibility-matrix version=\"1.0\" type=\"framework\""));
35becc56d7ea523aa153219446232cbf5e561726f4Yifan Hong    }
36becc56d7ea523aa153219446232cbf5e561726f4Yifan Hong}
37