Search in sources :

Example 41 with TestCase

use of com.hazelcast.simulator.common.TestCase in project hazelcast-simulator by hazelcast.

the class PropertyBindingTest method loadAsLong_nonExisting.

@Test
public void loadAsLong_nonExisting() {
    TestCase testCase = new TestCase("foo");
    PropertyBinding binding = new PropertyBinding(testCase);
    assertEquals(10, binding.loadAsLong("longValue", 10));
}
Also used : TestCase(com.hazelcast.simulator.common.TestCase) Test(org.junit.Test)

Example 42 with TestCase

use of com.hazelcast.simulator.common.TestCase in project hazelcast-simulator by hazelcast.

the class PropertyBindingTest method loadAsInt_existing_withUnderscores.

@Test
public void loadAsInt_existing_withUnderscores() {
    TestCase testCase = new TestCase("foo").setProperty("intValue", "5_0");
    PropertyBinding binding = new PropertyBinding(testCase);
    assertEquals(50, binding.loadAsInt("intValue", 10));
}
Also used : TestCase(com.hazelcast.simulator.common.TestCase) Test(org.junit.Test)

Example 43 with TestCase

use of com.hazelcast.simulator.common.TestCase in project hazelcast-simulator by hazelcast.

the class PropertyBindingTest method loadAsBoolean_nonExisting.

@Test
public void loadAsBoolean_nonExisting() {
    TestCase testCase = new TestCase("foo");
    PropertyBinding binding = new PropertyBinding(testCase);
    assertEquals(true, binding.loadAsBoolean("booleanValue", true));
}
Also used : TestCase(com.hazelcast.simulator.common.TestCase) Test(org.junit.Test)

Example 44 with TestCase

use of com.hazelcast.simulator.common.TestCase in project hazelcast-simulator by hazelcast.

the class PropertyBindingTest method loadAsDouble_nonExisting.

@Test
public void loadAsDouble_nonExisting() {
    TestCase testCase = new TestCase("foo");
    PropertyBinding binding = new PropertyBinding(testCase);
    assertEquals(10, binding.loadAsDouble("doubleValue", 10), 0.1);
}
Also used : TestCase(com.hazelcast.simulator.common.TestCase) Test(org.junit.Test)

Example 45 with TestCase

use of com.hazelcast.simulator.common.TestCase in project hazelcast-simulator by hazelcast.

the class PropertyBindingTest method loadAsLong_existing.

@Test
public void loadAsLong_existing() {
    TestCase testCase = new TestCase("foo").setProperty("longValue", 50);
    PropertyBinding binding = new PropertyBinding(testCase);
    assertEquals(50, binding.loadAsLong("longValue", 10));
}
Also used : TestCase(com.hazelcast.simulator.common.TestCase) Test(org.junit.Test)

Aggregations

TestCase (com.hazelcast.simulator.common.TestCase)74 Test (org.junit.Test)61 Server (com.hazelcast.simulator.protocol.Server)18 SuccessTest (com.hazelcast.simulator.tests.SuccessTest)13 Callable (java.util.concurrent.Callable)11 Future (java.util.concurrent.Future)11 FailingTest (com.hazelcast.simulator.tests.FailingTest)10 CreateTestOperation (com.hazelcast.simulator.worker.operations.CreateTestOperation)9 StoppingTest (com.hazelcast.simulator.tests.StoppingTest)8 TestPhase (com.hazelcast.simulator.common.TestPhase)7 StubPromise (com.hazelcast.simulator.protocol.StubPromise)6 StartPhaseOperation (com.hazelcast.simulator.worker.operations.StartPhaseOperation)6 StopException (com.hazelcast.simulator.test.StopException)5 TestSuite (com.hazelcast.simulator.coordinator.TestSuite)4 BusySpinningMetronome (com.hazelcast.simulator.worker.metronome.BusySpinningMetronome)4 EmptyMetronome (com.hazelcast.simulator.worker.metronome.EmptyMetronome)4 Metronome (com.hazelcast.simulator.worker.metronome.Metronome)4 SleepingMetronome (com.hazelcast.simulator.worker.metronome.SleepingMetronome)4 BaseThreadState (com.hazelcast.simulator.test.BaseThreadState)2 HashMap (java.util.HashMap)2