diff options
author | rbrooks | 2010-07-24 17:38:31 +0000 |
---|---|---|
committer | rbrooks | 2010-07-24 17:38:31 +0000 |
commit | 4081f04850d3eff9eb1bd7241763707bfbb43a45 (patch) | |
tree | 258620df94d4b24077ff103a6c4dea9cb78493fb /plugins/org.eclipse.osee.framework.jdk.core.test/src | |
parent | 4ed8bddc791fda93940f238c5135556a07041dc0 (diff) | |
download | org.eclipse.osee-4081f04850d3eff9eb1bd7241763707bfbb43a45.tar.gz org.eclipse.osee-4081f04850d3eff9eb1bd7241763707bfbb43a45.tar.xz org.eclipse.osee-4081f04850d3eff9eb1bd7241763707bfbb43a45.zip |
applied Eclipse source cleanup
Diffstat (limited to 'plugins/org.eclipse.osee.framework.jdk.core.test/src')
14 files changed, 209 insertions, 222 deletions
diff --git a/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/JdkCoreTestSuite.java b/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/JdkCoreTestSuite.java index 726075f9704..56673522d33 100644 --- a/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/JdkCoreTestSuite.java +++ b/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/JdkCoreTestSuite.java @@ -22,12 +22,8 @@ import org.junit.runners.Suite; */ @RunWith(Suite.class) -@Suite.SuiteClasses({ - JdkCoreTypeTestSuite.class, - JdkCoreUtilTestSuite.class, - JdkCoreTextTestSuite.class, - JdkCoreRuleTestSuite.class, -}) +@Suite.SuiteClasses({JdkCoreTypeTestSuite.class, JdkCoreUtilTestSuite.class, JdkCoreTextTestSuite.class, + JdkCoreRuleTestSuite.class,}) public class JdkCoreTestSuite { } diff --git a/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/rules/WordMLNewLineMakerRuleTest.java b/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/rules/WordMLNewLineMakerRuleTest.java index b7cb5acd717..2db6e7e5963 100644 --- a/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/rules/WordMLNewLineMakerRuleTest.java +++ b/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/rules/WordMLNewLineMakerRuleTest.java @@ -32,62 +32,55 @@ import org.junit.Test; */ public final class WordMLNewLineMakerRuleTest extends TestCase { - private final static String INPUT_FILE_NAME = "sample_icd_formatted.xml"; - private final static String NEW_WP_INJECTION_FINGERPRINT = - "<w:p wsp:rsidR=\"01234567\" wsp:rsidRDefault=\"01234567\">"; + private final static String INPUT_FILE_NAME = "sample_icd_formatted.xml"; + private final static String NEW_WP_INJECTION_FINGERPRINT = + "<w:p wsp:rsidR=\"01234567\" wsp:rsidRDefault=\"01234567\">"; - private final WordMLNewLineMaker wordNewLineMaker = - new WordMLNewLineMaker(); - private final StringBuilder pathArgument = - new StringBuilder(); - private final Pattern paragraphRegex = Pattern.compile("<w:p[ >].*?</w:p>", Pattern.DOTALL); + private final WordMLNewLineMaker wordNewLineMaker = new WordMLNewLineMaker(); + private final StringBuilder pathArgument = new StringBuilder(); + private final Pattern paragraphRegex = Pattern.compile("<w:p[ >].*?</w:p>", Pattern.DOTALL); - @Test - public void testNewLineInserts() { - ChangeSet modifiedFile = null; - try { - modifiedFile = wordNewLineMaker.computeChanges(getResourceData(INPUT_FILE_NAME)); - } catch (IOException ioex) { - System.err.println("Error: " + ioex.getMessage()); - Assert.fail("Unable to process the file, " + - "WordMLNewLineMaker threw an IOException..."); - } catch (IllegalCharsetNameException illegalName) { - System.err.println("Error: " + illegalName.getMessage()); - Assert.fail("Illegal charset name specified, " + - "WordMLNewLineMaker threw an " + - "IllegalCharsetNameException..."); - } catch (UnsupportedCharsetException unsupportedEx) { - System.err.println("Error: " + unsupportedEx.getMessage()); - Assert.fail("Unsupported charset, " + - "WordMLNewLineMaker threw an " + - "UnsupportedCharsetException..."); - } + @Test + public void testNewLineInserts() { + ChangeSet modifiedFile = null; + try { + modifiedFile = wordNewLineMaker.computeChanges(getResourceData(INPUT_FILE_NAME)); + } catch (IOException ioex) { + System.err.println("Error: " + ioex.getMessage()); + Assert.fail("Unable to process the file, " + "WordMLNewLineMaker threw an IOException..."); + } catch (IllegalCharsetNameException illegalName) { + System.err.println("Error: " + illegalName.getMessage()); + Assert.fail("Illegal charset name specified, " + "WordMLNewLineMaker threw an " + "IllegalCharsetNameException..."); + } catch (UnsupportedCharsetException unsupportedEx) { + System.err.println("Error: " + unsupportedEx.getMessage()); + Assert.fail("Unsupported charset, " + "WordMLNewLineMaker threw an " + "UnsupportedCharsetException..."); + } - Assert.assertTrue(modifiedFile.getSourceLength() != 0); + Assert.assertTrue(modifiedFile.getSourceLength() != 0); - //Test Does it contain new paragraph injected signature ? - String modifiedFileAsString = modifiedFile.toString(); - Assert.assertTrue(modifiedFileAsString.contains(NEW_WP_INJECTION_FINGERPRINT)); + //Test Does it contain new paragraph injected signature ? + String modifiedFileAsString = modifiedFile.toString(); + Assert.assertTrue(modifiedFileAsString.contains(NEW_WP_INJECTION_FINGERPRINT)); - //Test Does it have 2 <w:p>s instead of 1 ? - Matcher wpMatcher = paragraphRegex.matcher(modifiedFileAsString); - int count = 0; - while (wpMatcher.find()) { - count++; - } - Assert.assertTrue(count == 2); + //Test Does it have 2 <w:p>s instead of 1 ? + Matcher wpMatcher = paragraphRegex.matcher(modifiedFileAsString); + int count = 0; + while (wpMatcher.find()) { + count++; + } + Assert.assertTrue(count == 2); - } + } - private static String getResourceData(String name) throws IOException { - InputStream inputStream = null; - try { - inputStream = WordMLNewLineMakerRuleTest.class.getResourceAsStream(name); - String data = Lib.inputStreamToString(inputStream); - Assert.assertTrue(Strings.isValid(data)); - return data; - } finally { - Lib.close(inputStream); - } - } + private static String getResourceData(String name) throws IOException { + InputStream inputStream = null; + try { + inputStream = WordMLNewLineMakerRuleTest.class.getResourceAsStream(name); + String data = Lib.inputStreamToString(inputStream); + Assert.assertTrue(Strings.isValid(data)); + return data; + } finally { + Lib.close(inputStream); + } + } } diff --git a/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/text/UtfReadingRuleTest.java b/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/text/UtfReadingRuleTest.java index 730f40eb72a..bf4db41090a 100644 --- a/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/text/UtfReadingRuleTest.java +++ b/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/text/UtfReadingRuleTest.java @@ -29,79 +29,72 @@ import org.junit.Test; */
public final class UtfReadingRuleTest extends TestCase {
- private static class Utf8TestRule extends Rule {
- private CharSequence lastOutput;
+ private static class Utf8TestRule extends Rule {
+ private CharSequence lastOutput;
- public Utf8TestRule() {
- this.lastOutput = null;
- }
+ public Utf8TestRule() {
+ this.lastOutput = null;
+ }
- @Override
- public ChangeSet computeChanges(final CharSequence seq) {
- lastOutput = seq;
- return new ChangeSet(seq);
- }
+ @Override
+ public ChangeSet computeChanges(final CharSequence seq) {
+ lastOutput = seq;
+ return new ChangeSet(seq);
+ }
- public CharSequence getLastOutput() {
- return lastOutput;
- }
- }
+ public CharSequence getLastOutput() {
+ return lastOutput;
+ }
+ }
- private static final String FILE_INPUT =
- "utf8_input.xml";
+ private static final String FILE_INPUT = "utf8_input.xml";
- private final Utf8TestRule rule = new Utf8TestRule();
+ private final Utf8TestRule rule = new Utf8TestRule();
- @Test
- public void testWrongFileName() {
- try {
- rule.process(new File("./notexistentFile.txt"));
- } catch (NullPointerException ex) {
- Assert.assertTrue(true);
- } catch (Exception ex) {
- Assert.fail("unexpected/wrong exception thrown testWrongFileName()");
- }
- }
+ @Test
+ public void testWrongFileName() {
+ try {
+ rule.process(new File("./notexistentFile.txt"));
+ } catch (NullPointerException ex) {
+ Assert.assertTrue(true);
+ } catch (Exception ex) {
+ Assert.fail("unexpected/wrong exception thrown testWrongFileName()");
+ }
+ }
- @Test
- public void testCharset() {
- Stack<String> charsetStack = new Stack<String>();
- charsetStack.add("UnknownCharset");
- charsetStack.add("UTF-8");
+ @Test
+ public void testCharset() {
+ Stack<String> charsetStack = new Stack<String>();
+ charsetStack.add("UnknownCharset");
+ charsetStack.add("UTF-8");
- while (!charsetStack.isEmpty()) {
- try {
- File inputFile = new File(
- UtfReadingRuleTest.class
- .getResource(FILE_INPUT).toURI());
- rule.setCharsetString(charsetStack.pop());
- rule.process(inputFile);
- } catch (Exception ex) {
- Assert.assertTrue(
- "unexpected/wrong exception thrown testCharset(), Exception: " + ex.toString(),
- ex instanceof UnsupportedCharsetException || ex instanceof UnsupportedEncodingException);
- }
- }
- }
+ while (!charsetStack.isEmpty()) {
+ try {
+ File inputFile = new File(UtfReadingRuleTest.class.getResource(FILE_INPUT).toURI());
+ rule.setCharsetString(charsetStack.pop());
+ rule.process(inputFile);
+ } catch (Exception ex) {
+ Assert.assertTrue("unexpected/wrong exception thrown testCharset(), Exception: " + ex.toString(),
+ ex instanceof UnsupportedCharsetException || ex instanceof UnsupportedEncodingException);
+ }
+ }
+ }
- @Test
- public void testUtf8ReadData() {
- String expectedUtf8String = "<w:t>€</w:t>";
- try {
- File inputFile = new File(
- UtfReadingRuleTest.class
- .getResource(FILE_INPUT).toURI());
- rule.setCharsetString("UTF8");
- rule.process(inputFile);
- } catch (UnsupportedCharsetException ex) {
- Assert.assertTrue(true);
- } catch (Exception ex) {
- Assert.fail("unexpected/wrong exception thrown testCharset()");
- }
+ @Test
+ public void testUtf8ReadData() {
+ String expectedUtf8String = "<w:t>€</w:t>";
+ try {
+ File inputFile = new File(UtfReadingRuleTest.class.getResource(FILE_INPUT).toURI());
+ rule.setCharsetString("UTF8");
+ rule.process(inputFile);
+ } catch (UnsupportedCharsetException ex) {
+ Assert.assertTrue(true);
+ } catch (Exception ex) {
+ Assert.fail("unexpected/wrong exception thrown testCharset()");
+ }
- //trim off extra data
- String actual =
- rule.getLastOutput().toString().trim();
- Assert.assertEquals(expectedUtf8String, actual);
- }
+ //trim off extra data
+ String actual = rule.getLastOutput().toString().trim();
+ Assert.assertEquals(expectedUtf8String, actual);
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/type/JdkCoreTypeTestSuite.java b/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/type/JdkCoreTypeTestSuite.java index 866ea72faa1..12ad9ca7d73 100644 --- a/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/type/JdkCoreTypeTestSuite.java +++ b/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/type/JdkCoreTypeTestSuite.java @@ -17,8 +17,8 @@ import org.junit.runners.Suite; * @author Roberto E. Escobar */ @RunWith(Suite.class) -@Suite.SuiteClasses( {PairTest.class, PropertyStoreTest.class, PropertyStoreWriterTest.class, QuadTest.class, - TripletTest.class}) +@Suite.SuiteClasses({PairTest.class, PropertyStoreTest.class, PropertyStoreWriterTest.class, QuadTest.class, + TripletTest.class}) public class JdkCoreTypeTestSuite { } diff --git a/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/type/PropertyStoreTest.java b/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/type/PropertyStoreTest.java index 756b9a4a6a9..d1a502324fe 100644 --- a/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/type/PropertyStoreTest.java +++ b/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/type/PropertyStoreTest.java @@ -87,8 +87,8 @@ public class PropertyStoreTest { store1.put("key4", new String[] {"entry4", "entry5"}); Assert.assertEquals( - "Id:[ID] Data:{key2=543, key1=12.3} Arrays:{key3=[entry1, entry2, entry3], key4=[entry4, entry5]}", - store1.toString()); + "Id:[ID] Data:{key2=543, key1=12.3} Arrays:{key3=[entry1, entry2, entry3], key4=[entry4, entry5]}", + store1.toString()); } @org.junit.Test @@ -158,7 +158,7 @@ public class PropertyStoreTest { Set<String> set1 = new TreeSet<String>(store1.keySet()); PropertyStoreTestUtil.checkArrays(new String[] {"key1", "key2", "key3", "key4", "key5", "key6", "key6.5"}, - set1.toArray(new String[set1.size()])); + set1.toArray(new String[set1.size()])); Set<String> set2 = new TreeSet<String>(store1.arrayKeySet()); PropertyStoreTestUtil.checkArrays(new String[] {"key7", "key8"}, set2.toArray(new String[set2.size()])); diff --git a/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/type/PropertyStoreTestUtil.java b/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/type/PropertyStoreTestUtil.java index 0e3efd826ec..6d22185cf25 100644 --- a/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/type/PropertyStoreTestUtil.java +++ b/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/type/PropertyStoreTestUtil.java @@ -10,8 +10,8 @@ *******************************************************************************/ package org.eclipse.osee.framework.jdk.core.test.type; -import java.util.Properties; import java.util.Map.Entry; +import java.util.Properties; import org.eclipse.osee.framework.jdk.core.type.PropertyStore; import org.junit.Assert; diff --git a/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/type/PropertyStoreWriterTest.java b/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/type/PropertyStoreWriterTest.java index aa4948a4f7a..b5399433e7f 100644 --- a/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/type/PropertyStoreWriterTest.java +++ b/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/type/PropertyStoreWriterTest.java @@ -14,7 +14,6 @@ import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.StringReader; import java.io.StringWriter; - import org.eclipse.osee.framework.jdk.core.test.type.PropertyStoreTestUtil.MockPropertyStore; import org.eclipse.osee.framework.jdk.core.type.PropertyStoreWriter; import org.junit.Before; @@ -45,7 +44,7 @@ public class PropertyStoreWriterTest { store.put("key7", new String[] {"entry1", "entry2", "entry3"}); store.put("key8", new String[] {"entry4", "entry5", "entry6"}); nested = PropertyStoreTestUtil.createPropertyStore(System.getProperties()); - nested.put("inner array 1", new String[]{"value1", "value2"}); + nested.put("inner array 1", new String[] {"value1", "value2"}); nested.put("inner store 1", PropertyStoreTestUtil.createPropertyStore(System.getProperties())); store.put("key9", nested); } @@ -72,7 +71,7 @@ public class PropertyStoreWriterTest { @Test public void testLoadingXml() throws Exception { String value = - "<?xml version=\"1.0\" encoding=\"UTF-8\" ?> <store id=\"coverage.item\"> <item value=\"68\" key=\"line\" /> <item value=\"\" key=\"testUnits\" /> <item value=\"4\" key=\"executeNum\" /> <item value=\"APc07YhpXgobKwrbROgA\" key=\"guid\" /> <item value=\"Not_Covered\" key=\"methodType\" /> <item value=\"4\" key=\"methodNum\" /> <item value=\"OseeLog.log(Activator.class, Level.SEVERE, ex);\" key=\"text\" /> </store>"; + "<?xml version=\"1.0\" encoding=\"UTF-8\" ?> <store id=\"coverage.item\"> <item value=\"68\" key=\"line\" /> <item value=\"\" key=\"testUnits\" /> <item value=\"4\" key=\"executeNum\" /> <item value=\"APc07YhpXgobKwrbROgA\" key=\"guid\" /> <item value=\"Not_Covered\" key=\"methodType\" /> <item value=\"4\" key=\"methodNum\" /> <item value=\"OseeLog.log(Activator.class, Level.SEVERE, ex);\" key=\"text\" /> </store>"; MockPropertyStore actual = PropertyStoreTestUtil.createPropertyStore(); writer.load(actual, new StringReader(value)); MockPropertyStore expected = PropertyStoreTestUtil.createPropertyStore("coverage.item"); diff --git a/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/type/QuadTest.java b/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/type/QuadTest.java index a822fa988d3..37205aa8dc9 100644 --- a/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/type/QuadTest.java +++ b/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/type/QuadTest.java @@ -22,26 +22,26 @@ public class QuadTest { private final Integer b = 233; private final Integer c = 433; private final Integer d = 555; - private final Quad<Integer, Integer, Integer, Integer> mapToPi = - new Quad<Integer, Integer, Integer, Integer>(a, b, c, d); - private final Quad<Integer, Integer, Integer, Integer> mapToE = - new Quad<Integer, Integer, Integer, Integer>(b, c, d, a); + private final Quad<Integer, Integer, Integer, Integer> mapToPi = new Quad<Integer, Integer, Integer, Integer>(a, b, + c, d); + private final Quad<Integer, Integer, Integer, Integer> mapToE = new Quad<Integer, Integer, Integer, Integer>(b, c, + d, a); - private final Quad<Integer, Integer, Integer, Integer> alsoMapToPi = - new Quad<Integer, Integer, Integer, Integer>(a, b, c, d); - private final Quad<Integer, Integer, Integer, Integer> alsoMapToE = - new Quad<Integer, Integer, Integer, Integer>(b, c, d, a); + private final Quad<Integer, Integer, Integer, Integer> alsoMapToPi = new Quad<Integer, Integer, Integer, Integer>(a, + b, c, d); + private final Quad<Integer, Integer, Integer, Integer> alsoMapToE = new Quad<Integer, Integer, Integer, Integer>(b, + c, d, a); private final Quad<Integer, Integer, Integer, Integer> firstEntryNull = - new Quad<Integer, Integer, Integer, Integer>(null, 222, 333, 444); + new Quad<Integer, Integer, Integer, Integer>(null, 222, 333, 444); private final Quad<Integer, Integer, Integer, Integer> secondEntryNull = - new Quad<Integer, Integer, Integer, Integer>(111, null, 333, 444); + new Quad<Integer, Integer, Integer, Integer>(111, null, 333, 444); private final Quad<Integer, Integer, Integer, Integer> thirdEntryNull = - new Quad<Integer, Integer, Integer, Integer>(111, 222, null, 444); + new Quad<Integer, Integer, Integer, Integer>(111, 222, null, 444); private final Quad<Integer, Integer, Integer, Integer> fourthEntryNull = - new Quad<Integer, Integer, Integer, Integer>(111, 222, 333, null); - private final Quad<Integer, Integer, Integer, Integer> nonNull = - new Quad<Integer, Integer, Integer, Integer>(111, 222, 333, 444); + new Quad<Integer, Integer, Integer, Integer>(111, 222, 333, null); + private final Quad<Integer, Integer, Integer, Integer> nonNull = new Quad<Integer, Integer, Integer, Integer>(111, + 222, 333, 444); @org.junit.Test public void testConstructor() { @@ -131,7 +131,7 @@ public class QuadTest { @org.junit.Test public void testHashCorrectness() { HashMap<Quad<Integer, Integer, Integer, Integer>, Double> hash = - new HashMap<Quad<Integer, Integer, Integer, Integer>, Double>(); + new HashMap<Quad<Integer, Integer, Integer, Integer>, Double>(); hash.put(mapToPi, Math.PI); hash.put(mapToE, Math.E); Assert.assertTrue(hash.get(mapToPi).equals(Math.PI)); diff --git a/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/type/TripletTest.java b/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/type/TripletTest.java index 7701e9de9bd..b7348d0ac9b 100644 --- a/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/type/TripletTest.java +++ b/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/type/TripletTest.java @@ -27,12 +27,12 @@ public class TripletTest { private final Triplet<Integer, Integer, Integer> alsoMapToPi = new Triplet<Integer, Integer, Integer>(a, b, c); private final Triplet<Integer, Integer, Integer> alsoMapToE = new Triplet<Integer, Integer, Integer>(b, c, a); - private final Triplet<Integer, Integer, Integer> firstEntryNull = - new Triplet<Integer, Integer, Integer>(null, 222, 333); - private final Triplet<Integer, Integer, Integer> secondEntryNull = - new Triplet<Integer, Integer, Integer>(111, null, 333); - private final Triplet<Integer, Integer, Integer> thirdEntryNull = - new Triplet<Integer, Integer, Integer>(111, 222, null); + private final Triplet<Integer, Integer, Integer> firstEntryNull = new Triplet<Integer, Integer, Integer>(null, 222, + 333); + private final Triplet<Integer, Integer, Integer> secondEntryNull = new Triplet<Integer, Integer, Integer>(111, null, + 333); + private final Triplet<Integer, Integer, Integer> thirdEntryNull = new Triplet<Integer, Integer, Integer>(111, 222, + null); private final Triplet<Integer, Integer, Integer> nonNull = new Triplet<Integer, Integer, Integer>(111, 222, 333); @org.junit.Test @@ -96,7 +96,7 @@ public class TripletTest { @org.junit.Test public void testHashCorrectness() { HashMap<Triplet<Integer, Integer, Integer>, Double> hash = - new HashMap<Triplet<Integer, Integer, Integer>, Double>(); + new HashMap<Triplet<Integer, Integer, Integer>, Double>(); hash.put(mapToPi, Math.PI); hash.put(mapToE, Math.E); Assert.assertTrue(hash.get(mapToPi).equals(Math.PI)); diff --git a/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/util/CompareTest.java b/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/util/CompareTest.java index f268e833304..a578eaf8b9f 100644 --- a/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/util/CompareTest.java +++ b/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/util/CompareTest.java @@ -24,6 +24,7 @@ import org.junit.runners.Parameterized.Parameters; /** * Test Case for {@link Compare} + * * @author Roberto E. Escobar */ @RunWith(Parameterized.class) diff --git a/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/util/GUIDTest.java b/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/util/GUIDTest.java index 6874fdec25f..096a331cad3 100644 --- a/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/util/GUIDTest.java +++ b/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/util/GUIDTest.java @@ -31,8 +31,8 @@ public class GUIDTest { @org.junit.Test public void testInvalidGuids() { final String[] invalidHrids = - {"short", "AAABDBYPet4AGJyrc_LONG_", "AAABGumk_InvalidChar!", "AAABGumk_InvalidChar#", - "AAABGumk_InvalidChar@", "AAABGumk_InvalidChar^"}; + {"short", "AAABDBYPet4AGJyrc_LONG_", "AAABGumk_InvalidChar!", "AAABGumk_InvalidChar#", + "AAABGumk_InvalidChar@", "AAABGumk_InvalidChar^"}; for (String invalid : invalidHrids) { Assert.assertFalse("Invalid HRID " + invalid + " passes validity test", GUID.isValid(invalid)); } @@ -49,13 +49,12 @@ public class GUIDTest { @org.junit.Test public void testValidGuids() { final String[] validGuids = - {"AAABDBYPet4AGJyrc9dY1w", "AAABGumk_y8AFBnQMxZ58g", "AAABGyedHw8AphA8L4XexQ", "AAABDBYtCDsAVk2xBsTGzQ", - "AAABF_Ss2Q0AR8+yEx51WQ", "AAABHUWIY34B7y_TEmEslg", "AAABHZzkLCgBebkFSon4wA", - "AAABGuAX6cAB0Si2OIQ+YQ", "AAABGassf08BOe_BF6k6vA", "AAABHGv_u1gBGrilXclyUA", - "AAABDBYsngcAVk2xSlMcyw", "AAABGm+v1uEA389GY8zirw", "AAABDBYrxw4AVk2xHBRmhQ", - "AAABHbBGWuQA_ArKWeHLrg", "AAABDBYs7Z8AVk2xTZPPSg", "AAABGixOs5kA2KG7aom9Pw", - "AAABFjQ_MYIBEQV7BF3j7Q", "AAABDBYs9AcAVk2xTOjhPQ", "AAABDBYr7KcAVk2xDNCqew", - "AAABHHEPXpYBzfAhPukxiQ", "AAABDBYsYBMAVk2xN5jSVA", "AAABDBYsS3IAVk2xSRpaS="}; + {"AAABDBYPet4AGJyrc9dY1w", "AAABGumk_y8AFBnQMxZ58g", "AAABGyedHw8AphA8L4XexQ", "AAABDBYtCDsAVk2xBsTGzQ", + "AAABF_Ss2Q0AR8+yEx51WQ", "AAABHUWIY34B7y_TEmEslg", "AAABHZzkLCgBebkFSon4wA", "AAABGuAX6cAB0Si2OIQ+YQ", + "AAABGassf08BOe_BF6k6vA", "AAABHGv_u1gBGrilXclyUA", "AAABDBYsngcAVk2xSlMcyw", "AAABGm+v1uEA389GY8zirw", + "AAABDBYrxw4AVk2xHBRmhQ", "AAABHbBGWuQA_ArKWeHLrg", "AAABDBYs7Z8AVk2xTZPPSg", "AAABGixOs5kA2KG7aom9Pw", + "AAABFjQ_MYIBEQV7BF3j7Q", "AAABDBYs9AcAVk2xTOjhPQ", "AAABDBYr7KcAVk2xDNCqew", "AAABHHEPXpYBzfAhPukxiQ", + "AAABDBYsYBMAVk2xN5jSVA", "AAABDBYsS3IAVk2xSRpaS="}; for (String guid : validGuids) { Assert.assertTrue(GUID.isValid(guid)); } diff --git a/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/util/GuidObject.java b/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/util/GuidObject.java index 4214155c148..a8e814504af 100644 --- a/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/util/GuidObject.java +++ b/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/util/GuidObject.java @@ -30,6 +30,7 @@ public class GuidObject { this.guid = guid; } + @Override public String toString() { return guid; } @@ -38,19 +39,29 @@ public class GuidObject { public int hashCode() { final int prime = 31; int result = 1; - result = prime * result + ((guid == null) ? 0 : guid.hashCode()); + result = prime * result + (guid == null ? 0 : guid.hashCode()); return result; } @Override public boolean equals(Object obj) { - if (this == obj) return true; - if (obj == null) return false; - if (getClass() != obj.getClass()) return false; + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } GuidObject other = (GuidObject) obj; if (guid == null) { - if (other.guid != null) return false; - } else if (!guid.equals(other.guid)) return false; + if (other.guid != null) { + return false; + } + } else if (!guid.equals(other.guid)) { + return false; + } return true; } diff --git a/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/util/HumanReadableIdTest.java b/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/util/HumanReadableIdTest.java index 49f0a1f11db..406bec0e887 100644 --- a/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/util/HumanReadableIdTest.java +++ b/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/util/HumanReadableIdTest.java @@ -21,19 +21,19 @@ public class HumanReadableIdTest { @org.junit.Test public void testInvalidHrids() { final String[] invalidHrids = {"", // short - "QRZH", // short - "QRZHMT", // long - "QRZHm", // small caps - "QRZH_", // invalid char - "CACCX", "CCCAX", "CCACX", // A in middle - "CECCX", "CCECX", "CCCEX", // E in middle - "CCCIX", "CICCX", "CCICX", // I in middle - "TOCCX", "CCOCC", "CCCOC", // O in middle - "CTUTX", "CUTTX", "CTTUX", // U in middle - "IZZZZ", // starts with I - "OZZZZ", // starts with O - "ZZZZI", // ends with I - "ZZZZO" // ends with O + "QRZH", // short + "QRZHMT", // long + "QRZHm", // small caps + "QRZH_", // invalid char + "CACCX", "CCCAX", "CCACX", // A in middle + "CECCX", "CCECX", "CCCEX", // E in middle + "CCCIX", "CICCX", "CCICX", // I in middle + "TOCCX", "CCOCC", "CCCOC", // O in middle + "CTUTX", "CUTTX", "CTTUX", // U in middle + "IZZZZ", // starts with I + "OZZZZ", // starts with O + "ZZZZI", // ends with I + "ZZZZO" // ends with O }; for (String invalid : invalidHrids) { @@ -52,30 +52,28 @@ public class HumanReadableIdTest { @org.junit.Test public void testValidHrids() { final String[] validHrids = - {"F8Z5J", "6V3PH", "UCMXG", "GDWVT", "GJ0Y0", "WV1FV", "E1HT8", "JP6VK", "S36PK", "B7WBP", "H2ML7", - "9ZD0A", "1J037", "X30J9", "02T23", "MMV3A", "YRNT0", "ZKBY2", "LYC1M", "RW3N9", "JTRCU", "MCVGX", - "KTJ5P", "FBNC4", "57M55", "WY1VG", "UX49X", "E7YF2", "7BWL4", "QQ138", "8Y2GH", "4VYMJ", "5VQTG", - "VXT3S", "4WRRX", "41PNL", "VK7FC", "YXHRR", "NFJFJ", "1KDMX", "DK8HZ", "Q946P", "6MM16", "YCTCL", - "6J3JG", "ZF29S", "W6RVV", "NQRZ9", "CKD87", "9WCHJ", "SBM27", "09XY9", "2P1S4", "3N0M2", "WR173", - "HY1JD", "UH473", "BSQGA", "RH3PS", "DBD0P", "P68WZ", "KGQ25", "YB4WT", "7G8ZC", "44NK5", "3LZ3H", - "BDHQJ", "NTZNS", "18WZR", "ZFVV2", "UHXMN", "XMBKG", "9VDXB", "82LVV", "0SVHQ", "MGF89", "JDGYQ", - "YKN2W", "9TXV0", "NP04F", "3CLWW", "5KP30", "2TS48", "NM9RH", "DC664", "Q95LE", "A8WP8", "PF7TA", - "6TLL3", "G7075", "A4SM5", "Q6H4V", "PDH1R", "BDZ89", "5PVSS", "MGDYZ", "MTH2P", "DB7X5", "K90YY", - "7NL4Z", "M4XZR", "2YL1L", "M12SJ", "7SRVE", "4FZ5A", "L9G8J", "AZ556", "23VCK", "SRXVM", "YGBLG", - "31WJ4", "0PW2Y", "NTZQA", "X8N3R", "LM74P", "5SMQ9", "H5SQY", "M6H8U", "9F0XB", "Y3NP7", "L98FJ", - "S9MHW", "D3WG3", "KXPFY", "H0CYR", "VJYXP", "XTV4R", "BBLQY", "EG57N", "SD2YL", "W8HHM", "H76XQ", - "WRMYV", "WKR27", "Y9VJ9", "PZMDJ", "GJ9JS", "QXR3W", "J0MY4", "EPLW6", "4QLXX", "SF781", "NM80A", - "ZM37Z", "K8X27", "XGWWC", "RCP1B", "56GN6", "B74LE", "JY3LE", "5XSJK", "8NH89", "F2340", "PKCWT", - "1N2VU", "XH7KP", "BV9FC", "8SKWB", "Y9VGS", "BDW01", "YT4FZ", "H7RKJ", "D7F9P", "4NVPW", "BV4BL", - "E60S6", "VDVRK", "RMW41", "713CG", "9XXXV", "Z75DZ", "EDP9D", "72WRU", "TZWPG", "X5MZE", "TRKHW", - "40HPE", "VDZ8C", "VYN04", "U2060", "C4CPB", "35W70", "XCGMJ", "KS51K", "EXY3R", "D1YRL", "LQP89", - "L8KTH", "X11WU", "GDL4S", "RZP8G", "C9WXJ", "J5RSF", "6H4S4", "S1442", "3VV89", "MPKSG", "LLHKX", - "CMQGV", "L0J5Q", "JJ72D", "QLVJW", "CM5WB", "TGQ2B", "BZJMV", "X1R89", "PMQ8K", "7CFJV", "NY4MM", - "9HT3R", "Q1Q92", "9L098", "YJ5FU", "0L53S", "403K2", "FS009", "DMD3U", "KZ7Y6", "CGYPF", "YB0NF", - "LCSQ4", "K3V89", "WK0GP", "ZDY3K", "L3KR4", "26GDN", "NK0LA", "2WVG3", "4H08D", "CY08E", "S9D2S", - "T38JK", "UB7L7", "Q264P", "BQGZU", "R0V8A" + {"F8Z5J", "6V3PH", "UCMXG", "GDWVT", "GJ0Y0", "WV1FV", "E1HT8", "JP6VK", "S36PK", "B7WBP", "H2ML7", "9ZD0A", + "1J037", "X30J9", "02T23", "MMV3A", "YRNT0", "ZKBY2", "LYC1M", "RW3N9", "JTRCU", "MCVGX", "KTJ5P", "FBNC4", + "57M55", "WY1VG", "UX49X", "E7YF2", "7BWL4", "QQ138", "8Y2GH", "4VYMJ", "5VQTG", "VXT3S", "4WRRX", "41PNL", + "VK7FC", "YXHRR", "NFJFJ", "1KDMX", "DK8HZ", "Q946P", "6MM16", "YCTCL", "6J3JG", "ZF29S", "W6RVV", "NQRZ9", + "CKD87", "9WCHJ", "SBM27", "09XY9", "2P1S4", "3N0M2", "WR173", "HY1JD", "UH473", "BSQGA", "RH3PS", "DBD0P", + "P68WZ", "KGQ25", "YB4WT", "7G8ZC", "44NK5", "3LZ3H", "BDHQJ", "NTZNS", "18WZR", "ZFVV2", "UHXMN", "XMBKG", + "9VDXB", "82LVV", "0SVHQ", "MGF89", "JDGYQ", "YKN2W", "9TXV0", "NP04F", "3CLWW", "5KP30", "2TS48", "NM9RH", + "DC664", "Q95LE", "A8WP8", "PF7TA", "6TLL3", "G7075", "A4SM5", "Q6H4V", "PDH1R", "BDZ89", "5PVSS", "MGDYZ", + "MTH2P", "DB7X5", "K90YY", "7NL4Z", "M4XZR", "2YL1L", "M12SJ", "7SRVE", "4FZ5A", "L9G8J", "AZ556", "23VCK", + "SRXVM", "YGBLG", "31WJ4", "0PW2Y", "NTZQA", "X8N3R", "LM74P", "5SMQ9", "H5SQY", "M6H8U", "9F0XB", "Y3NP7", + "L98FJ", "S9MHW", "D3WG3", "KXPFY", "H0CYR", "VJYXP", "XTV4R", "BBLQY", "EG57N", "SD2YL", "W8HHM", "H76XQ", + "WRMYV", "WKR27", "Y9VJ9", "PZMDJ", "GJ9JS", "QXR3W", "J0MY4", "EPLW6", "4QLXX", "SF781", "NM80A", "ZM37Z", + "K8X27", "XGWWC", "RCP1B", "56GN6", "B74LE", "JY3LE", "5XSJK", "8NH89", "F2340", "PKCWT", "1N2VU", "XH7KP", + "BV9FC", "8SKWB", "Y9VGS", "BDW01", "YT4FZ", "H7RKJ", "D7F9P", "4NVPW", "BV4BL", "E60S6", "VDVRK", "RMW41", + "713CG", "9XXXV", "Z75DZ", "EDP9D", "72WRU", "TZWPG", "X5MZE", "TRKHW", "40HPE", "VDZ8C", "VYN04", "U2060", + "C4CPB", "35W70", "XCGMJ", "KS51K", "EXY3R", "D1YRL", "LQP89", "L8KTH", "X11WU", "GDL4S", "RZP8G", "C9WXJ", + "J5RSF", "6H4S4", "S1442", "3VV89", "MPKSG", "LLHKX", "CMQGV", "L0J5Q", "JJ72D", "QLVJW", "CM5WB", "TGQ2B", + "BZJMV", "X1R89", "PMQ8K", "7CFJV", "NY4MM", "9HT3R", "Q1Q92", "9L098", "YJ5FU", "0L53S", "403K2", "FS009", + "DMD3U", "KZ7Y6", "CGYPF", "YB0NF", "LCSQ4", "K3V89", "WK0GP", "ZDY3K", "L3KR4", "26GDN", "NK0LA", "2WVG3", + "4H08D", "CY08E", "S9D2S", "T38JK", "UB7L7", "Q264P", "BQGZU", "R0V8A" - }; + }; for (String hrid : validHrids) { Assert.assertTrue(HumanReadableId.isValid(hrid)); } @@ -83,15 +81,12 @@ public class HumanReadableIdTest { } /* - * Mutating org.eclipse.osee.framework.jdk.core.util.HumanReadableId - * Tests: org.eclipse.osee.framework.jdk.core.util.HumanReadableIdTest - * Mutation points = 160, unit test time limit 12.0s - * M FAIL: org.eclipse.osee.framework.jdk.core.util.HumanReadableId:40: CP[12] 34438396 -> 34438397 - * ..M FAIL: org.eclipse.osee.framework.jdk.core.util.HumanReadableId:27: 2 -> 3 - * .M FAIL: org.eclipse.osee.framework.jdk.core.util.HumanReadableId:28: 34 (") -> 35 (#) - * .................................................. - * ...................M FAIL: org.eclipse.osee.framework.jdk.core.util.HumanReadableId:30: 31 -> 32 ( ) - * .................................................. - * .................................. - * Score: 97% + * Mutating org.eclipse.osee.framework.jdk.core.util.HumanReadableId Tests: + * org.eclipse.osee.framework.jdk.core.util.HumanReadableIdTest Mutation points = 160, unit test time limit 12.0s M + * FAIL: org.eclipse.osee.framework.jdk.core.util.HumanReadableId:40: CP[12] 34438396 -> 34438397 ..M FAIL: + * org.eclipse.osee.framework.jdk.core.util.HumanReadableId:27: 2 -> 3 .M FAIL: + * org.eclipse.osee.framework.jdk.core.util.HumanReadableId:28: 34 (") -> 35 (#) + * .................................................. ...................M FAIL: + * org.eclipse.osee.framework.jdk.core.util.HumanReadableId:30: 31 -> 32 ( ) + * .................................................. .................................. Score: 97% */
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/util/JdkCoreUtilTestSuite.java b/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/util/JdkCoreUtilTestSuite.java index cdf82ead7fe..2ed4e186b9a 100644 --- a/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/util/JdkCoreUtilTestSuite.java +++ b/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/util/JdkCoreUtilTestSuite.java @@ -19,13 +19,13 @@ import org.junit.runners.Suite; @RunWith(Suite.class) @Suite.SuiteClasses({ // CollectionsTest.class, // - CompareTest.class, // - GuidObject.class, // - GUIDTest.class, // - HashCollectionTest.class, // - HumanReadableIdTest.class, // - StringsTest.class, // - ReservedCharactersTest.class}) + CompareTest.class, // + GuidObject.class, // + GUIDTest.class, // + HashCollectionTest.class, // + HumanReadableIdTest.class, // + StringsTest.class, // + ReservedCharactersTest.class}) public class JdkCoreUtilTestSuite { } |