Sha256: c555472e2054491a123a48d1a33332001b0e17997abf028123dec47c114a0b5a

Contents?: true

Size: 1.93 KB

Versions: 65

Compression:

Stored size: 1.93 KB

Contents

/**
 * $Id$
 * 
 * Author:: Francis Cianfrocca (gmail: blackhedd)
 * Homepage::  http://rubyeventmachine.com
 * Date:: 15 Jul 2007
 * 
 * See EventMachine and EventMachine::Connection for documentation and
 * usage examples.
 * 
 *
 *----------------------------------------------------------------------------
 *
 * Copyright (C) 2006-07 by Francis Cianfrocca. All Rights Reserved.
 * Gmail: blackhedd
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of either: 1) the GNU General Public License
 * as published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version; or 2) Ruby's License.
 * 
 * See the file COPYING for complete licensing information.
 *
 *---------------------------------------------------------------------------
 *
 * 
 */


package com.rubyeventmachine.tests;

import com.rubyeventmachine.*;
import com.rubyeventmachine.application.*;
import java.io.*;

import org.junit.Assert;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;


public class TestTimers {

	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
	}

	@AfterClass
	public static void tearDownAfterClass() throws Exception {
	}

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}


	
	@Test
	public final void test2() throws IOException {
		Application a = new Application();
		a.addTimer(0, new Timer() {
			public void fire() {
				application.stop();
			}
		});
		a.run();
		Assert.assertEquals (1, 1); // just to make sure the reactor halts.
	}
	
	@Test
	public final void test3() throws IOException {
		Application a = new Application();
		a.addTimer (0.1, new PeriodicTimer() {
			int n = 0;
			public void fire() {
				n++;
				if (n == 5)
					application.stop();
			}
		});
		a.run();
		Assert.assertEquals(1, 1);
	}
}

Version data entries

65 entries across 65 versions & 8 rubygems

Version Path
classiccms-0.7.5 vendor/bundle/gems/eventmachine-0.12.10/java/src/com/rubyeventmachine/tests/TestTimers.java
classiccms-0.7.4 vendor/bundle/gems/eventmachine-0.12.10/java/src/com/rubyeventmachine/tests/TestTimers.java
classiccms-0.7.3 vendor/bundle/gems/eventmachine-0.12.10/java/src/com/rubyeventmachine/tests/TestTimers.java
classiccms-0.7.2 vendor/bundle/gems/eventmachine-0.12.10/java/src/com/rubyeventmachine/tests/TestTimers.java
classiccms-0.7.1 vendor/bundle/gems/eventmachine-0.12.10/java/src/com/rubyeventmachine/tests/TestTimers.java
classiccms-0.7.0 vendor/bundle/gems/eventmachine-0.12.10/java/src/com/rubyeventmachine/tests/TestTimers.java
classiccms-0.6.9 vendor/bundle/gems/eventmachine-0.12.10/java/src/com/rubyeventmachine/tests/TestTimers.java
classiccms-0.6.8 vendor/bundle/gems/eventmachine-0.12.10/java/src/com/rubyeventmachine/tests/TestTimers.java
classiccms-0.6.7 vendor/bundle/gems/eventmachine-0.12.10/java/src/com/rubyeventmachine/tests/TestTimers.java
classiccms-0.6.6 vendor/bundle/gems/eventmachine-0.12.10/java/src/com/rubyeventmachine/tests/TestTimers.java
classiccms-0.6.5 vendor/bundle/gems/eventmachine-0.12.10/java/src/com/rubyeventmachine/tests/TestTimers.java
classiccms-0.6.4 vendor/bundle/gems/eventmachine-0.12.10/java/src/com/rubyeventmachine/tests/TestTimers.java
classiccms-0.6.3 vendor/bundle/gems/eventmachine-0.12.10/java/src/com/rubyeventmachine/tests/TestTimers.java
classiccms-0.6.2 vendor/bundle/gems/eventmachine-0.12.10/java/src/com/rubyeventmachine/tests/TestTimers.java
classiccms-0.6.1 vendor/bundle/gems/eventmachine-0.12.10/java/src/com/rubyeventmachine/tests/TestTimers.java
classiccms-0.6.0 vendor/bundle/gems/eventmachine-0.12.10/java/src/com/rubyeventmachine/tests/TestTimers.java
classiccms-0.5.17 vendor/bundle/gems/eventmachine-0.12.10/java/src/com/rubyeventmachine/tests/TestTimers.java
classiccms-0.5.16 vendor/bundle/gems/eventmachine-0.12.10/java/src/com/rubyeventmachine/tests/TestTimers.java
classiccms-0.5.15 vendor/bundle/gems/eventmachine-0.12.10/java/src/com/rubyeventmachine/tests/TestTimers.java
classiccms-0.5.14 vendor/bundle/gems/eventmachine-0.12.10/java/src/com/rubyeventmachine/tests/TestTimers.java