/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test
* @bug 4245809
* @summary Basic test for LinkedHashSet. (Based on SetBash)
*/
public class Basic {
int numItr = 500;
int setSize = 500;
for (int i=0; i<numItr; i++) {
throw new Exception("Set algebra identity 2 failed");
throw new Exception("Set algebra identity 3 failed");
throw new Exception("Set algebra identity 4 failed");
throw new Exception("Set algebra identity 5 failed");
throw new Exception("Set algebra identity 6 failed");
throw new Exception("Set algebra identity 7 failed");
throw new Exception("Set algebra identity 1 failed");
throw new Exception("Incorrect hashCode computation.");
while (e.hasNext())
throw new Exception("Couldn't remove element from copy.");
if (!intersection.isEmpty())
throw new Exception("Copy nonempty after deleting all elements.");
while (e.hasNext()) {
throw new Exception("Set doesn't contain one of its elements.");
e.remove();
throw new Exception("Set contains element after deletion.");
}
throw new Exception("Set nonempty after deleting all elements.");
throw new Exception("Set nonempty after clear.");
}
}
serClone(s)));
if (!s.containsAll(clone))
throw new Exception("Set does not contain copy.");
if (!clone.containsAll(s))
throw new Exception("Copy does not contain set.");
return clone;
}
try {
// Serialize
out.writeObject(m);
// Deserialize
} catch(Exception e) {
e.printStackTrace();
}
return result;
}
for (int i=0; i<n; i++) {
boolean prePresent = s.contains(e);
if (!s.contains(e))
throw new Exception("Element not present after addition.");
if (added == prePresent)
throw new Exception("added == alreadyPresent");
throw new Exception("Add returned true, but size didn't change.");
throw new Exception("Add returned false, but size changed.");
}
}
}