Examples of Before


Examples of org.jboss.arquillian.test.spi.event.suite.Before

        HTTPContext context = ModulesApi.findHTTPContext(configuration, protocolMetaData, method);
        return context.getServlets().get(0).getBaseURI();
    }

    public void login(@Observes EventContext<Before> event) throws Exception {
        Before before = event.getEvent();

        UserIsLoggedIn userIsLoggedIn = null;
        if (before.getTestMethod().isAnnotationPresent(UserIsLoggedIn.class)) {
            userIsLoggedIn = before.getTestMethod().getAnnotation(UserIsLoggedIn.class);
        } else if (before.getTestClass().isAnnotationPresent(UserIsLoggedIn.class)) {
            userIsLoggedIn = before.getTestClass().getAnnotation(UserIsLoggedIn.class);
        }

        if (userIsLoggedIn != null) {
            final URI baseUri = getBaseURI(before.getTestMethod());
            final WebDriver driver = createWebDriver();
            try {
                driver.manage().deleteAllCookies();

                driver.navigate().to(baseUri + USER_LOGIN_SERVLET_PATH + "?location=" + URLEncoder.encode(userIsLoggedIn.location(), "UTF-8"));
View Full Code Here

Examples of org.opengis.filter.temporal.Before

        "      </gml:TimeInstant> " +
        "   </fes:Before> " +
        "</fes:Filter>";
        buildDocument(xml);
       
        Before before = (Before) parse();
        assertNotNull(before);
       
        assertTrue(before.getExpression1() instanceof PropertyName);
        assertEquals("timeInstanceAttribute", ((PropertyName)before.getExpression1()).getPropertyName());

        assertTrue(before.getExpression2() instanceof Literal);
        assertTrue(before.getExpression2().evaluate(null) instanceof Instant);
    }
View Full Code Here

Examples of org.opengis.filter.temporal.Before

    public Before buildBeforeDate() throws CQLException {
   
    Expression right = this.resultStack.popExpression();
        Expression left = this.resultStack.popExpression();
       
        Before filter =  this.filterFactory.before(left, right);
       
        return filter;
    }
View Full Code Here

Examples of org.opengis.filter.temporal.Before

        Literal date = period.getBeginning();

        Expression property = this.resultStack.popExpression();

        Before filter = filterFactory.before(property, date);

        return filter;
   
View Full Code Here

Examples of org.opengis.filter.temporal.Before

        Period period = this.resultStack.popPeriod();
       
        PropertyName property = this.resultStack.popPropertyName();

        // makes the after filter
        Before right = this.filterFactory.before(property, filterFactory.literal(period.getBeginning()));
       
        // makes the during filter
        During left = this.filterFactory.during(property, this.filterFactory.literal(period));
       
        Or filter = this.filterFactory.or(right, left);
View Full Code Here

Examples of org.opengis.filter.temporal.Before

    private static Or buildBeforeOrDuringFilter(
        final PropertyName property,
        final Date firstDate,
        final Date lastDate) {
      Before before = FACTORY.before(property, FACTORY.literal(firstDate));
     
      Period period = createPeriod(firstDate, lastDate);
      During during  = FACTORY.during(property, FACTORY.literal(period));
      Or filter = FACTORY.or(before, during  );
      return filter;
View Full Code Here

Examples of org.opengis.filter.temporal.Before

     * @return Before
     * @throws CQLException
     */
    private Before buildBeforePredicate()
            throws CQLException {
        Before filter = null;

        // analyzes if the last build is period or date
        Result node = this.builder.peekResult();

        switch (node.getNodeType()) {
View Full Code Here

Examples of org.opengis.filter.temporal.Before

    public void dateTime() throws Exception{
               
      final String cqlDateTime = "2008-09-09T17:00:00Z";
        Filter resultFilter = CompilerUtil.parseFilter(this.language, "ZONE_VALID_FROM BEFORE " + cqlDateTime);

        Before comparation = (Before) resultFilter;

        // date test
        Expression expr2 = comparation.getExpression2();
        Literal literalDate = (Literal)expr2;
       
        final String DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss'Z'";
       
        final DateFormat dateFormatter = new SimpleDateFormat(DATE_FORMAT);
View Full Code Here

Examples of org.opengis.filter.temporal.Before

               
        String localTime = "2008-09-09T17:00:00";

        Filter resultFilter = CompilerUtil.parseFilter(this.language, "ZONE_VALID_FROM BEFORE " + localTime);

        Before comparation = (Before) resultFilter;

        // date test
        Expression expr2 = comparation.getExpression2();
        Literal literalDate = (Literal)expr2;
       
        final String DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss";
       
        final DateFormat dateFormatter = new SimpleDateFormat(DATE_FORMAT);
View Full Code Here

Examples of org.opengis.filter.temporal.Before

      TimeZone tz = TimeZone.getTimeZone(offset);
      dateFormatter.setTimeZone(tz);

      Filter resultFilter = CompilerUtil.parseFilter(this.language,"ZONE_VALID_FROM BEFORE 2008-09-09T17:00:00+01:00");

      Before comparation = (Before) resultFilter;

      Expression expr2 = comparation.getExpression2();
      Literal literalDate = (Literal) expr2;
      Date actualDate = (Date) literalDate.getValue();

      Date expectedDate = dateFormatter.parse("2008-09-09 17:00:00" +  offset);

      Assert.assertEquals(expectedDate, actualDate);

    }

    {
        //JD: there was a bug in this test case with the date format, litte "z" has to
        // specified as a named timezone, not an offset, so it was just being ignored
        // plus the offset was wrong
      // test offset GMT-01:00
          //final DateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ssz");
    //    final String offset = "GMT+01:00";
                final DateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
      final String offset = "GMT-01:00";
          TimeZone tz = TimeZone.getTimeZone(offset);
          dateFormatter.setTimeZone(tz);

          Filter resultFilter = CompilerUtil.parseFilter(this.language, "ZONE_VALID_FROM BEFORE 2008-09-09T17:00:00-01:00");


      Before comparation = (Before) resultFilter;

      Expression expr2 = comparation.getExpression2();
      Literal literalDate = (Literal) expr2;
      Date actualDate = (Date) literalDate.getValue();
       
      //Date expectedDate = dateFormatter.parse("2008-09-09 17:00:00 " +  offset);
      Date expectedDate = dateFormatter.parse("2008-09-09 17:00:00");
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.