View Javadoc

1   package org.e2etrace.trace;
2   
3   /*
4    * Copyright 2006 Gunther Popp
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License");
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    *
10   *      http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  
19  import org.e2etrace.trace.SimpleTraceStepId;
20  import org.e2etrace.trace.TraceSessionRootStepId;
21  
22  import junit.framework.TestCase;
23  
24  /**
25   * Test case for session root ids.<p>
26   *
27   * @author Gunther Popp
28   */
29  public class TraceSessionRootStepIdTest extends TestCase {
30  
31    /**
32     * Tests equals.<p>
33     *
34     * Two trace step ids are equal if the string representation of the id value
35     * is equal. That is, even two instances of different classes are equal, if
36     * only the instance.asString() values are equal. This test is important since
37     * the generates equals methods by default fail, if the classes of two instances
38     * are different.<p>
39     */
40    public void testEqualsObject() {
41      TraceSessionRootStepId id1 = new TraceSessionRootStepId("session");
42      SimpleTraceStepId id2 = new SimpleTraceStepId("$session");
43  
44      assertEquals(id1, id2);
45  
46    }
47  
48  }