Package com.google.appengine.api.log

Examples of com.google.appengine.api.log.RequestLogs


    super.tearDown();
  }

  private void checkReader(LogInputReader reader, String[] requestIds) {
    for (String expectedRequestId : requestIds) {
      RequestLogs log = reader.next();
      assertEquals(expectedRequestId, log.getRequestId());
    }
    try {
      reader.next();
      fail("Too many logs found");
    } catch (NoSuchElementException expected) {
View Full Code Here


    // Serialize and reconstruct and read one of the two logs
    LogInputReader reader2 = (LogInputReader) SerializationUtil.deserializeFromByteArray(
        SerializationUtil.serializeToByteArray(reader1));
    reader2.beginSlice();
    RequestLogs logReq02 = reader2.next();
    assertEquals("2", logReq02.getRequestId());
    reader2.endSlice();

    // Serialize and reconstruct and read the remaining log
    LogInputReader reader3 = (LogInputReader) SerializationUtil.deserializeFromByteArray(
        SerializationUtil.serializeToByteArray(reader2));
    reader3.beginSlice();
    RequestLogs logReq01 = reader3.next();
    assertEquals("1", logReq01.getRequestId());
    reader3.endSlice();
  }
View Full Code Here

        Iterator<RequestLogs> i =
            LogServiceFactory.getLogService().fetch(query).iterator();
        List<LogDTO> logs = new ArrayList<LogDTO>(LIMIT);
        int count = 0;
        while (i.hasNext() && count++ < LIMIT) {
            RequestLogs log = i.next();
            LogDTO dto = new LogDTO();
            dto.setCombined(log.getCombined());
            dto.setOffset(log.getOffset());
            List<AppLogLine> logLines = log.getAppLogLines();
            for (AppLogLine logLine : logLines) {
                dto.getLogLevels().add(logLine.getLogLevel().name());
                dto.getLogLines().add(logLine.getLogMessage());
            }
            logs.add(dto);
View Full Code Here

        log.log(Level.INFO, msg1);
        log.log(Level.INFO, msg2);
        flush(log);
        sync(15000);

        RequestLogs requestLogs = getCurrentRequestLogs();
        Integer msg1Index = null;
        Integer msg2Index = null;
        int i = 0;
        for (AppLogLine appLogLine : requestLogs.getAppLogLines()) {
            if (appLogLine.getLogMessage().contains(msg1)) {
                msg1Index = i;
            } else if (appLogLine.getLogMessage().contains(msg2)) {
                msg2Index = i;
            }
View Full Code Here

    }

    @Test
    @InSequence(20)
    public void testStartAndEndTimeUsec() throws Exception {
        RequestLogs requestLogs1 = getRequestLogs1();

        long time1 = getTime(1);
        long time2 = getTime(2);
        long startTimeUsec = requestLogs1.getStartTimeUsec();
        assertTrue("expected startTimeUsec to be >= " + time1 + ", but was " + startTimeUsec, startTimeUsec >= time1);
        assertTrue("expected startTimeUsec to be <= " + time2 + ", but was " + startTimeUsec, startTimeUsec <= time2);

        long endTimeUsec = requestLogs1.getEndTimeUsec();
        assertTrue("expected endTimeUsec to be >= " + time1 + ", but was " + endTimeUsec, endTimeUsec >= time1);
        assertTrue("expected endTimeUsec to be <= " + time2 + ", but was " + endTimeUsec, endTimeUsec <= time2);

        assertTrue("expected endTimeUsec to be more than startTimeUsec, but it wasn't (startTime was " + startTimeUsec + "; endTime was " + endTimeUsec, startTimeUsec < endTimeUsec);
    }
View Full Code Here

    }

    @Test
    @InSequence(20)
    public void testClientIp() throws Exception {
        RequestLogs requestLogs1 = getRequestLogs1();

        Property ip = property("testClientIp");
        if (ip.exists()) {
            assertEquals(ip.getPropertyValue(), requestLogs1.getIp());
        } else {
            assertRegexpMatches(REGEX_IP4, requestLogs1.getIp());
        }
    }
View Full Code Here

    }

    @Test
    @InSequence(20)
    public void testHost() throws Exception {
        RequestLogs requestLogs1 = getRequestLogs1();
        assertEquals(getServerHostAndPort(), requestLogs1.getHost());
    }
View Full Code Here

    }

    @Test
    @InSequence(20)
    public void testApplicationInfo() throws Exception {
        RequestLogs requestLogs1 = getRequestLogs1();
        String versionId = requestLogs1.getVersionId();
        assertTrue("1".equals(versionId) || versionId.startsWith("1."));
    }
View Full Code Here

    }

    @Test
    @InSequence(20)
    public void testModuleId() throws Exception {
        RequestLogs requestLogs1 = getRequestLogs1();
        String moduleId = requestLogs1.getModuleId();
        assertEquals("default", moduleId);
    }
View Full Code Here

    }

    @Test
    @InSequence(20)
    public void testRequestIdCurrentRequest() throws Exception {
        RequestLogs logs = getCurrentRequestLogs();
        assertNotNull(logs);
        String currentId = logs.getRequestId();
        assertEquals(getCurrentRequestId(), currentId);
    }
View Full Code Here

TOP

Related Classes of com.google.appengine.api.log.RequestLogs

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.