Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (C) 2012 Stephen M. Hopper Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 package com.enragedginger.stephenerialization.fields;
 import static org.junit.Assert.*;
 import java.util.List;
 import java.util.Set;
 import org.junit.Test;

Class for testing the StephenerializableField class.

Stephen Hopper
 public class StephenerializableFieldTest {
 	private Field testField1;
 	private Field testField2;
 	private class TestFaceClass {
 		private int face1;
 		private float face2;

Run setup prior to each test.

 	public void setup() throws SecurityExceptionNoSuchFieldException {

An instance should never be equal to a null.
 	public void testNotEqualsNull() {

An instance should never be equal to an object that is not a StephenerializableField.
 	public void testNotEqualsToObject() {

Two blank StephenerializableField instances should be equal.
 	public void testEqualsToBlankObject() {

Two fields with different order values should not be equal.
 	public void testNotEqualsDifferentOrder() {

Two fields with different version values should not be equal.

Test sorting by order value.
	public void testSortByOrder() {

Test sorting by version value.
	public void testSortByVersion() {

Test sorting by field name.
	public void testSortByFieldName() {

Sort first by version, then by order.
		final int earlyVersion = 20120925;
		final int laterVersion = 20120926;
		final int lowerOrder = 5;
		final int higherOrder = 7;
New to GrepCode? Check out our FAQ X