55 case VALID:
56 output.shouldNotContain("Error");
57 output.shouldHaveExitValue(0);
58 break;
59 case MIN_INVALID:
60 output.shouldContain("Bad min heap free percentage size: -Xminf" + min);
61 output.shouldContain("Error");
62 output.shouldHaveExitValue(1);
63 break;
64 case MAX_INVALID:
65 output.shouldContain("Bad max heap free percentage size: -Xmaxf" + max);
66 output.shouldContain("Error");
67 output.shouldHaveExitValue(1);
68 break;
69 case OUT_OF_RANGE:
70 output.shouldContain("outside the allowed range");
71 output.shouldContain("Error");
72 output.shouldHaveExitValue(1);
73 break;
74 case COMBINATION_INVALID:
75 output.shouldContain("must be less than or equal to MaxHeapFreeRatio");
76 output.shouldContain("Error");
77 output.shouldHaveExitValue(1);
78 break;
79 default:
80 throw new IllegalStateException("Must specify expected validation type");
81 }
82
83 System.out.println(output.getOutput());
84 }
85
86 public static void main(String args[]) throws Exception {
87 testMinMaxFreeRatio( "0.1", "0.5", Validation.VALID);
88 testMinMaxFreeRatio( ".1", ".5", Validation.VALID);
89 testMinMaxFreeRatio( "0.5", "0.5", Validation.VALID);
90
91 testMinMaxFreeRatio("=0.1", "0.5", Validation.MIN_INVALID);
92 testMinMaxFreeRatio("0.1f", "0.5", Validation.MIN_INVALID);
93 testMinMaxFreeRatio(
94 "INVALID", "0.5", Validation.MIN_INVALID);
95
|
55 case VALID:
56 output.shouldNotContain("Error");
57 output.shouldHaveExitValue(0);
58 break;
59 case MIN_INVALID:
60 output.shouldContain("Bad min heap free percentage size: -Xminf" + min);
61 output.shouldContain("Error");
62 output.shouldHaveExitValue(1);
63 break;
64 case MAX_INVALID:
65 output.shouldContain("Bad max heap free percentage size: -Xmaxf" + max);
66 output.shouldContain("Error");
67 output.shouldHaveExitValue(1);
68 break;
69 case OUT_OF_RANGE:
70 output.shouldContain("outside the allowed range");
71 output.shouldContain("Error");
72 output.shouldHaveExitValue(1);
73 break;
74 case COMBINATION_INVALID:
75 output.shouldContain("must be greater than or equal to MinHeapFreeRatio");
76 output.shouldContain("Error");
77 output.shouldHaveExitValue(1);
78 break;
79 default:
80 throw new IllegalStateException("Must specify expected validation type");
81 }
82
83 System.out.println(output.getOutput());
84 }
85
86 public static void main(String args[]) throws Exception {
87 testMinMaxFreeRatio( "0.1", "0.5", Validation.VALID);
88 testMinMaxFreeRatio( ".1", ".5", Validation.VALID);
89 testMinMaxFreeRatio( "0.5", "0.5", Validation.VALID);
90
91 testMinMaxFreeRatio("=0.1", "0.5", Validation.MIN_INVALID);
92 testMinMaxFreeRatio("0.1f", "0.5", Validation.MIN_INVALID);
93 testMinMaxFreeRatio(
94 "INVALID", "0.5", Validation.MIN_INVALID);
95
|