Package com.google.appengine.api.log

Examples of com.google.appengine.api.log.LogQuery$Version


    public void testGetters() throws Exception {
        long batchSize = 20;
        long startMilliTime = System.currentTimeMillis() - 3000L;
        long endMilliTime = System.currentTimeMillis() - 2000L;
        List<String> majorVersions = Arrays.asList("1", "2", "3");
        LogQuery logQuery =  new LogQuery()
            .batchSize((int) batchSize)
            .startTimeMillis(startMilliTime)
            .endTimeMillis(endMilliTime)
            .minLogLevel(LogService.LogLevel.WARN)
            .includeIncomplete(true)
            .includeAppLogs(true)
            .offset(null)
            .majorVersionIds(majorVersions);

        executeQuery(logQuery);

        // The LogQuery should be unmodified, so you can re-use.
        assertEquals(batchSize, (long)logQuery.getBatchSize());
        assertEquals(startMilliTime, (long)logQuery.getStartTimeMillis());
        assertEquals(startMilliTime * 1000, (long)logQuery.getStartTimeUsec());
        assertEquals(endMilliTime, (long)logQuery.getEndTimeMillis());
        assertEquals(endMilliTime * 1000, (long)logQuery.getEndTimeUsec());
        assertEquals(LogService.LogLevel.WARN, logQuery.getMinLogLevel());
        assertEquals(true, logQuery.getIncludeIncomplete());
        assertEquals(true, logQuery.getIncludeAppLogs());
        assertEquals(null, logQuery.getOffset());
        assertEquals(majorVersions, logQuery.getMajorVersionIds());
        assertEquals(new ArrayList<String>(), logQuery.getRequestIds());

        List<LogQuery.Version> versions = Arrays.asList(new LogQuery.Version("module1", "1"), new LogQuery.Version("module2", "3"));
        logQuery =  new LogQuery()
            .versions(versions)
            .startTimeMillis(startMilliTime);

        executeQuery(logQuery);

        assertEquals(versions, logQuery.getVersions());
    }
View Full Code Here


        }
        return false;
    }

    protected AppLogLine findLogLineContaining(String text, int retryMax) {
        LogQuery logQuery = new LogQuery()
            .includeAppLogs(true)
            .includeIncomplete(true)
                // Not specifying start time causes test to time out since it searches
                // all the logs.
            .startTimeMillis(System.currentTimeMillis() - (20 * 1000));
 
View Full Code Here

    }

    @Override
    public boolean isFeatureSupported(String featureID) {
        if (featureID.equals(FEATURE_SCHEMADEFINITION)) {           
            Version version = VersionCompliance.toWGAVersion(getVersionCompliance());
            return (version != null && version.isAtLeast(5, 2)) || (getSchemaDefinitionFile() != null && getSchemaDefinitionFile().exists());
        }
        return super.isFeatureSupported(featureID);
    }
View Full Code Here

  public String getName() {
    return "Deployment [" + _deployment.getName() + "]";
  }

  public String[] getDependencies() {
    Version version = _deployment.getWGAVersion();
    if (version != null) {
      if (version.isAtLeast(5, 0)) {
        return new String[] {WGADesignerPlugin.LIBRARY_SET_J2EE_1_4};
      } else if (version.isAtLeast(4, 1)) {
        return new String[] {WGADesignerPlugin.LIBRARY_SET_J2EE_1_4};
      } else if (version.isAtLeast(4, 0)) {
        return new String[] {WGADesignerPlugin.LIBRARY_SET_J2EE_1_4};
      } else if (version.isAtLeast(3, 3)) {
        return new String[] {WGADesignerPlugin.LIBRARY_SET_J2EE_1_3};
      }
    }   
    return null;
  }
View Full Code Here

          while (it.hasNext()) {
            TMLTag tag = it.next();
            proposals.addAll(createTagProposals(alreadyTyped, tag, _document, _cursorAbsolute,activeFile));
          }
        } else {
          Version wgaVersion = (Version) WGADesignConfigurationModel.VERSIONCOMPLIANCE_TO_WGA_VERSION.get(WGADesignStructureHelper.getWGAVersionCompliance(activeFile).getKey())
          if (wgaVersion.isAtLeast(4, 1)) {
            proposals.addAll(createIncludeModuleProposals(alreadyTyped, _document, _cursorAbsolute, activeFile));
          }
        }
      }     
    } else if (!isCursorInAttributeValue()) {
View Full Code Here

 
  public static VersionCompliance wgaVersionToVersionCompliance(Version version){     
      if(version!=null){
          Set<String> keySet = WGADesignConfigurationModel.VERSIONCOMPLIANCE_TO_WGA_VERSION.keySet();
          for(String currentKey : keySet){
              Version currentVersion = (Version)WGADesignConfigurationModel.VERSIONCOMPLIANCE_TO_WGA_VERSION.get(currentKey);
              if(currentVersion.getMajorVersion() == version.getMajorVersion() && currentVersion.getMinorVersion() == version.getMinorVersion()){
                  return WGADesignConfigurationModel.VERSIONCOMPLIANCES.get(currentKey);           
              }             
          }     
      }     
      return null;
View Full Code Here

    _versionCompliance = versionCompliance;
 

  protected boolean wgaVersionIsAtLeast(int major, int minor) {
    if (_versionCompliance != null) {
      Version wgaVersion = (Version) WGADesignConfigurationModel.VERSIONCOMPLIANCE_TO_WGA_VERSION.get(_versionCompliance.getKey());
      return wgaVersion.isAtLeast(major, minor);
    }
    return false;
  }
View Full Code Here

 
  private static String retrieveTagInfoURL(String tagname, VersionCompliance versionCompliance) {
      StringBuffer url = new StringBuffer();
      url.append(TAG_INFO_URL);
      url.append("&tag=" + tagname);
      Version version = VersionCompliance.toWGAVersion(versionCompliance);
        if (version != null) {
            url.append("&version=" +  Integer.toString(version.getMajorVersion()) + Integer.toString(version.getMinorVersion()));
        }
      return url.toString();
  }
View Full Code Here

      url.append("&tag=" + tagname);
      url.append("&attribute=" + attribute);
      if (value != null) {
          url.append("&value=" + value);
      }
      Version version = VersionCompliance.toWGAVersion(versionCompliance);
      if (version != null) {
          url.append("&version=" +  Integer.toString(version.getMajorVersion()) + Integer.toString(version.getMinorVersion()));
      }
      return url.toString();
  }
View Full Code Here

              url.append(BROWSE_DOCUMENTATION_URL);
              url.append("?tag=" + tagname);
              if (_attribute != null) {
                  url.append("&attribute=" + _attribute);   
              }
              Version version = VersionCompliance.toWGAVersion(_versionCompliance);
              if (version != null) {
                  url.append("&version=" +  Integer.toString(version.getMajorVersion()) + Integer.toString(version.getMinorVersion()));
              }
              return new URL(url.toString());
          } catch (Exception e) {
              return null;
          }       
View Full Code Here

TOP

Related Classes of com.google.appengine.api.log.LogQuery$Version

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.