package com.rackspacecloud.blueflood.types;

import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class RollupTypeTest {

    @Test
    public void testFromString() {
        assertEquals(RollupType.BF_BASIC, RollupType.fromString(null));
        assertEquals(RollupType.BF_BASIC, RollupType.fromString(""));
        assertEquals(RollupType.BF_BASIC, RollupType.fromString("abcdef"));

        assertEquals(RollupType.BF_BASIC, RollupType.fromString("BF_BASIC"));
        assertEquals(RollupType.BF_BASIC, RollupType.fromString("bf_basic"));
        assertEquals(RollupType.BF_BASIC, RollupType.fromString("bF_bAsIc"));

        assertEquals(RollupType.COUNTER, RollupType.fromString("COUNTER"));
        assertEquals(RollupType.TIMER, RollupType.fromString("TIMER"));
        assertEquals(RollupType.SET, RollupType.fromString("SET"));
        assertEquals(RollupType.GAUGE, RollupType.fromString("GAUGE"));
        assertEquals(RollupType.ENUM, RollupType.fromString("ENUM"));
        assertEquals(RollupType.BF_HISTOGRAMS, RollupType.fromString("BF_HISTOGRAMS"));

        assertEquals(RollupType.NOT_A_ROLLUP, RollupType.fromString("NOT_A_ROLLUP"));
    }
}

@@ -169,13 +169,9 @@
 oid 
-testF
+f
 romS
@@ -175,16 +175,31 @@
 omString
+NullYieldsBasic
 () %7B%0A   
@@ -263,24 +263,94 @@
 ing(null));%0A
+    %7D%0A%0A    @Test%0A    public void fromStringEmptyStringYieldsBasic() %7B%0A
         asse
@@ -403,24 +403,90 @@
 tring(%22%22));%0A
+    %7D%0A%0A    @Test%0A    public void fromStringInvalidYieldsBasic() %7B%0A
         asse
@@ -545,24 +545,87 @@
 %22abcdef%22));%0A
+    %7D%0A%0A    @Test%0A    public void fromStringBasicYieldsBasic() %7B
 %0A        ass
@@ -687,24 +687,97 @@
 F_BASIC%22));%0A
+    %7D%0A%0A    @Test%0A    public void fromStringBasicLowercaseYieldsBasic() %7B%0A
         asse
@@ -838,24 +838,97 @@
 f_basic%22));%0A
+    %7D%0A%0A    @Test%0A    public void fromStringBasicMixedCaseYieldsBasic() %7B%0A
         asse
@@ -989,24 +989,91 @@
 F_bAsIc%22));%0A
+    %7D%0A%0A    @Test%0A    public void fromStringCounterYieldsCounter() %7B
 %0A        ass
@@ -1133,24 +1133,87 @@
 COUNTER%22));%0A
+    %7D%0A%0A    @Test%0A    public void fromStringTimeYieldsTimer() %7B%0A
         asse
@@ -1268,24 +1268,84 @@
 (%22TIMER%22));%0A
+    %7D%0A%0A    @Test%0A    public void fromStringSetYieldsSet() %7B%0A
         asse
@@ -1396,24 +1396,88 @@
 ng(%22SET%22));%0A
+    %7D%0A%0A    @Test%0A    public void fromStringGaugeYieldsGauge() %7B%0A
         asse
@@ -1532,24 +1532,86 @@
 (%22GAUGE%22));%0A
+    %7D%0A%0A    @Test%0A    public void fromStringEnumYieldsEnum() %7B%0A
         asse
@@ -1664,24 +1664,96 @@
 g(%22ENUM%22));%0A
+    %7D%0A%0A    @Test%0A    public void fromStringHistgramsYieldsHistgrams() %7B%0A
         asse
@@ -1828,16 +1828,89 @@
 AMS%22));%0A
+    %7D%0A%0A    @Test%0A    public void fromStringNotARollupYieldsNotARollup() %7B
 %0A       

Split up the test cases.