Package fitnesse.testsystems

Examples of fitnesse.testsystems.Descriptor


    }
  }

  @Test
  public void slimDefaultTimeoutIs10Seconds() throws Exception {
    Descriptor descriptor = mock(Descriptor.class);
    when(descriptor.getVariable("slim.debug.timeout")).thenReturn("30");
    assertEquals(10, new SlimClientBuilder(descriptor).determineTimeout());
  }
View Full Code Here


  }


  @Test
  public void slimDebugTimeoutIsUsedWhenExecutingWithDebugMode() throws Exception {
    Descriptor descriptor = mock(Descriptor.class);
    when(descriptor.isDebug()).thenReturn(true);
    when(descriptor.getVariable("slim.debug.timeout")).thenReturn("30");
    assertEquals(30, new SlimClientBuilder(descriptor).determineTimeout());
  }
View Full Code Here

  public void testReadSystemPropertyIfPagePropertyDoesNotExist() {
    String pageText = "!define TEST_PROPERTY {foo}\n";
    System.setProperty("test.property", "bar");
    WikiPage page = makeTestPage(pageText);

    Descriptor descriptor = new WikiPageDescriptor(page, false, false, "");
    assertEquals("foo", descriptor.getVariable("TEST_PROPERTY"));
    assertEquals("bar", descriptor.getVariable("test.property"));
  }
View Full Code Here

  public void testPageVariableTakesPrecedenceOverSystemProperty() {
    String pageText = "!define TEST_PROPERTY {foo}\n";
    System.setProperty("TEST_PROPERTY", "bar");
    WikiPage page = makeTestPage(pageText);

    Descriptor descriptor = new WikiPageDescriptor(page, false, false, "");
    assertEquals("foo", descriptor.getVariable("TEST_PROPERTY"));
  }
View Full Code Here

      }
    }
  }

  private TestSystem startTestSystem(final WikiPageIdentity identity, final List<TestPage> testPages) throws IOException {
    Descriptor descriptor = new Descriptor() {
      private ClassPath classPath;

      @Override
      public String getTestSystem() {
        String testSystemName = getVariable(WikiPageIdentity.TEST_SYSTEM);
        if (testSystemName == null)
          return "fit";
        return testSystemName;
      }

      @Override
      public String getTestSystemType() {
        return getTestSystem().split(":")[0];
      }

      @Override
      public ClassPath getClassPath() {
        if (classPath == null) {
          ArrayList<ClassPath> paths = new ArrayList<ClassPath>();
          for (TestPage testPage: testPages) {
            paths.add(testPage.getClassPath());
          }
          classPath = new ClassPath(paths);
        }
        return classPath;
      }

      @Override
      public boolean runInProcess() {
        return runInProcess;
      }

      @Override
      public boolean isDebug() {
        return enableRemoteDebug;
      }

      @Override
      public String getVariable(String name) {
        return identity.getVariable(name);
      }

      @Override
      public ExecutionLogListener getExecutionLogListener() {
        return executionLogListener;
      }
    };

    InternalTestSystemListener internalTestSystemListener = new InternalTestSystemListener();
    try {
      testSystem = testSystemFactory.create(descriptor);

      testSystem.addTestSystemListener(internalTestSystemListener);
      testSystem.start();
    } catch (Exception e) {
      formatters.unableToStartTestSystem(descriptor.getTestSystem(), e);
      return null;
    }
    return testSystem;
  }
View Full Code Here

TOP

Related Classes of fitnesse.testsystems.Descriptor

Copyright © 2018 www.massapicom. 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.