12faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes/*
22faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes * Copyright (C) 2007 The Android Open Source Project
32faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes *
42faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes * Licensed under the Apache License, Version 2.0 (the "License");
52faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes * you may not use this file except in compliance with the License.
62faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes * You may obtain a copy of the License at
72faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes *
82faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes *      http://www.apache.org/licenses/LICENSE-2.0
92faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes *
102faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes * Unless required by applicable law or agreed to in writing, software
112faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes * distributed under the License is distributed on an "AS IS" BASIS,
122faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
132faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes * See the License for the specific language governing permissions and
142faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes * limitations under the License.
152faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes */
165d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao
175d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao/**
185d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao * Test Java language asserts.
195d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao */
205d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhaopublic class Main {
215d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao    public static void main(String[] args) {
225d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        assert true;
235d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        try {
245d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao            assert false;
25745016fa05eab1ce549c361c71756e208fe0c102Elliott Hughes            System.out.println("didn't assert (is '-ea' implemented?)");
265d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        } catch (AssertionError ae) {
275d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao            System.out.println("caught expected assert exception");
285d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        }
29741b5b7ef4c7fd4a786364bbf60d515489caff47Elliott Hughes
30741b5b7ef4c7fd4a786364bbf60d515489caff47Elliott Hughes        // exercise this code path
31741b5b7ef4c7fd4a786364bbf60d515489caff47Elliott Hughes        ClassLoader.getSystemClassLoader().setDefaultAssertionStatus(true);
325d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao    }
335d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao}
34