Java 类org.bukkit.event.TestEvent 实例源码

项目:Thermos-Bukkit    文件:PluginManagerTest.java   
@Test
public void testAsyncLocked() throws InterruptedException {
    final Event event = new TestEvent(true);
    Thread secondThread = new Thread(
        new Runnable() {
            public void run() {
                try {
                    synchronized (pm) {
                        pm.callEvent(event);
                    }
                } catch (Throwable ex) {
                    store.value = ex;
                }
            }
        }
    );
    secondThread.start();
    secondThread.join();
    assertThat(store.value, is(instanceOf(IllegalStateException.class)));
    assertThat(event.getEventName() + " cannot be triggered asynchronously from inside synchronized code.", is(((Throwable) store.value).getMessage()));
}
项目:Thermos-Bukkit    文件:PluginManagerTest.java   
@Test
public void testAsyncUnlocked() throws InterruptedException {
    final Event event = new TestEvent(true);
    Thread secondThread = new Thread(
        new Runnable() {
            public void run() {
                try {
                    pm.callEvent(event);
                } catch (Throwable ex) {
                    store.value = ex;
                }
            }});
    secondThread.start();
    secondThread.join();
    if (store.value != null) {
        throw new RuntimeException((Throwable) store.value);
    }
}
项目:Thermos-Bukkit    文件:PluginManagerTest.java   
@Test
public void testSyncUnlocked() throws InterruptedException {
    final Event event = new TestEvent(false);
    Thread secondThread = new Thread(
        new Runnable() {
            public void run() {
                try {
                    pm.callEvent(event);
                } catch (Throwable ex) {
                    store.value = ex;
                }
            }
        }
    );
    secondThread.start();
    secondThread.join();
    if (store.value != null) {
        throw new RuntimeException((Throwable) store.value);
    }
}
项目:Thermos-Bukkit    文件:PluginManagerTest.java   
@Test
public void testSyncLocked() throws InterruptedException {
    final Event event = new TestEvent(false);
    Thread secondThread = new Thread(
        new Runnable() {
            public void run() {
                try {
                    synchronized (pm) {
                        pm.callEvent(event);
                    }
                } catch (Throwable ex) {
                    store.value = ex;
                }
            }
        }
    );
    secondThread.start();
    secondThread.join();
    if (store.value != null) {
        throw new RuntimeException((Throwable) store.value);
    }
}
项目:CauldronGit    文件:PluginManagerTest.java   
@Test
public void testAsyncLocked() throws InterruptedException {
    final Event event = new TestEvent(true);
    Thread secondThread = new Thread(
        new Runnable() {
            public void run() {
                try {
                    synchronized (pm) {
                        pm.callEvent(event);
                    }
                } catch (Throwable ex) {
                    store.value = ex;
                }
            }
        }
    );
    secondThread.start();
    secondThread.join();
    assertThat(store.value, is(instanceOf(IllegalStateException.class)));
    assertThat(event.getEventName() + " cannot be triggered asynchronously from inside synchronized code.", is(((Throwable) store.value).getMessage()));
}
项目:CauldronGit    文件:PluginManagerTest.java   
@Test
public void testAsyncUnlocked() throws InterruptedException {
    final Event event = new TestEvent(true);
    Thread secondThread = new Thread(
        new Runnable() {
            public void run() {
                try {
                    pm.callEvent(event);
                } catch (Throwable ex) {
                    store.value = ex;
                }
            }});
    secondThread.start();
    secondThread.join();
    if (store.value != null) {
        throw new RuntimeException((Throwable) store.value);
    }
}
项目:CauldronGit    文件:PluginManagerTest.java   
@Test
public void testSyncUnlocked() throws InterruptedException {
    final Event event = new TestEvent(false);
    Thread secondThread = new Thread(
        new Runnable() {
            public void run() {
                try {
                    pm.callEvent(event);
                } catch (Throwable ex) {
                    store.value = ex;
                }
            }
        }
    );
    secondThread.start();
    secondThread.join();
    if (store.value != null) {
        throw new RuntimeException((Throwable) store.value);
    }
}
项目:CauldronGit    文件:PluginManagerTest.java   
@Test
public void testSyncLocked() throws InterruptedException {
    final Event event = new TestEvent(false);
    Thread secondThread = new Thread(
        new Runnable() {
            public void run() {
                try {
                    synchronized (pm) {
                        pm.callEvent(event);
                    }
                } catch (Throwable ex) {
                    store.value = ex;
                }
            }
        }
    );
    secondThread.start();
    secondThread.join();
    if (store.value != null) {
        throw new RuntimeException((Throwable) store.value);
    }
}
项目:Cauldron    文件:PluginManagerTest.java   
@Test
public void testAsyncLocked() throws InterruptedException {
    final Event event = new TestEvent(true);
    Thread secondThread = new Thread(
        new Runnable() {
            public void run() {
                try {
                    synchronized (pm) {
                        pm.callEvent(event);
                    }
                } catch (Throwable ex) {
                    store.value = ex;
                }
            }
        }
    );
    secondThread.start();
    secondThread.join();
    assertThat(store.value, is(instanceOf(IllegalStateException.class)));
    assertThat(event.getEventName() + " cannot be triggered asynchronously from inside synchronized code.", is(((Throwable) store.value).getMessage()));
}
项目:Cauldron    文件:PluginManagerTest.java   
@Test
public void testAsyncUnlocked() throws InterruptedException {
    final Event event = new TestEvent(true);
    Thread secondThread = new Thread(
        new Runnable() {
            public void run() {
                try {
                    pm.callEvent(event);
                } catch (Throwable ex) {
                    store.value = ex;
                }
            }});
    secondThread.start();
    secondThread.join();
    if (store.value != null) {
        throw new RuntimeException((Throwable) store.value);
    }
}
项目:Cauldron    文件:PluginManagerTest.java   
@Test
public void testSyncUnlocked() throws InterruptedException {
    final Event event = new TestEvent(false);
    Thread secondThread = new Thread(
        new Runnable() {
            public void run() {
                try {
                    pm.callEvent(event);
                } catch (Throwable ex) {
                    store.value = ex;
                }
            }
        }
    );
    secondThread.start();
    secondThread.join();
    if (store.value != null) {
        throw new RuntimeException((Throwable) store.value);
    }
}
项目:Cauldron    文件:PluginManagerTest.java   
@Test
public void testSyncLocked() throws InterruptedException {
    final Event event = new TestEvent(false);
    Thread secondThread = new Thread(
        new Runnable() {
            public void run() {
                try {
                    synchronized (pm) {
                        pm.callEvent(event);
                    }
                } catch (Throwable ex) {
                    store.value = ex;
                }
            }
        }
    );
    secondThread.start();
    secondThread.join();
    if (store.value != null) {
        throw new RuntimeException((Throwable) store.value);
    }
}
项目:Almura-API    文件:PluginManagerTest.java   
@Test
public void testAsyncLocked() throws InterruptedException {
    final Event event = new TestEvent(true);
    Thread secondThread = new Thread(
        new Runnable() {
            public void run() {
                try {
                    synchronized (pm) {
                        pm.callEvent(event);
                    }
                } catch (Throwable ex) {
                    store.value = ex;
                }
            }});
    secondThread.start();
    secondThread.join();
    assertThat(store.value, is(instanceOf(IllegalStateException.class)));
    assertThat(event.getEventName() + " cannot be triggered asynchronously from inside synchronized code.", is(((Throwable) store.value).getMessage()));
}
项目:Almura-API    文件:PluginManagerTest.java   
@Test
public void testAsyncUnlocked() throws InterruptedException {
    final Event event = new TestEvent(true);
    Thread secondThread = new Thread(
        new Runnable() {
            public void run() {
                try {
                    pm.callEvent(event);
                } catch (Throwable ex) {
                    store.value = ex;
                }
            }});
    secondThread.start();
    secondThread.join();
    if (store.value != null) {
        throw new RuntimeException((Throwable) store.value);
    }
}
项目:Almura-API    文件:PluginManagerTest.java   
@Test
public void testSyncUnlocked() throws InterruptedException {
    final Event event = new TestEvent(false);
    Thread secondThread = new Thread(
        new Runnable() {
            public void run() {
                try {
                    pm.callEvent(event);
                } catch (Throwable ex) {
                    store.value = ex;
                }
            }});
    secondThread.start();
    secondThread.join();
    if (store.value != null) {
        throw new RuntimeException((Throwable) store.value);
    }
}
项目:Almura-API    文件:PluginManagerTest.java   
@Test
public void testSyncLocked() throws InterruptedException {
    final Event event = new TestEvent(false);
    Thread secondThread = new Thread(
        new Runnable() {
            public void run() {
                try {
                    synchronized (pm) {
                        pm.callEvent(event);
                    }
                } catch (Throwable ex) {
                    store.value = ex;
                }
            }});
    secondThread.start();
    secondThread.join();
    if (store.value != null) {
        throw new RuntimeException((Throwable) store.value);
    }
}
项目:Spigot-API    文件:PluginManagerTest.java   
@Test
public void testAsyncLocked() throws InterruptedException {
    final Event event = new TestEvent(true);
    Thread secondThread = new Thread(
        new Runnable() {
            public void run() {
                try {
                    synchronized (pm) {
                        pm.callEvent(event);
                    }
                } catch (Throwable ex) {
                    store.value = ex;
                }
            }
        }
    );
    secondThread.start();
    secondThread.join();
    assertThat(store.value, is(instanceOf(IllegalStateException.class)));
    assertThat(event.getEventName() + " cannot be triggered asynchronously from inside synchronized code.", is(((Throwable) store.value).getMessage()));
}
项目:Spigot-API    文件:PluginManagerTest.java   
@Test
public void testAsyncUnlocked() throws InterruptedException {
    final Event event = new TestEvent(true);
    Thread secondThread = new Thread(
        new Runnable() {
            public void run() {
                try {
                    pm.callEvent(event);
                } catch (Throwable ex) {
                    store.value = ex;
                }
            }});
    secondThread.start();
    secondThread.join();
    if (store.value != null) {
        throw new RuntimeException((Throwable) store.value);
    }
}
项目:Spigot-API    文件:PluginManagerTest.java   
@Test
public void testSyncUnlocked() throws InterruptedException {
    final Event event = new TestEvent(false);
    Thread secondThread = new Thread(
        new Runnable() {
            public void run() {
                try {
                    pm.callEvent(event);
                } catch (Throwable ex) {
                    store.value = ex;
                }
            }
        }
    );
    secondThread.start();
    secondThread.join();
    if (store.value != null) {
        throw new RuntimeException((Throwable) store.value);
    }
}
项目:Spigot-API    文件:PluginManagerTest.java   
@Test
public void testSyncLocked() throws InterruptedException {
    final Event event = new TestEvent(false);
    Thread secondThread = new Thread(
        new Runnable() {
            public void run() {
                try {
                    synchronized (pm) {
                        pm.callEvent(event);
                    }
                } catch (Throwable ex) {
                    store.value = ex;
                }
            }
        }
    );
    secondThread.start();
    secondThread.join();
    if (store.value != null) {
        throw new RuntimeException((Throwable) store.value);
    }
}
项目:Bukkit-JavaDoc    文件:PluginManagerTest.java   
@Test
public void testAsyncLocked() throws InterruptedException {
    final Event event = new TestEvent(true);
    Thread secondThread = new Thread(
        new Runnable() {
            public void run() {
                try {
                    synchronized (pm) {
                        pm.callEvent(event);
                    }
                } catch (Throwable ex) {
                    store.value = ex;
                }
            }
        }
    );
    secondThread.start();
    secondThread.join();
    assertThat(store.value, is(instanceOf(IllegalStateException.class)));
    assertThat(event.getEventName() + " cannot be triggered asynchronously from inside synchronized code.", is(((Throwable) store.value).getMessage()));
}
项目:Bukkit-JavaDoc    文件:PluginManagerTest.java   
@Test
public void testAsyncUnlocked() throws InterruptedException {
    final Event event = new TestEvent(true);
    Thread secondThread = new Thread(
        new Runnable() {
            public void run() {
                try {
                    pm.callEvent(event);
                } catch (Throwable ex) {
                    store.value = ex;
                }
            }});
    secondThread.start();
    secondThread.join();
    if (store.value != null) {
        throw new RuntimeException((Throwable) store.value);
    }
}
项目:Bukkit-JavaDoc    文件:PluginManagerTest.java   
@Test
public void testSyncUnlocked() throws InterruptedException {
    final Event event = new TestEvent(false);
    Thread secondThread = new Thread(
        new Runnable() {
            public void run() {
                try {
                    pm.callEvent(event);
                } catch (Throwable ex) {
                    store.value = ex;
                }
            }
        }
    );
    secondThread.start();
    secondThread.join();
    if (store.value != null) {
        throw new RuntimeException((Throwable) store.value);
    }
}
项目:Bukkit-JavaDoc    文件:PluginManagerTest.java   
@Test
public void testSyncLocked() throws InterruptedException {
    final Event event = new TestEvent(false);
    Thread secondThread = new Thread(
        new Runnable() {
            public void run() {
                try {
                    synchronized (pm) {
                        pm.callEvent(event);
                    }
                } catch (Throwable ex) {
                    store.value = ex;
                }
            }
        }
    );
    secondThread.start();
    secondThread.join();
    if (store.value != null) {
        throw new RuntimeException((Throwable) store.value);
    }
}
项目:Thermos-Bukkit    文件:PluginManagerTest.java   
@Test
public void testAsyncSameThread() {
    final Event event = new TestEvent(true);
    try {
        pm.callEvent(event);
    } catch (IllegalStateException ex) {
        assertThat(event.getEventName() + " cannot be triggered asynchronously from primary server thread.", is(ex.getMessage()));
        return;
    }
    throw new IllegalStateException("No exception thrown");
}
项目:CauldronGit    文件:PluginManagerTest.java   
@Test
public void testAsyncSameThread() {
    final Event event = new TestEvent(true);
    try {
        pm.callEvent(event);
    } catch (IllegalStateException ex) {
        assertThat(event.getEventName() + " cannot be triggered asynchronously from primary server thread.", is(ex.getMessage()));
        return;
    }
    throw new IllegalStateException("No exception thrown");
}
项目:Cauldron    文件:PluginManagerTest.java   
@Test
public void testAsyncSameThread() {
    final Event event = new TestEvent(true);
    try {
        pm.callEvent(event);
    } catch (IllegalStateException ex) {
        assertThat(event.getEventName() + " cannot be triggered asynchronously from primary server thread.", is(ex.getMessage()));
        return;
    }
    throw new IllegalStateException("No exception thrown");
}
项目:Almura-API    文件:PluginManagerTest.java   
@Test
public void testAsyncSameThread() {
    final Event event = new TestEvent(true);
    try {
        pm.callEvent(event);
    } catch (IllegalStateException ex) {
        assertThat(event.getEventName() + " cannot be triggered asynchronously from primary server thread.", is(ex.getMessage()));
        return;
    }
    throw new IllegalStateException("No exception thrown");
}
项目:Spigot-API    文件:PluginManagerTest.java   
@Test
public void testAsyncSameThread() {
    final Event event = new TestEvent(true);
    try {
        pm.callEvent(event);
    } catch (IllegalStateException ex) {
        assertThat(event.getEventName() + " cannot be triggered asynchronously from primary server thread.", is(ex.getMessage()));
        return;
    }
    throw new IllegalStateException("No exception thrown");
}
项目:Bukkit-JavaDoc    文件:PluginManagerTest.java   
@Test
public void testAsyncSameThread() {
    final Event event = new TestEvent(true);
    try {
        pm.callEvent(event);
    } catch (IllegalStateException ex) {
        assertThat(event.getEventName() + " cannot be triggered asynchronously from primary server thread.", is(ex.getMessage()));
        return;
    }
    throw new IllegalStateException("No exception thrown");
}
项目:Thermos-Bukkit    文件:PluginManagerTest.java   
@Test
public void testSyncSameThread() {
    final Event event = new TestEvent(false);
    pm.callEvent(event);
}
项目:CauldronGit    文件:PluginManagerTest.java   
@Test
public void testSyncSameThread() {
    final Event event = new TestEvent(false);
    pm.callEvent(event);
}
项目:Cauldron    文件:PluginManagerTest.java   
@Test
public void testSyncSameThread() {
    final Event event = new TestEvent(false);
    pm.callEvent(event);
}
项目:Almura-API    文件:PluginManagerTest.java   
@Test
public void testSyncSameThread() {
    final Event event = new TestEvent(false);
    pm.callEvent(event);
}
项目:Spigot-API    文件:PluginManagerTest.java   
@Test
public void testSyncSameThread() {
    final Event event = new TestEvent(false);
    pm.callEvent(event);
}
项目:Bukkit-JavaDoc    文件:PluginManagerTest.java   
@Test
public void testSyncSameThread() {
    final Event event = new TestEvent(false);
    pm.callEvent(event);
}