OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014, the Dart project authors. | 2 * Copyright (c) 2014, the Dart project authors. |
3 * | 3 * |
4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u
se this file except | 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u
se this file except |
5 * in compliance with the License. You may obtain a copy of the License at | 5 * in compliance with the License. You may obtain a copy of the License at |
6 * | 6 * |
7 * http://www.eclipse.org/legal/epl-v10.html | 7 * http://www.eclipse.org/legal/epl-v10.html |
8 * | 8 * |
9 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License | 9 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License |
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express | 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express |
11 * or implied. See the License for the specific language governing permissions a
nd limitations under | 11 * or implied. See the License for the specific language governing permissions a
nd limitations under |
12 * the License. | 12 * the License. |
13 */ | 13 */ |
14 package com.google.dart.engine.internal.index.file; | 14 package com.google.dart.engine.internal.index.file; |
15 | 15 |
16 import com.google.dart.engine.index.Relationship; | 16 import com.google.dart.engine.index.Relationship; |
17 | 17 |
18 import junit.framework.TestCase; | 18 import junit.framework.TestCase; |
19 | 19 |
20 public class RelationshipCodecTest extends TestCase { | 20 public class RelationshipCodecTest extends TestCase { |
21 private StringCodec stringCodec = new StringCodec(); | 21 private StringCodec stringCodec = new StringCodec(); |
22 private RelationshipCodec codec = new RelationshipCodec(stringCodec); | 22 private RelationshipCodec codec = new RelationshipCodec(stringCodec); |
23 | 23 |
24 public void test_all() throws Exception { | 24 public void test_all() throws Exception { |
25 Relationship relationship = Relationship.getRelationship("my-relationship"); | 25 Relationship relationship = Relationship.getRelationship("my-relationship"); |
26 int id = codec.encode(relationship); | 26 int id = codec.encode(relationship); |
27 assertSame(relationship, codec.decode(id)); | 27 assertSame(relationship, codec.decode(id)); |
28 } | 28 } |
| 29 |
| 30 @Override |
| 31 protected void tearDown() throws Exception { |
| 32 stringCodec = null; |
| 33 codec = null; |
| 34 super.tearDown(); |
| 35 } |
29 } | 36 } |
OLD | NEW |