/* * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0, which is available at * http://www.eclipse.org/org/documents/edl-v10.php. * * SPDX-License-Identifier: BSD-3-Clause */ import java.util.*; import java.util.concurrent.atomic.*; import java.io.*; import jakarta.mail.*; import jakarta.mail.event.*; import jakarta.mail.internet.*; import jakarta.activation.*; import com.sun.mail.imap.*; /** * Test program for IDLE support in IMAP provider. * * Run several threads that access the folder's connection * while another thread runs the IDLE command. A timer * thread checks that each thread is making progress, to * detect deadlock. * * XXX - Should have another thread add messages to the folder * to test the new message notification works properly. */ public class testidle { public static Store store; public static Folder folder; public static boolean showStructure = false; public static boolean saveAttachments = false; public static int attnum = 0; public static int totalTime; public static final AtomicBoolean stop = new AtomicBoolean(false); public static final AtomicInteger folderProgress = new AtomicInteger(); public static final AtomicInteger msgProgress = new AtomicInteger(); public static void main(String argv[]) { if (argv.length != 5) { System.out.println( "Usage: testidle