1   /*
2   * E-nspire Gemini.
3   * A Java and AspectJ based framework that enables transparent 
4   * bidirectional relationships between Plain Old Java Objects.
5   * 
6   * Copyright (C) 2005 Dragan Djuric
7   * 
8   * This program is free software; you can redistribute it and/or
9   * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  * 
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  * 
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21  * 
22  * Contact the author at dragand@dev.java.net
23  */
24  package com.enspire.gemini.integration.test.collectioncollection;
25  
26  import java.util.LinkedList;
27  import java.util.Collection;
28  
29  import com.enspire.gemini.integration.model.collectioncollection.A;
30  import com.enspire.gemini.integration.model.collectioncollection.ABidirectionalDefault;
31  
32  /***
33   * @author Dragan Djuric <dragand@dev.java.net>
34   *
35   */
36  public class ABidirectionalDefaultTest extends ABidirectionalAbstractTest {
37  
38      private ABidirectionalDefault testABidirectionalDefault;
39      /***
40       * @see com.enspire.gemini.integration.test.collectioncollection.ABidirectionalAbstractTest#createTestABidirectional()
41       */
42      
43      protected A createTestABidirectional() {
44          return createTestABidirectionalDefault();
45      }
46      
47      protected ABidirectionalDefault createTestABidirectionalDefault() {
48          ABidirectionalDefault a = new ABidirectionalDefault();
49          a.setB(new LinkedList());
50          return a;
51      }
52  
53      /***
54       * @see com.enspire.gemini.integration.test.collectioncollection.ABidirectionalAbstractTest#setUp()
55       */
56      
57      protected void setUp() throws Exception {
58          super.setUp();
59          testABidirectionalDefault = createTestABidirectionalDefault();
60      }
61  
62      public void testSetBAgain() {
63          Collection newCollection = new LinkedList();
64          testABidirectionalDefault.setB(newCollection);
65          assertNotSame(newCollection, testABidirectionalDefault.getB());
66      }
67  }