Package er.selenium

Examples of er.selenium.SeleniumTest$Command


    /**
     * Create an instance of {@link Command }
     *
     */
    public Command createCommand() {
        return new Command();
    }
View Full Code Here


    boolean failed = false;
    SeleniumTestRCRunner runner = new SeleniumTestRCRunner(host, port, browserType, appHost);
    runner.prepare();
    try {
      for (File testFile : testsFiles) {
        SeleniumTest test = null;
        try {
          SeleniumCompositeTestFilter testFilter = new SeleniumCompositeTestFilter();
          File[] searchPaths = {testFile.getAbsoluteFile().getParentFile(), testsRoot.getAbsoluteFile()};
          testFilter.addTestFilter(new SeleniumIncludeTestFilter(new NSArray<File>(searchPaths)));
          testFilter.addTestFilter(new SeleniumRepeatExpanderTestFilter());
          testFilter.addTestFilter(new SeleniumOverrideOpenTestFilter(appHost));
         
          test = new SeleniumTestFileProcessor(testFile, testFilter).process();
          log.debug("running: " + testFile);
          runner.run(test);
         
          log.info(String.format("test '%s' PASSED", testFile));
          log.info("");
        } catch (SeleniumTestFailureException e) {
          failed = true;
         
          log.error(String.format("test '%s' FAILED: %s", testFile, e));
          log.error("test log:");
          int curCommand = 0;
          for (SeleniumTest.Element elem: test.elements()) {
            if (elem instanceof SeleniumTest.Command) {
              if (curCommand++ > e.processedCommands()) {
                break;
              }
              SeleniumTest.Command command = (SeleniumTest.Command)elem;
View Full Code Here

          fileContents = ERXFileUtilities.stringFromFile(fio, CharEncoding.UTF_8);
        } catch (IOException e) {
          log.error("Can't read " + fio.getAbsolutePath() + " contents");
          throw new RuntimeException(e);
        }
        SeleniumTest processedTest = importer.process(fileContents);
        return processedTest.elements();
      }     
    }
   
    throw new RuntimeException("Included path not found: " + name);
  }
View Full Code Here

          break;
        default:
          elements.add(new SeleniumTest.Comment(line));
        }
      }
      return new SeleniumTest("", elements);
    } catch (IOException e) {
      throw new RuntimeException("Internal error during parsing", e);
    } catch (RuntimeException e) {
      throw new RuntimeException("Error on line " + lineNumber + " during parsing", e);
    }
View Full Code Here

      }
    } catch (Exception e) {
      throw new RuntimeException("Error parsing document.", e);
    }
   
    SeleniumTest test = new SeleniumTest(name, elements);
    test.dump();
    return test;
  }
View Full Code Here

        } else {
          throw new IOException("Unexpected character");
        }
      }
      try {
        out.add(new Command(bytes));
      } finally {
        bytes = null;
        arguments = 0;
      }
    } else if (in.readByte() == '*') {
      long l = readLong(in);
      if (l > Integer.MAX_VALUE) {
        throw new IllegalArgumentException("Java only supports arrays up to " + Integer.MAX_VALUE + " in size");
      }
      int numArgs = (int) l;
      if (numArgs < 0) {
        throw new RedisException("Invalid size: " + numArgs);
      }
      bytes = new byte[numArgs][];
      checkpoint();
      decode(ctx, in, out);
    } else {
      // Go backwards one
      in.readerIndex(in.readerIndex() - 1);
      // Read command -- can't be interupted
      byte[][] b = new byte[1][];
      b[0] = in.readBytes(in.bytesBefore((byte) '\r')).array();
      in.skipBytes(2);
      out.add(new Command(b, true));
    }
  }
View Full Code Here

        boolean isOff = _hasTrueInput(off);
        boolean isOn = _hasTrueInput(on);

        if ((brightLevel >= 0) && (brightLevel <= 100)) {
            _transmit(new Command((_destination), x10.Command.BRIGHT,
                    brightLevel));
        }

        if ((dimLevel >= 0) && (dimLevel <= 100)) {
            _transmit(new Command((_destination), x10.Command.DIM, dimLevel));
        }

        if (isOn) {
            _transmit(new Command((_destination), x10.Command.ON));
        }

        if (isOff) {
            _transmit(new Command((_destination), x10.Command.OFF));
        }
    }
View Full Code Here

    public void fire() throws IllegalActionException {
        super.fire();

        // Check whether a command is ready.
        if (_commandReady()) {
            Command command = _getCommand();
            receivedCommand.send(0, new StringToken(_commandToString(command)));
        } else {
            receivedCommand.send(0, _EMPTY_STRING);
        }
    }
View Full Code Here

    public void fire() throws IllegalActionException {
        super.fire();

        // Check whether a command is ready
        if (_commandReady()) {
            Command sensedCommand = _getCommand();
            byte function = sensedCommand.getFunctionByte();
            byte functionOfInterest = Command.BRIGHT;
            String commandValue = command.stringValue();

            if (!commandValue.equals("BRIGHT")) {
                functionOfInterest = Command.DIM;
            }

            String sensedHouseCode = "" + sensedCommand.getHouseCode();
            int sensedUnitCode = sensedCommand.getUnitCode();

            String houseCodeValue = houseCode.stringValue();
            int unitCodeValue = ((IntToken) unitCode.getToken()).intValue();

            if (sensedHouseCode.equals(houseCodeValue)
                    && (sensedUnitCode == unitCodeValue)
                    && (function == functionOfInterest)) {
                level.send(0, new IntToken(sensedCommand.getLevel()));
            } else {
                level.send(0, _NO_COMMAND_TOKEN);
            }
        } else {
            level.send(0, _NO_COMMAND_TOKEN);
View Full Code Here

        boolean isOn = _hasTrueInput(on);
        boolean isOff = _hasTrueInput(off);

        if (isOn) {
            _transmit(new Command((_destination), x10.Command.ON));
        }

        if (isOff) {
            _transmit(new Command((_destination), x10.Command.OFF));
        }
    }
View Full Code Here

TOP

Related Classes of er.selenium.SeleniumTest$Command

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.