EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.prototype.framework.utils]

COVERAGE SUMMARY FOR SOURCE FILE [UserMenu.java]

nameclass, %method, %block, %line, %
UserMenu.java0%   (0/1)0%   (0/4)0%   (0/123)0%   (0/29)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class UserMenu0%   (0/1)0%   (0/4)0%   (0/123)0%   (0/29)
<static initializer> 0%   (0/1)0%   (0/3)0%   (0/2)
UserMenu (): void 0%   (0/1)0%   (0/3)0%   (0/1)
showMenuItems (String [][]): void 0%   (0/1)0%   (0/69)0%   (0/12)
showUserMenu (String [][]): List 0%   (0/1)0%   (0/48)0%   (0/15)

1package de.uka.ipd.sdq.prototype.framework.utils;
2 
3import java.util.Collection;
4import java.util.LinkedList;
5import java.util.List;
6import java.util.Scanner;
7 
8import de.uka.ipd.sdq.prototype.framework.AbstractAllocationStorage;
9 
10public class UserMenu
11{
12        protected static org.apache.log4j.Logger logger = org.apache.log4j.Logger.getRootLogger();
13 
14        /**
15         * Shows the user menu and receives user selections
16         * @return List of selections the user made
17         */
18        public static List<Integer> showUserMenu(String[][] systems) {
19                System.out.println("Select starting option:");
20                showMenuItems(systems);
21                System.out.print("Option: ");
22                Scanner sc = new Scanner(System.in);
23                String st = null;
24                if (sc.hasNextLine()) {
25                        st = sc.nextLine();
26                }
27                sc.close();
28 
29                List<Integer> ids = new LinkedList<Integer>();
30                if (st != null) {
31                        sc = new Scanner(st);
32 
33                        while (sc.hasNextInt()) {
34                                ids.add(sc.nextInt());
35                        }
36                }
37                sc.close();
38 
39                return ids;
40        }
41        
42        /**
43         * Shows the list of menu items
44         */
45        private static void showMenuItems(String[][] systems)
46        {
47                System.out.println("1: Start everything in local mode (hardware container #1 is used, only for testing purpose!)");
48                System.out.println("2: RmiRegistry");
49                System.out.println("3: Usage Scenarios");
50                
51                int i = 4;
52 
53                // systems
54                for(String[] system : systems)
55                {
56                        System.out.println(i+": System "+system[1]);
57                        i++;
58                }
59                
60                // container
61                Collection<String> containers = AbstractAllocationStorage.getContainerNames();
62                for(String container : containers)
63                {
64                        System.out.println(i+": Container "+container);
65                        i++;
66                }
67        }
68}

[all classes][de.uka.ipd.sdq.prototype.framework.utils]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov