Examples of TestStep


Examples of com.hamburgsud.log4testing.core.data.TestStep

   * Tests the assertion assertOK
   */
  @Test
  public void testAssertOk() {
    testCase.newTestStepGroup("My simple Test");
    final TestStep testStep = testCase.newTestStep(TestStatus.OK,
        "mySimpleTestCommand", "This is just a simple test.",
        "Everything is working fine.");
    testStep.finish();
    Assert.assertOk(testStep);
  }
View Full Code Here

Examples of com.hamburgsud.log4testing.core.data.TestStep

  @Test
  public void testAssertOkTS() {
    TestSuite testSuite1 = new TestSuite("TestSuite1");
    TestCase testCase1 = new TestCase("TestCase1");
    testCase1.newTestStepGroup("TestStepGroup1");
    final TestStep testStep = testCase.newTestStep(TestStatus.OK,
        "mySimpleTestCommand", "This is just a simple test.",
        "Everything is working fine.");
    testStep.finish();
    testCase1.addTestStep(testStep);
    testSuite1.addTestCase(testCase1);
    Assert.assertOk(testSuite1);
  }
View Full Code Here

Examples of com.hamburgsud.log4testing.core.data.TestStep

   * Creates a TestCase with an OK TestStep
   */
  public TestCase createTCOK() {
    TestCase testCase1 = new TestCase("TestCase1");
    testCase1.newTestStepGroup("TestStepGroup1");
    final TestStep testStep = testCase.newTestStep(TestStatus.OK,
        "mySimpleTestCommand", "This is just a simple test.",
        "Everything is working fine.");
    testCase1.addTestStep(testStep);
    return testCase1;
  }
View Full Code Here

Examples of com.hamburgsud.log4testing.core.data.TestStep

   * Creates a TestStep with TestStatus ERROR
   * @return Error TestStep
   */
  public TestStep ErrorTestStep() {
    testCase.newTestStepGroup("This is another simple Test");
    final TestStep testStep = testCase
        .newTestStep(TestStatus.ERROR, "anotherSimpleTestCommand",
            "The expected behaviour is that the status of this test step is an error.");
    return testStep;
  }
View Full Code Here

Examples of com.hamburgsud.log4testing.core.data.TestStep

   * Creates a TestStep with TestStatus OK
   * @return
   */
  public TestStep OKTestStep() {
    testCase.newTestStepGroup("This is another simple Test");
    final TestStep testStep = testCase
        .newTestStep(TestStatus.OK, "anotherSimpleTestCommand",
            "The expected behaviour is that the status of this test step is ok.");
    return testStep;
  }
View Full Code Here

Examples of net.thucydides.core.model.TestStep

   
    @Test
    public void screenshots_should_have_a_separate_html_report()  throws Exception {
        TestOutcome testOutcome = TestOutcome.forTest("should_do_this", SomeTestScenario.class);

        TestStep step1 = TestStepFactory.successfulTestStepCalled("step 1");
        File screenshot = temporaryDirectory.newFile("google_page_1.png");
        File screenshotSource = temporaryDirectory.newFile("google_page_1.html");
        step1.addScreenshot(new ScreenshotAndHtmlSource(screenshot,screenshotSource));
        testOutcome.recordStep(step1);

        reporter.generateReportFor(testOutcome, allTestOutcomes);

        File screenshotReport = new File(outputDirectory, Digest.ofTextValue("net.thucydides.core.reports.integration.AbstractReportGenerationTest/a_user_story_should_do_this") + "_screenshots.html");
View Full Code Here

Examples of org.helidb.test.support.concurrent.TestStep

      populateDb(db);
      Map<String, Object> m = new HashMap<String, Object>();
      m.put("db", db);
      m.put("latch1", new CountDownLatch(3));
      m.put("flag1", new AtomicBoolean(false));
      TestStep readingTestStep = new TestStep() {
        public void runStep(Map<String, Object> mp) throws Exception
        {
          CountDownLatch l1 = (CountDownLatch) mp.get("latch1");
          try
          {
            TransactionalDatabase<?, ?> tdb = (TransactionalDatabase<?, ?>) mp.get("db");
            Transaction txn = Transaction.startTransaction(true);
            try
            {
              tdb.joinTransaction(true);

              l1.countDown();
              l1.await();
              l1 = null;

              Thread.sleep(1000);
              assertFalse(((AtomicBoolean) mp.get("flag1")).get());
            }
            finally
            {
              txn.rollback();
            }
            // Now the database is closed.
          }
          finally
          {
            if (l1 != null)
            {
              l1.countDown();
            }
          }
        }
      };

      new ConcurrentTestRunner(new TestStep[][] {
      // Thread that will close the database
          new TestStep[] { new TestStep() {
            public void runStep(Map<String, Object> mp) throws Exception
            {
              CountDownLatch l1 = (CountDownLatch) mp.get("latch1");
              try
              {
View Full Code Here

Examples of org.helidb.test.support.concurrent.TestStep

      populateDb(db);
      Map<String, Object> m = new HashMap<String, Object>();
      m.put("db", db);
      m.put("latch1", new CountDownLatch(2));
      m.put("flag1", new AtomicBoolean(false));
      new ConcurrentTestRunner(new TestStep[][] { new TestStep[] { new TestStep() {
        public void runStep(Map<String, Object> mp) throws Exception
        {
          CountDownLatch l1 = (CountDownLatch) mp.get("latch1");
          try
          {
            TransactionalDatabase<?, ?> tdb = (TransactionalDatabase<?, ?>) mp.get("db");
            // Start a transaction and count down the latch
            Transaction txn = Transaction.startTransaction(false);
            try
            {
              // Let the database join the transaction
              tdb.joinTransaction(false);
              l1.countDown();
              l1.await();
              l1 = null;

              // Sleep awhile to give the other thread plenty of
              // time to set the flag
              Thread.sleep(1000);
              // Still not set
              assertFalse(((AtomicBoolean) mp.get("flag1")).get());
            }
            finally
            {
              txn.rollback();
            }
          }
          finally
          {
            if (l1 != null)
            {
              l1.countDown();
            }
          }
        }
      } }, new TestStep[] { new TestStep() {
        public void runStep(Map<String, Object> mp) throws Exception
        {
          CountDownLatch l1 = (CountDownLatch) mp.get("latch1");
          try
          {
View Full Code Here

Examples of org.helidb.test.support.concurrent.TestStep

        Map<String, Object> m = new HashMap<String, Object>();
        m.put("db1", db1);
        m.put("db2", db2);
        m.put("latch1", new CountDownLatch(2));
        m.put("flag1", new AtomicBoolean(false));
        new ConcurrentTestRunner(new TestStep[][] { new TestStep[] { new TestStep() {
          public void runStep(Map<String, Object> mp) throws Exception
          {
            CountDownLatch l1 = (CountDownLatch) mp.get("latch1");
            try
            {
              TransactionalDatabase<?, ?> tdb1 = (TransactionalDatabase<?, ?>) mp.get("db1");
              TransactionalDatabase<?, ?> tdb2 = (TransactionalDatabase<?, ?>) mp.get("db2");
              // Start a transaction and count down the latch
              Transaction txn = Transaction.startTransaction(false);
              try
              {
                // Let the databases join the transaction
                tdb1.joinTransaction(false);
                tdb2.joinTransaction(false);
                l1.countDown();
                l1.await();
                l1 = null;

                // Sleep awhile to give the other thread plenty
                // of time to set the flag
                Thread.sleep(1000);
                // Still not set
                assertFalse(((AtomicBoolean) mp.get("flag1")).get());
              }
              finally
              {
                txn.rollback();
              }
            }
            finally
            {
              if (l1 != null)
              {
                l1.countDown();
              }
            }
          }
        } }, new TestStep[] { new TestStep() {
          public void runStep(Map<String, Object> mp) throws Exception
          {
            CountDownLatch l1 = (CountDownLatch) mp.get("latch1");
            try
            {
View Full Code Here

Examples of org.helidb.test.support.concurrent.TestStep

      populateDb(db);
      Map<String, Object> m = new HashMap<String, Object>();
      m.put("db", db);
      m.put("latch1", new CountDownLatch(3));
      m.put("flag1", new AtomicBoolean(false));
      TestStep readingTestStep = new TestStep() {
        public void runStep(Map<String, Object> mp) throws Exception
        {
          CountDownLatch l1 = (CountDownLatch) mp.get("latch1");
          try
          {
            TransactionalDatabase<?, ?> tdb = (TransactionalDatabase<?, ?>) mp.get("db");
            Transaction txn = Transaction.startTransaction(true);
            try
            {
              tdb.joinTransaction(true);

              l1.countDown();
              l1.await();
              l1 = null;

              Thread.sleep(1000);
              // Now the database is closed.
              assertFalse(((AtomicBoolean) mp.get("flag1")).get());
            }
            finally
            {
              txn.rollback();
            }
          }
          finally
          {
            if (l1 != null)
            {
              l1.countDown();
            }
          }
        }
      };

      new ConcurrentTestRunner(new TestStep[][] {
      // Thread that will close the database
          new TestStep[] { new TestStep() {
            public void runStep(Map<String, Object> mp) throws Exception
            {
              CountDownLatch l1 = (CountDownLatch) mp.get("latch1");
              try
              {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.