Пример #1
0
 @Test
 public void find_findsTaskInDatabase_true() {
   Task myTask = new Task("Mow the lawn", 1);
   myTask.save();
   Task savedTask = Task.find(myTask.getId());
   assertTrue(myTask.equals(savedTask));
 }
 @After
 public void tearDown() {
   try {
     server0.terminate();
     Task task0 =
         createTask(
             "task0",
             org.jboss.jbossts.qa.Utils.RemoveServerIORStore.class,
             Task.TaskType.EXPECT_PASS_FAIL,
             480);
     task0.perform("$(1)");
   } finally {
     super.tearDown();
   }
 }
 @Before
 public void setUp() {
   super.setUp();
   server0 =
       createTask(
           "server0",
           com.arjuna.ats.arjuna.recovery.RecoveryManager.class,
           Task.TaskType.EXPECT_READY,
           480);
   server0.start("-test");
 }
Пример #4
0
 @Test
 public void save_assignsIdToObject() {
   Task myTask = new Task("Mow the lawn", 1);
   myTask.save();
   Task savedTask = Task.all().get(0);
   assertEquals(myTask.getId(), savedTask.getId());
 }
Пример #5
0
 @Test
 public void save_savesCategoryIdIntoDB_true() {
   Category myCategory = new Category("Household chores");
   myCategory.save();
   Task myTask = new Task("Mow the lawn", myCategory.getId());
   myTask.save();
   Task savedTask = Task.find(myTask.getId());
   assertEquals(savedTask.getCategoryId(), myCategory.getId());
 }
 @Test
 public void RawSubtransactionAwareResources02_1_Test002() {
   setTestName("Test002");
   Task server1 =
       createTask(
           "server1",
           org.jboss.jbossts.qa.RawSubtransactionAwareResources02Servers.Server01.class,
           Task.TaskType.EXPECT_READY,
           480);
   server1.start("$(1)");
   Task client0 =
       createTask(
           "client0",
           org.jboss.jbossts.qa.RawSubtransactionAwareResources02Clients1.Client002.class,
           Task.TaskType.EXPECT_PASS_FAIL,
           480);
   client0.start("$(1)");
   client0.waitFor();
   server1.terminate();
 }
Пример #7
0
 @Test
 public void all_emptyAtFirst() {
   assertEquals(Task.all().size(), 0);
 }
Пример #8
0
 @Test
 public void save_returnsTrueIfDescriptionsAretheSame() {
   Task myTask = new Task("Mow the lawn", 1);
   myTask.save();
   assertTrue(Task.all().get(0).equals(myTask));
 }
Пример #9
0
 @Test
 public void equals_returnsTrueIfDescriptionsAretheSame() {
   Task firstTask = new Task("Mow the lawn", 1);
   Task secondTask = new Task("Mow the lawn", 1);
   assertTrue(firstTask.equals(secondTask));
 }
Пример #10
0
 @Test
 public void Task_intantiatesWithDescription_true() {
   Task myTask = new Task("Mow the lawn");
   assertEquals("Mow the lawn", myTask.getDescription());
 }