EMMA Coverage Report (generated Wed Aug 10 12:30:04 EDT 2011)
[all classes][org.jclouds.savvis.vpdc.xml]

COVERAGE SUMMARY FOR SOURCE FILE [OrgListHandler.java]

nameclass, %method, %block, %line, %
OrgListHandler.java100% (1/1)100% (3/3)83%  (29/35)95%  (7.6/8)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class OrgListHandler100% (1/1)100% (3/3)83%  (29/35)95%  (7.6/8)
getResult (): Set 100% (1/1)60%  (9/15)80%  (1.6/2)
OrgListHandler (): void 100% (1/1)100% (6/6)100% (2/2)
startElement (String, String, String, Attributes): void 100% (1/1)100% (14/14)100% (4/4)

1/**
2 *
3 * Copyright (C) 2011 Cloud Conscious, LLC. <info@cloudconscious.com>
4 *
5 * ====================================================================
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 * ====================================================================
18 */
19package org.jclouds.savvis.vpdc.xml;
20 
21import static org.jclouds.savvis.vpdc.util.Utils.cleanseAttributes;
22import static org.jclouds.savvis.vpdc.util.Utils.newResource;
23import static org.jclouds.util.SaxUtils.equalsOrSuffix;
24 
25import java.util.Map;
26import java.util.Set;
27 
28import org.jclouds.http.functions.ParseSax;
29import org.jclouds.savvis.vpdc.domain.Resource;
30import org.xml.sax.Attributes;
31import org.xml.sax.SAXException;
32 
33import com.google.common.collect.ImmutableSet;
34import com.google.common.collect.ImmutableSet.Builder;
35 
36/**
37 * @author Adrian Cole
38 */
39public class OrgListHandler extends ParseSax.HandlerWithResult<Set<Resource>> {
40 
41   private Builder<Resource> org = ImmutableSet.<Resource> builder();
42 
43   public Set<Resource> getResult() {
44      try {
45         return org.build();
46      } finally {
47         org = ImmutableSet.<Resource> builder();
48      }
49   }
50 
51   @Override
52   public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException {
53      Map<String, String> attributes = cleanseAttributes(attrs);
54      if (equalsOrSuffix(qName, "Org")) {
55         org.add(newResource(attributes));
56      }
57   }
58}

[all classes][org.jclouds.savvis.vpdc.xml]
EMMA 2.0.5312 (C) Vladimir Roubtsov