Examples of Weather


Examples of com.cosmo.web.sample.Weather

   public PageContext formSendedEvent(PageContext pc, HttpServletRequest request, HttpServletResponse response)
   {
      DataAgent conn;
      WeatherManager wm;

      Weather weather = new Weather();
      weather.setCityName(HttpRequestUtils.getValue(request, "txtName"));
      weather.setTempMin(HttpRequestUtils.getInt(request, "txtTMin"));
      weather.setTempMax(HttpRequestUtils.getInt(request, "txtTMax"));
      weather.setPrecipitation(HttpRequestUtils.getInt(request, "txtPre"));

      try
      {
         conn = DataFactory.getInstance(getWorkspace());
         wm = new WeatherManager(conn);
View Full Code Here

Examples of com.cosmo.web.sample.Weather

   public PageContext formSendedEvent(PageContext pc, HttpServletRequest request, HttpServletResponse response)
   {
      DataAgent conn;
      WeatherManager wm;
     
      Weather weather = new Weather();
      weather.setCityName(HttpRequestUtils.getValue(request, "txtName"));
      weather.setTempMin(HttpRequestUtils.getInt(request, "txtTMin"));
      weather.setTempMax(HttpRequestUtils.getInt(request, "txtTMax"));
      weather.setPrecipitation(HttpRequestUtils.getInt(request, "txtPre"));
     
      try
      {
         conn = DataFactory.getInstance(getWorkspace(), "cosmo.server");
View Full Code Here

Examples of org.external.model.Weather

    // STUB
  }
 
  public Weather getWeather(String sessionId, boolean celsius, String countryName, String cityName) {
    // STUB
    return new Weather();
  }
View Full Code Here

Examples of org.sonatype.mavenbook.weather.Weather

  }
 
  public void testParser() throws Exception {
    InputStream nyData =
      getClass().getClassLoader().getResourceAsStream("ny-weather.xml");
    Weather weather = new YahooParser().parse( nyData );
    assertEquals( "New York", weather.getCity() );
    assertEquals( "NY", weather.getRegion() );
    assertEquals( "US", weather.getCountry() );
    assertEquals( "39", weather.getTemp() );
    assertEquals( "Fair", weather.getCondition() );
    assertEquals( "39", weather.getChill() );
    assertEquals( "67", weather.getHumidity() );
  }
View Full Code Here

Examples of org.sonatype.mavenbook.weather.Weather

  }
 
  public void testFormat() throws Exception {
    InputStream nyData =
      getClass().getClassLoader().getResourceAsStream("ny-weather.xml");
    Weather weather = new YahooParser().parse( nyData );
    String formattedResult = new WeatherFormatter().format( weather );
    InputStream expected =
      getClass().getClassLoader().getResourceAsStream("format-expected.dat");
    assertEquals( IOUtils.toString( expected ), formattedResult );
  }
View Full Code Here

Examples of org.sonatype.mavenbook.weather.Weather

  }
 
  public void testParser() throws Exception {
    InputStream nyData =
      getClass().getClassLoader().getResourceAsStream("ny-weather.xml");
    Weather weather = new YahooParser().parse( nyData );
    assertEquals( "New York", weather.getCity() );
    assertEquals( "NY", weather.getRegion() );
    assertEquals( "US", weather.getCountry() );
    assertEquals( "39", weather.getTemp() );
    assertEquals( "Fair", weather.getCondition() );
    assertEquals( "39", weather.getChill() );
    assertEquals( "67", weather.getHumidity() );
  }
View Full Code Here

Examples of org.sonatype.mavenbook.weather.Weather

  }
 
  public void testFormat() throws Exception {
    InputStream nyData =
      getClass().getClassLoader().getResourceAsStream("ny-weather.xml");
    Weather weather = new YahooParser().parse( nyData );
    String formattedResult = new WeatherFormatter().format( weather );
    InputStream expected =
      getClass().getClassLoader().getResourceAsStream("format-expected.dat");
    assertEquals( IOUtils.toString( expected ), formattedResult );
  }
View Full Code Here

Examples of org.sonatype.mavenbook.weather.model.Weather

  public Main(String zip) {
    this.zip = zip;
  }

  public void getWeather() throws Exception {
    Weather weather = weatherService.retrieveForecast(zip);
    weatherDAO.save( weather );
    System.out.print(new WeatherFormatter().formatWeather(weather));
  }
View Full Code Here

Examples of org.sonatype.mavenbook.weather.model.Weather

  public Weather retrieveForecast(String zip) throws Exception {
    // Retrieve Data
    InputStream dataIn = yahooRetriever.retrieve(zip);

    // Parse DataS
    Weather weather = yahooParser.parse(zip, dataIn);

    return weather;
  }
View Full Code Here

Examples of org.sonatype.mavenbook.weather.model.Weather

  public ModelAndView handleRequest(HttpServletRequest request,
      HttpServletResponse response) throws Exception {

    String zip = request.getParameter("zip");
    Weather weather = weatherService.retrieveForecast(zip);
    weatherDAO.save(weather);
    return new ModelAndView("weather", "weather", weather);
  }
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.