Exemplo n.º 1
0
  /**
   * Transforms the Collection of SystemUnderTests into a Vector of SystemUnderTests parameters.
   *
   * @param suts
   * @return the Collection of SystemUnderTests into a Vector of SystemUnderTests parameters
   */
  public static Vector<Object> toXmlRpcSystemUnderTestsParameters(
      Collection<SystemUnderTest> suts) {
    Vector<Object> sutsParams = new Vector<Object>();
    for (SystemUnderTest sut : suts) {
      sutsParams.add(sut.marshallize());
    }

    return sutsParams;
  }
Exemplo n.º 2
0
  /**
   * Transforms the Vector of the SystemUnderTest parameters into a SystemUnderTest Object.<br>
   * Structure of the parameters:<br>
   * Vector[name, Vector[project parameters], Vector[seeds classPaths], Vector[fixture classPaths],
   * fixturefactory, fixturefactoryargs, isdefault,
   * Runner['name','cmd',['envtypename'],'servername','serverport','mainclass',['cp1','cp2'],'secured'],
   * projectdependencydescriptor]
   *
   * @param xmlRpcParameters
   * @return the SystemUnderTest.
   */
  @SuppressWarnings("unchecked")
  public static SystemUnderTest toSystemUnderTest(Vector<Object> xmlRpcParameters) {
    SystemUnderTest sut = null;
    if (!xmlRpcParameters.isEmpty()) {
      ClasspathSet sutClasspaths =
          new ClasspathSet((Vector) xmlRpcParameters.get(SUT_CLASSPATH_IDX));
      ClasspathSet fixtureClasspaths =
          new ClasspathSet((Vector) xmlRpcParameters.get(SUT_FIXTURE_CLASSPATH_IDX));

      sut = SystemUnderTest.newInstance((String) xmlRpcParameters.get(SUT_NAME_IDX));
      sut.setProject(toProject((Vector<Object>) xmlRpcParameters.get(SUT_PROJECT_IDX)));
      sut.setSutClasspaths(sutClasspaths);
      sut.setFixtureClasspaths(fixtureClasspaths);
      sut.setFixtureFactory(toNullIfEmpty((String) xmlRpcParameters.get(SUT_FIXTURE_FACTORY_IDX)));
      sut.setFixtureFactoryArgs(
          toNullIfEmpty((String) xmlRpcParameters.get(SUT_FIXTURE_FACTORY_ARGS_IDX)));
      sut.setIsDefault((Boolean) xmlRpcParameters.get(SUT_IS_DEFAULT_IDX));
      sut.setRunner(toRunner((Vector<Object>) xmlRpcParameters.get(SUT_RUNNER_IDX)));
      sut.setProjectDependencyDescriptor(
          toNullIfEmpty((String) xmlRpcParameters.get(SUT_PROJECT_DEPENDENCY_DESCRIPTOR_IDX)));
    }

    return sut;
  }