View Javadoc

1   /*
2    JavaProgrammingLanguageTest.java
3    Creation date : 14/07/2010
4    Copyright © Benjamin Croizet (graffity2199@yahoo.fr)
5   
6    This program is free software; you can redistribute it and/or
7    modify it under the terms of the GNU General Public License
8    or GNU Lesser General Public License as published by the
9    Free Software Foundation; either version 3 of the License,
10   or (at your option) any later version.
11  
12   This program is distributed in the hope that it will be useful,
13   but WITHOUT ANY WARRANTY; without even the implied warranty of
14   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15   GNU General Public License for more details.
16  
17   You should have received copies of the GNU General Public License
18   and GNU Lesser General Public License along with this program;
19   if not, write to the Free Software Foundation, Inc.,
20   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21   http://www.fsf.org/licensing/licenses/gpl.html
22   http://www.gnu.org/licenses/lgpl.html
23   */
24  
25  package net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument;
26  
27  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyConstants.DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN;
28  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyConstants.DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN;
29  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyConstants.DEFAULT_DISPLAY_TYPES_OPTIONS;
30  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyConstants.NATIVE_DEPENDENCY;
31  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyDisplaySetTestConstants.DISPLAY_TYPE_SET1;
32  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyDisplaySetTestConstants.DISPLAY_TYPE_SET3;
33  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyDisplaySetTestConstants.DISPLAY_TYPE_SET30;
34  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyDisplaySetTestConstants.DISPLAY_TYPE_SET31;
35  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyDisplaySetTestConstants.DISPLAY_TYPE_SET32;
36  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyDisplaySetTestConstants.DISPLAY_TYPE_SET34;
37  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyDisplaySetTestConstants.DISPLAY_TYPE_SET35;
38  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyDisplaySetTestConstants.DISPLAY_TYPE_SET4;
39  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyDisplaySetTestConstants.DISPLAY_TYPE_SET5;
40  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyDisplaySetTestConstants.DISPLAY_TYPE_SET9;
41  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY10;
42  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY11;
43  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY12;
44  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY13;
45  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY14;
46  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY16;
47  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY17;
48  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY18;
49  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY19;
50  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY20;
51  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY21;
52  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY22;
53  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY23;
54  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY24;
55  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY25;
56  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY26;
57  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY27;
58  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY28;
59  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY29;
60  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY30;
61  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY31;
62  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY32;
63  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY33;
64  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY34;
65  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY35;
66  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY36;
67  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY37;
68  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY38;
69  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY39;
70  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY40;
71  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY41;
72  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY42;
73  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY43;
74  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY44;
75  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY45;
76  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY46;
77  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY47;
78  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY48;
79  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY49;
80  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY51;
81  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY6;
82  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY7;
83  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY8;
84  import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyTestConstants.GENERIC_DEPENDENCY9;
85  import static net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.ProgrammingLanguage.CPP;
86  import static net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.ProgrammingLanguage.JAVA;
87  import static net.sourceforge.plantumldependency.common.constants.CommonConstants.BLANK_STRING;
88  import static org.junit.Assert.assertEquals;
89  import static org.junit.Assert.assertNotNull;
90  import net.sourceforge.plantumldependency.cli.exception.PlantUMLDependencyException;
91  import net.sourceforge.plantumldependency.cli.generic.GenericDependency;
92  import net.sourceforge.plantumldependency.cli.generic.type.impl.annotationimpl.AnnotationDependencyTypeImpl;
93  import net.sourceforge.plantumldependency.cli.generic.type.impl.classimpl.ClassDependencyTypeImpl;
94  import net.sourceforge.plantumldependency.cli.generic.type.impl.interfaceimpl.InterfaceDependencyTypeImpl;
95  import net.sourceforge.plantumldependency.cli.generic.type.impl.stubimpl.StubDependencyTypeImpl;
96  import net.sourceforge.plantumldependency.cli.main.option.programminglanguage.context.ProgrammingLanguageContext;
97  import net.sourceforge.plantumldependency.common.comparable.ComparableObjectTest;
98  
99  import org.junit.Test;
100 import org.junit.experimental.theories.DataPoint;
101 
102 /**
103  * JUnit test classes for {@link JavaProgrammingLanguage}.
104  *
105  * @author Benjamin Croizet (<a href="mailto:graffity2199@yahoo.fr>graffity2199@yahoo.fr</a>)
106  * @since 1.0.0
107  * @version 1.4.0
108  */
109 public class JavaProgrammingLanguageTest extends ComparableObjectTest < JavaProgrammingLanguage > {
110 
111     /** Java programming language test 1 instance. */
112     @DataPoint
113     public static final ProgrammingLanguage JAVA_PROGRAMMING_LANGUAGE1 = JAVA;
114 
115     /** Java programming language test 2 instance. */
116     @DataPoint
117     public static final ProgrammingLanguage JAVA_PROGRAMMING_LANGUAGE2 = JAVA;
118 
119     /** Java programming language test 3 instance. */
120     @DataPoint
121     public static final ProgrammingLanguage JAVA_PROGRAMMING_LANGUAGE3 = CPP;
122 
123     /** Java programming language test 4 instance. */
124     @DataPoint
125     public static final ProgrammingLanguage JAVA_PROGRAMMING_LANGUAGE4 = null;
126 
127     /**
128      * Asserts that two {@link GenericDependency} instance are strictly identical.
129      *
130      * @param expectedDependency
131      *            the expected {@link GenericDependency} instance, mustn't be <code>null</code>.
132      * @param resultDependency
133      *            the result {@link GenericDependency} instance, mustn't be <code>null</code>.
134      */
135     private static void assertGenericDependencyAreEquals(final GenericDependency expectedDependency,
136             final GenericDependency resultDependency) {
137         assertEquals(expectedDependency, resultDependency);
138         assertEquals(expectedDependency.getDependencyType(), resultDependency.getDependencyType());
139         assertEquals(expectedDependency.getDependencyType().getImportDependenciesCollection(), resultDependency
140                 .getDependencyType().getImportDependenciesCollection());
141         assertEquals(expectedDependency.getDependencyType().getParentImplementationsDependencies(), resultDependency
142                 .getDependencyType().getParentImplementationsDependencies());
143         assertEquals(expectedDependency.getDependencyType().getParentExtensionsDependencies(), resultDependency
144                 .getDependencyType().getParentExtensionsDependencies());
145         assertEquals(expectedDependency.getDependencyType().getAnnotationsDependencies(), resultDependency
146                 .getDependencyType().getAnnotationsDependencies());
147     }
148 
149     /**
150      * Test method for
151      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
152      * .
153      *
154      * @throws PlantUMLDependencyException
155      */
156     @Test(expected = PlantUMLDependencyException.class)
157     public void testReadDependencyFromEmptyFileWithStandardEmptyContextAndDefaultDisplaySet()
158             throws PlantUMLDependencyException {
159         final String javaSourceFileContent = "///*\r\n// Test.java\r\n// Creation date : 20 août 2010\r\n// */\r\n//package com.plantuml.test;\r\n//\r\n///**\r\n// * @author Benjamin Croizet\r\n// *\r\n// * @since\r\n// * @version\r\n// */\r\n//abstract class Test {\r\n//\r\n//}\r\n";
160         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
161                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
162                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
163         JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext);
164     }
165 
166     /**
167      * Test method for
168      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
169      * .
170      *
171      * Test reproducing the <a href="https://sourceforge.net/p/plantuml-depend/bugs/3/">#3
172      * Annotations cause problems</a> bug.
173      *
174      * @throws PlantUMLDependencyException
175      */
176     @Test
177     public void testReadDependencyFromFileAbstractClassWithAnnotationsWithStandardEmptyContextAndDefaultDisplaySet()
178             throws PlantUMLDependencyException {
179         final String javaSourceFileContent = "package com.plantuml.test;\r\n\r\nimport java.lang.annotation.ElementType;\r\n\r\nimport javax.xml.bind.annotation.XmlType;\r\nimport javax.xml.ws.soap.Addressing;\r\n\r\n@    Testabstract\r\n@    Deprecated\r\n@    SuppressWarnings(   {  \"deprecation\"  ,  \"unckeked\"  }   )\r\n@    Addressing   (   enabled  =  true   )\r\n@    Annotationinterface\r\n@    AnotherAnnotation ( {  ElementType.CONSTRUCTOR  , ElementType.METHOD   } )\r\n@    MyAnnotation (  tab  =  {  1  ,  2  ,  3  ,  4  ,  5  }  )\r\n@    XmlType   (   propOrder   =   {   \"street\"   ,   \"city\"  ,   \"state\"  ,   \"zip\"   ,   \"name\"   }  )\r\n@    MappedSuperclass\r\n@ javax.annotation.Generated(value=\"\")\r\npublic abstract class GenericEndpoint {\r\n@   Override  \r\n public void toto() {\r\nString t = \"@test\";}\r\n \r\n@   Override  \r\n public void titi() {\r\nString t = \"@test\";}\r\n}\r\n";
180         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
181                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
182                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
183         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY46,
184                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
185         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
186         assertEquals(13, programmingLanguageContext.getParsedAndSeenDependencies().size());
187         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.lang.annotation.ElementType"));
188         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("javax.xml.bind.annotation.XmlType"));
189         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("javax.xml.ws.soap.Addressing"));
190         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.Testabstract"));
191         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.Deprecated"));
192         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.SuppressWarnings"));
193         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.Annotationinterface"));
194         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.AnotherAnnotation"));
195         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.MyAnnotation"));
196         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.MappedSuperclass"));
197         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("javax.annotation.Generated"));
198         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.Override"));
199         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY46.getFullName()));
200         assertEquals(StubDependencyTypeImpl.class,
201                 programmingLanguageContext.getParsedOrSeenDependency("java.lang.annotation.ElementType")
202                         .getDependencyType().getClass());
203         assertEquals(AnnotationDependencyTypeImpl.class,
204                 programmingLanguageContext.getParsedOrSeenDependency("javax.xml.bind.annotation.XmlType")
205                         .getDependencyType().getClass());
206         assertEquals(AnnotationDependencyTypeImpl.class,
207                 programmingLanguageContext.getParsedOrSeenDependency("javax.xml.ws.soap.Addressing")
208                         .getDependencyType().getClass());
209         assertEquals(AnnotationDependencyTypeImpl.class,
210                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.Testabstract")
211                         .getDependencyType().getClass());
212         assertEquals(AnnotationDependencyTypeImpl.class,
213                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.Deprecated")
214                         .getDependencyType().getClass());
215         assertEquals(AnnotationDependencyTypeImpl.class,
216                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.SuppressWarnings")
217                         .getDependencyType().getClass());
218         assertEquals(AnnotationDependencyTypeImpl.class,
219                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.Annotationinterface")
220                         .getDependencyType().getClass());
221         assertEquals(AnnotationDependencyTypeImpl.class,
222                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.AnotherAnnotation")
223                         .getDependencyType().getClass());
224         assertEquals(AnnotationDependencyTypeImpl.class,
225                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.MyAnnotation")
226                         .getDependencyType().getClass());
227         assertEquals(AnnotationDependencyTypeImpl.class,
228                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.MappedSuperclass")
229                         .getDependencyType().getClass());
230         assertEquals(AnnotationDependencyTypeImpl.class,
231                 programmingLanguageContext.getParsedOrSeenDependency("javax.annotation.Generated").getDependencyType()
232                         .getClass());
233         assertEquals(AnnotationDependencyTypeImpl.class,
234                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.Override").getDependencyType()
235                         .getClass());
236     }
237 
238     /**
239      * Test method for
240      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
241      * .
242      *
243      * @throws PlantUMLDependencyException
244      */
245     @Test
246     public void testReadDependencyFromFileAbstractClassWithStandardEmptyContextAndClassDisplaySet()
247             throws PlantUMLDependencyException {
248         final String javaSourceFileContent = "/*\r\n Test.java\r\n Creation date : 20 août 2010\r\n */\r\npackage com.plantuml.test;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n *\r\n * @since\r\n * @version\r\n */\r\nabstract class Test {\r\n\r\n}";
249         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
250                 DISPLAY_TYPE_SET4, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN, DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
251         assertEquals(GENERIC_DEPENDENCY8,
252                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
253         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
254         assertEquals(1, programmingLanguageContext.getParsedAndSeenDependencies().size());
255         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY8.getFullName()));
256     }
257 
258     /**
259      * Test method for
260      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
261      * .
262      *
263      * @throws PlantUMLDependencyException
264      */
265     @Test
266     public void testReadDependencyFromFileAbstractClassWithStandardEmptyContextAndDefaultDisplaySet()
267             throws PlantUMLDependencyException {
268         final String javaSourceFileContent = "/*\r\n Test.java\r\n Creation date : 20 août 2010\r\n */\r\npackage com.plantuml.test;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n *\r\n * @since\r\n * @version\r\n */\r\nabstract class Test {\r\n\r\n}";
269         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
270                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
271                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
272         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY8,
273                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
274         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
275         assertEquals(1, programmingLanguageContext.getParsedAndSeenDependencies().size());
276         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY8.getFullName()));
277     }
278 
279     // TODO test annotation with enum etc...
280     // TODO test with the context
281 
282     /**
283      * Test method for
284      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
285      * .
286      *
287      * @throws PlantUMLDependencyException
288      */
289     @Test
290     public void testReadDependencyFromFileAbstractPublicClassWithStandardEmptyContextAndDefaultDisplaySet()
291             throws PlantUMLDependencyException {
292         final String javaSourceFileContent = "/*\r\n Test.java\r\n Creation date : 20 août 2010\r\n */\r\npackage com.plantuml.test;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n *\r\n * @since\r\n * @version\r\n */\r\nabstract public class Test {\r\n\r\n}";
293         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
294                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
295                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
296         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY8,
297                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
298         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
299         assertEquals(1, programmingLanguageContext.getParsedAndSeenDependencies().size());
300         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY8.getFullName()));
301     }
302 
303     /**
304      * Test method for
305      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
306      * .
307      *
308      * @throws PlantUMLDependencyException
309      */
310     @Test
311     public void testReadDependencyFromFileClassGenericNotInImportWithStandardEmptyContextAndDefaultDisplaySet()
312             throws PlantUMLDependencyException {
313         final String javaSourceFileContent = "/*\r\n TestGeneric.java\r\n Creation date : 20 août 2010\r\n */\r\npackage com.plantuml.test;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n *\r\n * @since\r\n * @version\r\n */\r\npublic class TestGeneric < AnotherTestExtends > {\r\n\r\n}\r\n";
314         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
315                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
316                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
317         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY11,
318                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
319         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
320         assertEquals(1, programmingLanguageContext.getParsedAndSeenDependencies().size());
321         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY11.getFullName()));
322     }
323 
324     /**
325      * Test method for
326      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
327      * .
328      *
329      * @throws PlantUMLDependencyException
330      */
331     @Test
332     public void testReadDependencyFromFileClassWithAnnotationsWithStandardEmptyContextAndDefaultDisplaySet()
333             throws PlantUMLDependencyException {
334         final String javaSourceFileContent = "package com.plantuml.test;\r\n\r\nimport java.lang.annotation.ElementType;\r\n\r\nimport javax.xml.bind.annotation.XmlType;\r\nimport javax.xml.ws.soap.Addressing;\r\n\r\n@    Testabstract\r\n@    Deprecated\r\n@    SuppressWarnings(   {  \"deprecation\"  ,  \"unckeked\"  }   )\r\n@    Addressing   (   enabled  =  true   )\r\n@    Annotationinterface\r\n@    AnotherAnnotation ( {  ElementType.CONSTRUCTOR  , ElementType.METHOD   } )\r\n@    MyAnnotation (  tab  =  {  1  ,  2  ,  3  ,  4  ,  5  }  )\r\n@    XmlType   (   propOrder   =   {   \"street\"   ,   \"city\"  ,   \"state\"  ,   \"zip\"   ,   \"name\"   }  )\r\n@    MappedSuperclass\r\n@ javax.annotation.Generated(value=\"\")\r\npublic class GenericEndpoint {\r\n@   Override  \r\n public void toto() {\r\nString t = \"@test\";}\r\n}\r\n";
335         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
336                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
337                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
338         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY51,
339                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
340         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
341         assertEquals(13, programmingLanguageContext.getParsedAndSeenDependencies().size());
342         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.lang.annotation.ElementType"));
343         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("javax.xml.bind.annotation.XmlType"));
344         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("javax.xml.ws.soap.Addressing"));
345         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.Testabstract"));
346         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.Deprecated"));
347         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.SuppressWarnings"));
348         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.Annotationinterface"));
349         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.AnotherAnnotation"));
350         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.MyAnnotation"));
351         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.MappedSuperclass"));
352         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("javax.annotation.Generated"));
353         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.Override"));
354         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY51.getFullName()));
355         assertEquals(StubDependencyTypeImpl.class,
356                 programmingLanguageContext.getParsedOrSeenDependency("java.lang.annotation.ElementType")
357                         .getDependencyType().getClass());
358         assertEquals(AnnotationDependencyTypeImpl.class,
359                 programmingLanguageContext.getParsedOrSeenDependency("javax.xml.bind.annotation.XmlType")
360                         .getDependencyType().getClass());
361         assertEquals(AnnotationDependencyTypeImpl.class,
362                 programmingLanguageContext.getParsedOrSeenDependency("javax.xml.ws.soap.Addressing")
363                         .getDependencyType().getClass());
364         assertEquals(AnnotationDependencyTypeImpl.class,
365                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.Testabstract")
366                         .getDependencyType().getClass());
367         assertEquals(AnnotationDependencyTypeImpl.class,
368                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.Deprecated")
369                         .getDependencyType().getClass());
370         assertEquals(AnnotationDependencyTypeImpl.class,
371                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.SuppressWarnings")
372                         .getDependencyType().getClass());
373         assertEquals(AnnotationDependencyTypeImpl.class,
374                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.Annotationinterface")
375                         .getDependencyType().getClass());
376         assertEquals(AnnotationDependencyTypeImpl.class,
377                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.AnotherAnnotation")
378                         .getDependencyType().getClass());
379         assertEquals(AnnotationDependencyTypeImpl.class,
380                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.MyAnnotation")
381                         .getDependencyType().getClass());
382         assertEquals(AnnotationDependencyTypeImpl.class,
383                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.MappedSuperclass")
384                         .getDependencyType().getClass());
385         assertEquals(AnnotationDependencyTypeImpl.class,
386                 programmingLanguageContext.getParsedOrSeenDependency("javax.annotation.Generated").getDependencyType()
387                         .getClass());
388         assertEquals(AnnotationDependencyTypeImpl.class,
389                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.Override").getDependencyType()
390                         .getClass());
391     }
392 
393     /**
394      * Test method for
395      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
396      * .
397      *
398      * @throws PlantUMLDependencyException
399      */
400     @Test
401     public void testReadDependencyFromFileClassWithCarriageReturnsAsSeparatorAndDefaultDisplaySet()
402             throws PlantUMLDependencyException {
403         final String javaSourceFileContent = "/*\r\n TestImplements.java\r\n Creation date : 20 août 2010\r\n */\r\npackage com.plantuml.\ntest;\r\n\r\nimport net.sourceforge.plantumldependency.\ncommoncli.program.\nJavaProgram;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n *\r\n * @since\r\n * @version\r\n */\r\npublic class\nTestImplements implements\nnet.sourceforge.plantumldependency.commoncli.program.\nJavaProgram {\r\nprivate static native void\nregisterNatives\n();\r\n}\r\n";
404         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
405                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
406                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
407         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY40,
408                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
409         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
410         assertEquals(3, programmingLanguageContext.getParsedAndSeenDependencies().size());
411         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(NATIVE_DEPENDENCY.getFullName()));
412         assertNotNull(programmingLanguageContext
413                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.commoncli.program.JavaProgram"));
414         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY40.getFullName()));
415         assertEquals(
416                 InterfaceDependencyTypeImpl.class,
417                 programmingLanguageContext
418                         .getParsedOrSeenDependency("net.sourceforge.plantumldependency.commoncli.program.JavaProgram")
419                         .getDependencyType().getClass());
420     }
421 
422     /**
423      * Test method for
424      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
425      * .
426      *
427      * @throws PlantUMLDependencyException
428      */
429     @Test
430     public void testReadDependencyFromFileClassWithClassWordInCommentsAndDefaultDisplaySet()
431             throws PlantUMLDependencyException {
432         final String javaSourceFileContent = "/*\r\n Test.java\r\n Creation date : 20 août 2010\r\n */\r\n\r\npackage com.plantuml.test;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n * \r\n * @since\r\n * @version\r\n */\r\n//Hello class ! my name is brian\r\npublic class Test extends TestExtends {\r\n\r\n}\r\n";
433         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
434                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
435                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
436         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY9,
437                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
438         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
439         assertEquals(2, programmingLanguageContext.getParsedAndSeenDependencies().size());
440         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.TestExtends"));
441         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY9.getFullName()));
442         assertEquals(ClassDependencyTypeImpl.class,
443                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.TestExtends")
444                         .getDependencyType().getClass());
445     }
446 
447     /**
448      * Test method for
449      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
450      * .
451      *
452      * @throws PlantUMLDependencyException
453      */
454     @Test
455     public void testReadDependencyFromFileClassWithCommentsAsSeparatorAndDefaultDisplaySet()
456             throws PlantUMLDependencyException {
457         final String javaSourceFileContent = "/*\r\n Test.java\r\n Creation date : 20 août 2010\r\n */\r\n\r\npackage com.plantuml.test;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n * \r\n * @since\r\n * @version\r\n */\r\n//Hello class ! my name is brian\r\npublic/*@bgen(jjtree)*/class/*@bgen(jjtree)*/Test/*@bgen(jjtree)*/extends/**@bgen(jjtree)**/TestExtends {\r\n\r\n}\r\n";
458         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
459                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
460                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
461         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY9,
462                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
463         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
464         assertEquals(2, programmingLanguageContext.getParsedAndSeenDependencies().size());
465         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.TestExtends"));
466         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY9.getFullName()));
467         assertEquals(ClassDependencyTypeImpl.class,
468                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.TestExtends")
469                         .getDependencyType().getClass());
470     }
471 
472     /**
473      * Test method for
474      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
475      * .
476      *
477      * @throws PlantUMLDependencyException
478      */
479     @Test
480     public void testReadDependencyFromFileClassWithExtendsGenericsInImportWithStandardEmptyContextAndDefaultDisplaySet()
481             throws PlantUMLDependencyException {
482         final String javaSourceFileContent = "/*\r\n TestExtendsGeneric.java\r\n Creation date : 20 août 2010\r\n */\r\npackage com.plantuml.test;\r\n\r\nimport com.plantuml.train.test.AnotherTestExtends;\r\nimport com.plantuml.train.test.TestExtendsGeneric;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n *\r\n * @since\r\n * @version\r\n */\r\npublic class TestExtendsWithGeneric extends TestExtendsGeneric < AnotherTestExtends > {\r\n\r\n}\r\n";
483         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
484                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
485                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
486         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY12,
487                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
488         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
489         assertEquals(3, programmingLanguageContext.getParsedAndSeenDependencies().size());
490         assertNotNull(programmingLanguageContext
491                 .getParsedOrSeenDependency("com.plantuml.train.test.AnotherTestExtends"));
492         assertNotNull(programmingLanguageContext
493                 .getParsedOrSeenDependency("com.plantuml.train.test.TestExtendsGeneric"));
494         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY12.getFullName()));
495         assertEquals(StubDependencyTypeImpl.class,
496                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.train.test.AnotherTestExtends")
497                         .getDependencyType().getClass());
498         assertEquals(ClassDependencyTypeImpl.class,
499                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.train.test.TestExtendsGeneric")
500                         .getDependencyType().getClass());
501     }
502 
503     /**
504      * Test method for
505      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
506      * .
507      *
508      * @throws PlantUMLDependencyException
509      */
510     @Test
511     public void testReadDependencyFromFileClassWithExtendsGenericsNotInImportWithStandardEmptyContextAndDefaultDisplaySet()
512             throws PlantUMLDependencyException {
513         final String javaSourceFileContent = "/*\r\n TestExtendsGeneric.java\r\n Creation date : 20 août 2010\r\n */\r\npackage com.plantuml.test;\r\n\r\nimport com.plantuml.train.test.TestExtendsGeneric;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n *\r\n * @since\r\n * @version\r\n */\r\npublic class TestExtendsWithGeneric extends TestExtendsGeneric < AnotherTestExtends > {\r\n\r\n}\r\n";
514         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
515                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
516                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
517         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY25,
518                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
519         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
520         assertEquals(2, programmingLanguageContext.getParsedAndSeenDependencies().size());
521         assertNotNull(programmingLanguageContext
522                 .getParsedOrSeenDependency("com.plantuml.train.test.TestExtendsGeneric"));
523         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY12.getFullName()));
524         assertEquals(ClassDependencyTypeImpl.class,
525                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.train.test.TestExtendsGeneric")
526                         .getDependencyType().getClass());
527     }
528 
529     /**
530      * Test method for
531      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
532      * .
533      *
534      * @throws PlantUMLDependencyException
535      */
536     @Test
537     public void testReadDependencyFromFileClassWithExtendsInImportFullPackageNameWithStandardEmptyContextAndDefaultDisplaySet()
538             throws PlantUMLDependencyException {
539         final String javaSourceFileContent = "/*\r\n Test.java\r\n Creation date : 20 août 2010\r\n */\r\n\r\npackage com.plantuml.test;\r\n\r\nimport net.sourceforge.plantumldependency.commoncli.program.impl.JavaProgramImpl;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n * \r\n * @since\r\n * @version\r\n */\r\npublic class Test extends net.sourceforge.plantumldependency.commoncli.program.impl.JavaProgramImpl {\r\n\r\n}\r\n";
540         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
541                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
542                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
543         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY23,
544                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
545         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
546         assertEquals(2, programmingLanguageContext.getParsedAndSeenDependencies().size());
547         assertNotNull(programmingLanguageContext
548                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.commoncli.program.impl.JavaProgramImpl"));
549         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY23.getFullName()));
550         assertEquals(
551                 ClassDependencyTypeImpl.class,
552                 programmingLanguageContext
553                         .getParsedOrSeenDependency(
554                                 "net.sourceforge.plantumldependency.commoncli.program.impl.JavaProgramImpl")
555                         .getDependencyType().getClass());
556     }
557 
558     /**
559      * Test method for
560      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
561      * .
562      *
563      * @throws PlantUMLDependencyException
564      */
565     @Test
566     public void testReadDependencyFromFileClassWithExtendsInImportWithStandardEmptyContextAndClassDisplaySet()
567             throws PlantUMLDependencyException {
568         final String javaSourceFileContent = "package net.sourceforge.plantumldependency;\r\n\r\nimport java.io.File;\r\nimport java.io.FileInputStream;\r\nimport java.io.FileNotFoundException;\r\nimport java.io.InputStream;\r\nimport java.io.Serializable;\r\nimport java.math.BigInteger;\r\nimport java.util.Random;\r\n\r\nimport net.sourceforge.mazix.components.clone.DeepCloneable;\r\nimport net.sourceforge.plantumldependency.main.option.programminglanguage.argument.ProgrammingLanguage;\r\nimport net.sourceforge.plantumldependency.main.option.programminglanguage.argument.java.JavaRawDependency;\r\nimport static java.util.Arrays.asList;\r\nimport static java.util.logging.Level.SEVERE;\r\n\r\npublic class TestDisplayOption extends BigInteger implements DeepCloneable < JavaRawDependency > {\r\n\r\n    /**\r\n     * \r\n     */\r\n    private static final long serialVersionUID = 8210152156402402701L;\r\n\r\n    public TestDisplayOption(byte[] arg0) {\r\n        super(arg0);\r\n        // TODO Auto-generated constructor stub\r\n    }\r\n    \r\n    public TestDisplayOption(int arg0, byte[] arg1) {\r\n        super(arg0, arg1);\r\n        File file = new File(\"toto\");\r\n        try {\r\n            InputStream inputStream = new FileInputStream(file);\r\n        } catch (FileNotFoundException e) {\r\n            // TODO Auto-generated catch block\r\n            e.printStackTrace();\r\n        }\r\n    }\r\n\r\n    public TestDisplayOption(int arg0, int arg1, Random arg2) {\r\n        super(arg0, arg1, arg2);\r\n        // TODO Auto-generated constructor stub\r\n    }\r\n\r\n    public TestDisplayOption(int arg0, Random arg1) {\r\n        super(arg0, arg1);\r\n        // TODO Auto-generated constructor stub\r\n    }\r\n\r\n    public TestDisplayOption(String arg0, int arg1) {\r\n        super(arg0, arg1);\r\n        // TODO Auto-generated constructor stub\r\n    }\r\n\r\n    public TestDisplayOption(String arg0) {\r\n        super(arg0);\r\n        // TODO Auto-generated constructor stub\r\n    }\r\n\r\n    @Override\r\n    public JavaRawDependency deepClone() {\r\n        // TODO Auto-generated method stub\r\n        return null;\r\n    }\r\n}\r\n";
569         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
570                 DISPLAY_TYPE_SET4, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN, DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
571         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY43,
572                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
573         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
574         assertEquals(14, programmingLanguageContext.getParsedAndSeenDependencies().size());
575         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.io.File"));
576         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.io.FileInputStream"));
577         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.io.FileNotFoundException"));
578         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.io.InputStream"));
579         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.io.Serializable"));
580         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.math.BigInteger"));
581         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.util.Random"));
582         assertNotNull(programmingLanguageContext
583                 .getParsedOrSeenDependency("net.sourceforge.mazix.components.clone.DeepCloneable"));
584         assertNotNull(programmingLanguageContext
585                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.main.option.programminglanguage.argument.ProgrammingLanguage"));
586         assertNotNull(programmingLanguageContext
587                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.main.option.programminglanguage.argument.java.JavaRawDependency"));
588         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.util.Arrays"));
589         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.util.logging.Level"));
590         assertNotNull(programmingLanguageContext
591                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.Override"));
592         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY44.getFullName()));
593         assertEquals(StubDependencyTypeImpl.class, programmingLanguageContext.getParsedOrSeenDependency("java.io.File")
594                 .getDependencyType().getClass());
595         assertEquals(StubDependencyTypeImpl.class,
596                 programmingLanguageContext.getParsedOrSeenDependency("java.io.FileInputStream").getDependencyType()
597                         .getClass());
598         assertEquals(StubDependencyTypeImpl.class,
599                 programmingLanguageContext.getParsedOrSeenDependency("java.io.FileNotFoundException")
600                         .getDependencyType().getClass());
601         assertEquals(StubDependencyTypeImpl.class,
602                 programmingLanguageContext.getParsedOrSeenDependency("java.io.InputStream").getDependencyType()
603                         .getClass());
604         assertEquals(StubDependencyTypeImpl.class,
605                 programmingLanguageContext.getParsedOrSeenDependency("java.io.Serializable").getDependencyType()
606                         .getClass());
607         assertEquals(ClassDependencyTypeImpl.class,
608                 programmingLanguageContext.getParsedOrSeenDependency("java.math.BigInteger").getDependencyType()
609                         .getClass());
610         assertEquals(StubDependencyTypeImpl.class,
611                 programmingLanguageContext.getParsedOrSeenDependency("java.util.Random").getDependencyType().getClass());
612         assertEquals(
613                 InterfaceDependencyTypeImpl.class,
614                 programmingLanguageContext
615                         .getParsedOrSeenDependency("net.sourceforge.mazix.components.clone.DeepCloneable")
616                         .getDependencyType().getClass());
617         assertEquals(
618                 StubDependencyTypeImpl.class,
619                 programmingLanguageContext
620                         .getParsedOrSeenDependency(
621                                 "net.sourceforge.plantumldependency.main.option.programminglanguage.argument.ProgrammingLanguage")
622                         .getDependencyType().getClass());
623         assertEquals(
624                 StubDependencyTypeImpl.class,
625                 programmingLanguageContext
626                         .getParsedOrSeenDependency(
627                                 "net.sourceforge.plantumldependency.main.option.programminglanguage.argument.java.JavaRawDependency")
628                         .getDependencyType().getClass());
629         assertEquals(StubDependencyTypeImpl.class,
630                 programmingLanguageContext.getParsedOrSeenDependency("java.util.Arrays").getDependencyType().getClass());
631         assertEquals(StubDependencyTypeImpl.class,
632                 programmingLanguageContext.getParsedOrSeenDependency("java.util.logging.Level").getDependencyType()
633                         .getClass());
634         assertEquals(AnnotationDependencyTypeImpl.class,
635                 programmingLanguageContext.getParsedOrSeenDependency("net.sourceforge.plantumldependency.Override")
636                         .getDependencyType().getClass());
637     }
638 
639     /**
640      * Test method for
641      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
642      * .
643      *
644      * @throws PlantUMLDependencyException
645      */
646     @Test
647     public void testReadDependencyFromFileClassWithExtendsInImportWithStandardEmptyContextAndDefaultDisplaySet()
648             throws PlantUMLDependencyException {
649         final String javaSourceFileContent = "/*\r\n Test.java\r\n Creation date : 20 août 2010\r\n */\r\n\r\npackage com.plantuml.test;\r\n\r\nimport com.plantuml.train.test.AnotherTestExtends;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n * \r\n * @since\r\n * @version\r\n */\r\npublic class Test extends AnotherTestExtends {\r\n\r\n}\r\n";
650         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
651                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
652                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
653         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY10,
654                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
655         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
656         assertEquals(2, programmingLanguageContext.getParsedAndSeenDependencies().size());
657         assertNotNull(programmingLanguageContext
658                 .getParsedOrSeenDependency("com.plantuml.train.test.AnotherTestExtends"));
659         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY10.getFullName()));
660         assertEquals(ClassDependencyTypeImpl.class,
661                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.train.test.AnotherTestExtends")
662                         .getDependencyType().getClass());
663     }
664 
665     /**
666      * Test method for
667      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
668      * .
669      *
670      * @throws PlantUMLDependencyException
671      */
672     @Test
673     public void testReadDependencyFromFileClassWithExtendsInImportWithStandardEmptyContextAndExtensionsDisplaySet()
674             throws PlantUMLDependencyException {
675         final String javaSourceFileContent = "package net.sourceforge.plantumldependency;\r\n\r\nimport java.io.File;\r\nimport java.io.FileInputStream;\r\nimport java.io.FileNotFoundException;\r\nimport java.io.InputStream;\r\nimport java.io.Serializable;\r\nimport java.math.BigInteger;\r\nimport java.util.Random;\r\n\r\nimport net.sourceforge.mazix.components.clone.DeepCloneable;\r\nimport net.sourceforge.plantumldependency.main.option.programminglanguage.argument.ProgrammingLanguage;\r\nimport net.sourceforge.plantumldependency.main.option.programminglanguage.argument.java.JavaRawDependency;\r\nimport static java.util.Arrays.asList;\r\nimport static java.util.logging.Level.SEVERE;\r\n\r\npublic class TestDisplayOption extends BigInteger implements DeepCloneable < JavaRawDependency > {\r\n\r\n    /**\r\n     * \r\n     */\r\n    private static final long serialVersionUID = 8210152156402402701L;\r\n\r\n    public TestDisplayOption(byte[] arg0) {\r\n        super(arg0);\r\n        // TODO Auto-generated constructor stub\r\n    }\r\n    \r\npublic TestDisplayOption(int arg0, byte[] arg1) {\r\n        super(arg0, arg1);\r\n        File file = new File(\"toto\");\r\n        try {\r\n            InputStream inputStream = new FileInputStream(file);\r\n        } catch (FileNotFoundException e) {\r\n            // TODO Auto-generated catch block\r\n            e.printStackTrace();\r\n        }\r\n    }\r\n\r\n    public TestDisplayOption(int arg0, int arg1, Random arg2) {\r\n        super(arg0, arg1, arg2);\r\n        // TODO Auto-generated constructor stub\r\n    }\r\n\r\n    public TestDisplayOption(int arg0, Random arg1) {\r\n        super(arg0, arg1);\r\n        // TODO Auto-generated constructor stub\r\n    }\r\n\r\n    public TestDisplayOption(String arg0, int arg1) {\r\n        super(arg0, arg1);\r\n        // TODO Auto-generated constructor stub\r\n    }\r\n\r\n    public TestDisplayOption(String arg0) {\r\n        super(arg0);\r\n        // TODO Auto-generated constructor stub\r\n    }\r\n\r\n    @Override\r\n    public JavaRawDependency deepClone() {\r\n        // TODO Auto-generated method stub\r\n        return null;\r\n    }\r\n}\r\n";
676         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
677                 DISPLAY_TYPE_SET30, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN, DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
678         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY45,
679                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
680         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
681         assertEquals(14, programmingLanguageContext.getParsedAndSeenDependencies().size());
682         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.io.File"));
683         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.io.FileInputStream"));
684         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.io.FileNotFoundException"));
685         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.io.InputStream"));
686         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.io.Serializable"));
687         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.math.BigInteger"));
688         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.util.Random"));
689         assertNotNull(programmingLanguageContext
690                 .getParsedOrSeenDependency("net.sourceforge.mazix.components.clone.DeepCloneable"));
691         assertNotNull(programmingLanguageContext
692                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.main.option.programminglanguage.argument.ProgrammingLanguage"));
693         assertNotNull(programmingLanguageContext
694                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.main.option.programminglanguage.argument.java.JavaRawDependency"));
695         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.util.Arrays"));
696         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.util.logging.Level"));
697         assertNotNull(programmingLanguageContext
698                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.Override"));
699         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY45.getFullName()));
700         assertEquals(StubDependencyTypeImpl.class, programmingLanguageContext.getParsedOrSeenDependency("java.io.File")
701                 .getDependencyType().getClass());
702         assertEquals(StubDependencyTypeImpl.class,
703                 programmingLanguageContext.getParsedOrSeenDependency("java.io.FileInputStream").getDependencyType()
704                         .getClass());
705         assertEquals(StubDependencyTypeImpl.class,
706                 programmingLanguageContext.getParsedOrSeenDependency("java.io.FileNotFoundException")
707                         .getDependencyType().getClass());
708         assertEquals(StubDependencyTypeImpl.class,
709                 programmingLanguageContext.getParsedOrSeenDependency("java.io.InputStream").getDependencyType()
710                         .getClass());
711         assertEquals(StubDependencyTypeImpl.class,
712                 programmingLanguageContext.getParsedOrSeenDependency("java.io.Serializable").getDependencyType()
713                         .getClass());
714         assertEquals(ClassDependencyTypeImpl.class,
715                 programmingLanguageContext.getParsedOrSeenDependency("java.math.BigInteger").getDependencyType()
716                         .getClass());
717         assertEquals(StubDependencyTypeImpl.class,
718                 programmingLanguageContext.getParsedOrSeenDependency("java.util.Random").getDependencyType().getClass());
719         assertEquals(
720                 InterfaceDependencyTypeImpl.class,
721                 programmingLanguageContext
722                         .getParsedOrSeenDependency("net.sourceforge.mazix.components.clone.DeepCloneable")
723                         .getDependencyType().getClass());
724         assertEquals(
725                 StubDependencyTypeImpl.class,
726                 programmingLanguageContext
727                         .getParsedOrSeenDependency(
728                                 "net.sourceforge.plantumldependency.main.option.programminglanguage.argument.ProgrammingLanguage")
729                         .getDependencyType().getClass());
730         assertEquals(
731                 StubDependencyTypeImpl.class,
732                 programmingLanguageContext
733                         .getParsedOrSeenDependency(
734                                 "net.sourceforge.plantumldependency.main.option.programminglanguage.argument.java.JavaRawDependency")
735                         .getDependencyType().getClass());
736         assertEquals(StubDependencyTypeImpl.class,
737                 programmingLanguageContext.getParsedOrSeenDependency("java.util.Arrays").getDependencyType().getClass());
738         assertEquals(StubDependencyTypeImpl.class,
739                 programmingLanguageContext.getParsedOrSeenDependency("java.util.logging.Level").getDependencyType()
740                         .getClass());
741         assertEquals(AnnotationDependencyTypeImpl.class,
742                 programmingLanguageContext.getParsedOrSeenDependency("net.sourceforge.plantumldependency.Override")
743                         .getDependencyType().getClass());
744     }
745 
746     /**
747      * Test method for
748      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
749      * .
750      *
751      * @throws PlantUMLDependencyException
752      */
753     @Test
754     public void testReadDependencyFromFileClassWithExtendsInImportWithStandardEmptyContextAndImplementationsDisplaySet()
755             throws PlantUMLDependencyException {
756         final String javaSourceFileContent = "package net.sourceforge.plantumldependency;\r\n\r\nimport java.io.File;\r\nimport java.io.FileInputStream;\r\nimport java.io.FileNotFoundException;\r\nimport java.io.InputStream;\r\nimport java.io.Serializable;\r\nimport java.math.BigInteger;\r\nimport java.util.Random;\r\n\r\nimport net.sourceforge.mazix.components.clone.DeepCloneable;\r\nimport net.sourceforge.plantumldependency.main.option.programminglanguage.argument.ProgrammingLanguage;\r\nimport net.sourceforge.plantumldependency.main.option.programminglanguage.argument.java.JavaRawDependency;\r\nimport static java.util.Arrays.asList;\r\nimport static java.util.logging.Level.SEVERE;\r\n\r\npublic class TestDisplayOption extends BigInteger implements DeepCloneable < JavaRawDependency > {\r\n\r\n    /**\r\n     * \r\n     */\r\n    private static final long serialVersionUID = 8210152156402402701L;\r\n\r\n    public TestDisplayOption(byte[] arg0) {\r\n        super(arg0);\r\n        // TODO Auto-generated constructor stub\r\n    }\r\n    \r\n    \r\n\r\n    public TestDisplayOption(int arg0, byte[] arg1) {\r\n        super(arg0, arg1);\r\n        File file = new File(\"toto\");\r\n        try {\r\n            InputStream inputStream = new FileInputStream(file);\r\n        } catch (FileNotFoundException e) {\r\n            // TODO Auto-generated catch block\r\n            e.printStackTrace();\r\n        }\r\n    }\r\n\r\n    public TestDisplayOption(int arg0, int arg1, Random arg2) {\r\n        super(arg0, arg1, arg2);\r\n        // TODO Auto-generated constructor stub\r\n    }\r\n\r\n    public TestDisplayOption(int arg0, Random arg1) {\r\n        super(arg0, arg1);\r\n        // TODO Auto-generated constructor stub\r\n    }\r\n\r\n    public TestDisplayOption(String arg0, int arg1) {\r\n        super(arg0, arg1);\r\n        // TODO Auto-generated constructor stub\r\n    }\r\n\r\n    public TestDisplayOption(String arg0) {\r\n        super(arg0);\r\n        // TODO Auto-generated constructor stub\r\n    }\r\n\r\n    @Override\r\n    public JavaRawDependency deepClone() {\r\n        // TODO Auto-generated method stub\r\n        return null;\r\n    }\r\n}\r\n";
757         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
758                 DISPLAY_TYPE_SET31, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN, DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
759         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY45,
760                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
761         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
762         assertEquals(14, programmingLanguageContext.getParsedAndSeenDependencies().size());
763         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.io.File"));
764         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.io.FileInputStream"));
765         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.io.FileNotFoundException"));
766         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.io.InputStream"));
767         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.io.Serializable"));
768         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.math.BigInteger"));
769         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.util.Random"));
770         assertNotNull(programmingLanguageContext
771                 .getParsedOrSeenDependency("net.sourceforge.mazix.components.clone.DeepCloneable"));
772         assertNotNull(programmingLanguageContext
773                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.main.option.programminglanguage.argument.ProgrammingLanguage"));
774         assertNotNull(programmingLanguageContext
775                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.main.option.programminglanguage.argument.java.JavaRawDependency"));
776         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.util.Arrays"));
777         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.util.logging.Level"));
778         assertNotNull(programmingLanguageContext
779                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.Override"));
780         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY45.getFullName()));
781         assertEquals(StubDependencyTypeImpl.class, programmingLanguageContext.getParsedOrSeenDependency("java.io.File")
782                 .getDependencyType().getClass());
783         assertEquals(StubDependencyTypeImpl.class,
784                 programmingLanguageContext.getParsedOrSeenDependency("java.io.FileInputStream").getDependencyType()
785                         .getClass());
786         assertEquals(StubDependencyTypeImpl.class,
787                 programmingLanguageContext.getParsedOrSeenDependency("java.io.FileNotFoundException")
788                         .getDependencyType().getClass());
789         assertEquals(StubDependencyTypeImpl.class,
790                 programmingLanguageContext.getParsedOrSeenDependency("java.io.InputStream").getDependencyType()
791                         .getClass());
792         assertEquals(StubDependencyTypeImpl.class,
793                 programmingLanguageContext.getParsedOrSeenDependency("java.io.Serializable").getDependencyType()
794                         .getClass());
795         assertEquals(ClassDependencyTypeImpl.class,
796                 programmingLanguageContext.getParsedOrSeenDependency("java.math.BigInteger").getDependencyType()
797                         .getClass());
798         assertEquals(StubDependencyTypeImpl.class,
799                 programmingLanguageContext.getParsedOrSeenDependency("java.util.Random").getDependencyType().getClass());
800         assertEquals(
801                 InterfaceDependencyTypeImpl.class,
802                 programmingLanguageContext
803                         .getParsedOrSeenDependency("net.sourceforge.mazix.components.clone.DeepCloneable")
804                         .getDependencyType().getClass());
805         assertEquals(
806                 StubDependencyTypeImpl.class,
807                 programmingLanguageContext
808                         .getParsedOrSeenDependency(
809                                 "net.sourceforge.plantumldependency.main.option.programminglanguage.argument.ProgrammingLanguage")
810                         .getDependencyType().getClass());
811         assertEquals(
812                 StubDependencyTypeImpl.class,
813                 programmingLanguageContext
814                         .getParsedOrSeenDependency(
815                                 "net.sourceforge.plantumldependency.main.option.programminglanguage.argument.java.JavaRawDependency")
816                         .getDependencyType().getClass());
817         assertEquals(StubDependencyTypeImpl.class,
818                 programmingLanguageContext.getParsedOrSeenDependency("java.util.Arrays").getDependencyType().getClass());
819         assertEquals(StubDependencyTypeImpl.class,
820                 programmingLanguageContext.getParsedOrSeenDependency("java.util.logging.Level").getDependencyType()
821                         .getClass());
822         assertEquals(AnnotationDependencyTypeImpl.class,
823                 programmingLanguageContext.getParsedOrSeenDependency("net.sourceforge.plantumldependency.Override")
824                         .getDependencyType().getClass());
825     }
826 
827     /**
828      * Test method for
829      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
830      * .
831      *
832      * @throws PlantUMLDependencyException
833      */
834     @Test
835     public void testReadDependencyFromFileClassWithExtendsInImportWithStandardEmptyContextAndImportsDisplaySet()
836             throws PlantUMLDependencyException {
837         final String javaSourceFileContent = "package net.sourceforge.plantumldependency;\r\n\r\nimport java.io.File;\r\nimport java.io.FileInputStream;\r\nimport java.io.FileNotFoundException;\r\nimport java.io.InputStream;\r\nimport java.io.Serializable;\r\nimport java.math.BigInteger;\r\nimport java.util.Random;\r\n\r\nimport net.sourceforge.mazix.components.clone.DeepCloneable;\r\nimport net.sourceforge.plantumldependency.main.option.programminglanguage.argument.ProgrammingLanguage;\r\nimport net.sourceforge.plantumldependency.main.option.programminglanguage.argument.java.JavaRawDependency;\r\nimport static java.util.Arrays.asList;\r\nimport static java.util.logging.Level.SEVERE;\r\n\r\npublic class TestDisplayOption extends BigInteger implements DeepCloneable < JavaRawDependency > {\r\n\r\n    /**\r\n     * \r\n     */\r\n    private static final long serialVersionUID = 8210152156402402701L;\r\n\r\n    public TestDisplayOption(byte[] arg0) {\r\n        super(arg0);\r\n        // TODO Auto-generated constructor stub\r\n    }\r\n    \r\n    \r\n\r\n    public TestDisplayOption(int arg0, byte[] arg1) {\r\n        super(arg0, arg1);\r\n        File file = new File(\"toto\");\r\n        try {\r\n            InputStream inputStream = new FileInputStream(file);\r\n        } catch (FileNotFoundException e) {\r\n            // TODO Auto-generated catch block\r\n            e.printStackTrace();\r\n        }\r\n    }\r\n\r\n    public TestDisplayOption(int arg0, int arg1, Random arg2) {\r\n        super(arg0, arg1, arg2);\r\n        // TODO Auto-generated constructor stub\r\n    }\r\n\r\n    public TestDisplayOption(int arg0, Random arg1) {\r\n        super(arg0, arg1);\r\n        // TODO Auto-generated constructor stub\r\n    }\r\n\r\n    public TestDisplayOption(String arg0, int arg1) {\r\n        super(arg0, arg1);\r\n        // TODO Auto-generated constructor stub\r\n    }\r\n\r\n    public TestDisplayOption(String arg0) {\r\n        super(arg0);\r\n        // TODO Auto-generated constructor stub\r\n    }\r\n\r\n    @Override\r\n    public JavaRawDependency deepClone() {\r\n        // TODO Auto-generated method stub\r\n        return null;\r\n    }\r\n}\r\n";
838         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
839                 DISPLAY_TYPE_SET32, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN, DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
840         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY45,
841                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
842         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
843         assertEquals(14, programmingLanguageContext.getParsedAndSeenDependencies().size());
844         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.io.File"));
845         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.io.FileInputStream"));
846         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.io.FileNotFoundException"));
847         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.io.InputStream"));
848         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.io.Serializable"));
849         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.math.BigInteger"));
850         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.util.Random"));
851         assertNotNull(programmingLanguageContext
852                 .getParsedOrSeenDependency("net.sourceforge.mazix.components.clone.DeepCloneable"));
853         assertNotNull(programmingLanguageContext
854                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.main.option.programminglanguage.argument.ProgrammingLanguage"));
855         assertNotNull(programmingLanguageContext
856                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.main.option.programminglanguage.argument.java.JavaRawDependency"));
857         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.util.Arrays"));
858         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.util.logging.Level"));
859         assertNotNull(programmingLanguageContext
860                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.Override"));
861         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY45.getFullName()));
862         assertEquals(StubDependencyTypeImpl.class, programmingLanguageContext.getParsedOrSeenDependency("java.io.File")
863                 .getDependencyType().getClass());
864         assertEquals(StubDependencyTypeImpl.class,
865                 programmingLanguageContext.getParsedOrSeenDependency("java.io.FileInputStream").getDependencyType()
866                         .getClass());
867         assertEquals(StubDependencyTypeImpl.class,
868                 programmingLanguageContext.getParsedOrSeenDependency("java.io.FileNotFoundException")
869                         .getDependencyType().getClass());
870         assertEquals(StubDependencyTypeImpl.class,
871                 programmingLanguageContext.getParsedOrSeenDependency("java.io.InputStream").getDependencyType()
872                         .getClass());
873         assertEquals(StubDependencyTypeImpl.class,
874                 programmingLanguageContext.getParsedOrSeenDependency("java.io.Serializable").getDependencyType()
875                         .getClass());
876         assertEquals(ClassDependencyTypeImpl.class,
877                 programmingLanguageContext.getParsedOrSeenDependency("java.math.BigInteger").getDependencyType()
878                         .getClass());
879         assertEquals(StubDependencyTypeImpl.class,
880                 programmingLanguageContext.getParsedOrSeenDependency("java.util.Random").getDependencyType().getClass());
881         assertEquals(
882                 InterfaceDependencyTypeImpl.class,
883                 programmingLanguageContext
884                         .getParsedOrSeenDependency("net.sourceforge.mazix.components.clone.DeepCloneable")
885                         .getDependencyType().getClass());
886         assertEquals(
887                 StubDependencyTypeImpl.class,
888                 programmingLanguageContext
889                         .getParsedOrSeenDependency(
890                                 "net.sourceforge.plantumldependency.main.option.programminglanguage.argument.ProgrammingLanguage")
891                         .getDependencyType().getClass());
892         assertEquals(
893                 StubDependencyTypeImpl.class,
894                 programmingLanguageContext
895                         .getParsedOrSeenDependency(
896                                 "net.sourceforge.plantumldependency.main.option.programminglanguage.argument.java.JavaRawDependency")
897                         .getDependencyType().getClass());
898         assertEquals(StubDependencyTypeImpl.class,
899                 programmingLanguageContext.getParsedOrSeenDependency("java.util.Arrays").getDependencyType().getClass());
900         assertEquals(StubDependencyTypeImpl.class,
901                 programmingLanguageContext.getParsedOrSeenDependency("java.util.logging.Level").getDependencyType()
902                         .getClass());
903         assertEquals(AnnotationDependencyTypeImpl.class,
904                 programmingLanguageContext.getParsedOrSeenDependency("net.sourceforge.plantumldependency.Override")
905                         .getDependencyType().getClass());
906     }
907 
908     /**
909      * Test method for
910      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
911      * .
912      *
913      * @throws PlantUMLDependencyException
914      */
915     @Test
916     public void testReadDependencyFromFileClassWithExtendsInImportWithStandardEmptyContextAndImportsStaticDisplaySet()
917             throws PlantUMLDependencyException {
918         final String javaSourceFileContent = "package net.sourceforge.plantumldependency;\r\n\r\nimport java.io.File;\r\nimport java.io.FileInputStream;\r\nimport java.io.FileNotFoundException;\r\nimport java.io.InputStream;\r\nimport java.io.Serializable;\r\nimport java.math.BigInteger;\r\nimport java.util.Random;\r\n\r\nimport net.sourceforge.mazix.components.clone.DeepCloneable;\r\nimport net.sourceforge.plantumldependency.main.option.programminglanguage.argument.ProgrammingLanguage;\r\nimport net.sourceforge.plantumldependency.main.option.programminglanguage.argument.java.JavaRawDependency;\r\nimport static java.util.Arrays.asList;\r\nimport static java.util.logging.Level.SEVERE;\r\n\r\npublic class TestDisplayOption extends BigInteger implements DeepCloneable < JavaRawDependency > {\r\n\r\n    /**\r\n     * \r\n     */\r\n    private static final long serialVersionUID = 8210152156402402701L;\r\n\r\n    public TestDisplayOption(byte[] arg0) {\r\n        super(arg0);\r\n        // TODO Auto-generated constructor stub\r\n    }\r\n    \r\n    \r\n\r\n    public TestDisplayOption(int arg0, byte[] arg1) {\r\n        super(arg0, arg1);\r\n        File file = new File(\"toto\");\r\n        try {\r\n            InputStream inputStream = new FileInputStream(file);\r\n        } catch (FileNotFoundException e) {\r\n            // TODO Auto-generated catch block\r\n            e.printStackTrace();\r\n        }\r\n    }\r\n\r\n    public TestDisplayOption(int arg0, int arg1, Random arg2) {\r\n        super(arg0, arg1, arg2);\r\n        // TODO Auto-generated constructor stub\r\n    }\r\n\r\n    public TestDisplayOption(int arg0, Random arg1) {\r\n        super(arg0, arg1);\r\n        // TODO Auto-generated constructor stub\r\n    }\r\n\r\n    public TestDisplayOption(String arg0, int arg1) {\r\n        super(arg0, arg1);\r\n        // TODO Auto-generated constructor stub\r\n    }\r\n\r\n    public TestDisplayOption(String arg0) {\r\n        super(arg0);\r\n        // TODO Auto-generated constructor stub\r\n    }\r\n\r\n    @Override\r\n    public JavaRawDependency deepClone() {\r\n        // TODO Auto-generated method stub\r\n        return null;\r\n    }\r\n}\r\n";
919         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
920                 DISPLAY_TYPE_SET35, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN, DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
921         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY45,
922                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
923         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
924         assertEquals(14, programmingLanguageContext.getParsedAndSeenDependencies().size());
925         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.io.File"));
926         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.io.FileInputStream"));
927         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.io.FileNotFoundException"));
928         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.io.InputStream"));
929         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.io.Serializable"));
930         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.math.BigInteger"));
931         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.util.Random"));
932         assertNotNull(programmingLanguageContext
933                 .getParsedOrSeenDependency("net.sourceforge.mazix.components.clone.DeepCloneable"));
934         assertNotNull(programmingLanguageContext
935                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.main.option.programminglanguage.argument.ProgrammingLanguage"));
936         assertNotNull(programmingLanguageContext
937                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.main.option.programminglanguage.argument.java.JavaRawDependency"));
938         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.util.Arrays"));
939         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.util.logging.Level"));
940         assertNotNull(programmingLanguageContext
941                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.Override"));
942         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY45.getFullName()));
943         assertEquals(StubDependencyTypeImpl.class, programmingLanguageContext.getParsedOrSeenDependency("java.io.File")
944                 .getDependencyType().getClass());
945         assertEquals(StubDependencyTypeImpl.class,
946                 programmingLanguageContext.getParsedOrSeenDependency("java.io.FileInputStream").getDependencyType()
947                         .getClass());
948         assertEquals(StubDependencyTypeImpl.class,
949                 programmingLanguageContext.getParsedOrSeenDependency("java.io.FileNotFoundException")
950                         .getDependencyType().getClass());
951         assertEquals(StubDependencyTypeImpl.class,
952                 programmingLanguageContext.getParsedOrSeenDependency("java.io.InputStream").getDependencyType()
953                         .getClass());
954         assertEquals(StubDependencyTypeImpl.class,
955                 programmingLanguageContext.getParsedOrSeenDependency("java.io.Serializable").getDependencyType()
956                         .getClass());
957         assertEquals(ClassDependencyTypeImpl.class,
958                 programmingLanguageContext.getParsedOrSeenDependency("java.math.BigInteger").getDependencyType()
959                         .getClass());
960         assertEquals(StubDependencyTypeImpl.class,
961                 programmingLanguageContext.getParsedOrSeenDependency("java.util.Random").getDependencyType().getClass());
962         assertEquals(
963                 InterfaceDependencyTypeImpl.class,
964                 programmingLanguageContext
965                         .getParsedOrSeenDependency("net.sourceforge.mazix.components.clone.DeepCloneable")
966                         .getDependencyType().getClass());
967         assertEquals(
968                 StubDependencyTypeImpl.class,
969                 programmingLanguageContext
970                         .getParsedOrSeenDependency(
971                                 "net.sourceforge.plantumldependency.main.option.programminglanguage.argument.ProgrammingLanguage")
972                         .getDependencyType().getClass());
973         assertEquals(
974                 StubDependencyTypeImpl.class,
975                 programmingLanguageContext
976                         .getParsedOrSeenDependency(
977                                 "net.sourceforge.plantumldependency.main.option.programminglanguage.argument.java.JavaRawDependency")
978                         .getDependencyType().getClass());
979         assertEquals(StubDependencyTypeImpl.class,
980                 programmingLanguageContext.getParsedOrSeenDependency("java.util.Arrays").getDependencyType().getClass());
981         assertEquals(StubDependencyTypeImpl.class,
982                 programmingLanguageContext.getParsedOrSeenDependency("java.util.logging.Level").getDependencyType()
983                         .getClass());
984         assertEquals(AnnotationDependencyTypeImpl.class,
985                 programmingLanguageContext.getParsedOrSeenDependency("net.sourceforge.plantumldependency.Override")
986                         .getDependencyType().getClass());
987     }
988 
989     /**
990      * Test method for
991      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
992      * .
993      *
994      * @throws PlantUMLDependencyException
995      */
996     @Test
997     public void testReadDependencyFromFileClassWithExtendsInImportWithStandardEmptyContextAndNativeDisplaySet()
998             throws PlantUMLDependencyException {
999         final String javaSourceFileContent = "package net.sourceforge.plantumldependency;\r\n\r\nimport java.io.File;\r\nimport java.io.FileInputStream;\r\nimport java.io.FileNotFoundException;\r\nimport java.io.InputStream;\r\nimport java.io.Serializable;\r\nimport java.math.BigInteger;\r\nimport java.util.Random;\r\n\r\nimport net.sourceforge.mazix.components.clone.DeepCloneable;\r\nimport net.sourceforge.plantumldependency.main.option.programminglanguage.argument.ProgrammingLanguage;\r\nimport net.sourceforge.plantumldependency.main.option.programminglanguage.argument.java.JavaRawDependency;\r\nimport static java.util.Arrays.asList;\r\nimport static java.util.logging.Level.SEVERE;\r\n\r\npublic class TestDisplayOption extends BigInteger implements DeepCloneable < JavaRawDependency > {\r\n\r\n    /**\r\n     * \r\n     */\r\n    private static final long serialVersionUID = 8210152156402402701L;\r\n\r\n    public TestDisplayOption(byte[] arg0) {\r\n        super(arg0);\r\n        // TODO Auto-generated constructor stub\r\n    }\r\n    \r\n    \r\n\r\n    public TestDisplayOption(int arg0, byte[] arg1) {\r\n        super(arg0, arg1);\r\n        File file = new File(\"toto\");\r\n        try {\r\n            InputStream inputStream = new FileInputStream(file);\r\n        } catch (FileNotFoundException e) {\r\n            // TODO Auto-generated catch block\r\n            e.printStackTrace();\r\n        }\r\n    }\r\n\r\n    public TestDisplayOption(int arg0, int arg1, Random arg2) {\r\n        super(arg0, arg1, arg2);\r\n        // TODO Auto-generated constructor stub\r\n    }\r\n\r\n    public TestDisplayOption(int arg0, Random arg1) {\r\n        super(arg0, arg1);\r\n        // TODO Auto-generated constructor stub\r\n    }\r\n\r\n    public TestDisplayOption(String arg0, int arg1) {\r\n        super(arg0, arg1);\r\n        // TODO Auto-generated constructor stub\r\n    }\r\n\r\n    public TestDisplayOption(String arg0) {\r\n        super(arg0);\r\n        // TODO Auto-generated constructor stub\r\n    }\r\n\r\n    @Override\r\n    public JavaRawDependency deepClone() {\r\n        // TODO Auto-generated method stub\r\n        return null;\r\n    }\r\n}\r\n";
1000         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
1001                 DISPLAY_TYPE_SET34, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN, DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
1002         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY45,
1003                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
1004         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
1005         assertEquals(14, programmingLanguageContext.getParsedAndSeenDependencies().size());
1006         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.io.File"));
1007         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.io.FileInputStream"));
1008         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.io.FileNotFoundException"));
1009         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.io.InputStream"));
1010         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.io.Serializable"));
1011         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.math.BigInteger"));
1012         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.util.Random"));
1013         assertNotNull(programmingLanguageContext
1014                 .getParsedOrSeenDependency("net.sourceforge.mazix.components.clone.DeepCloneable"));
1015         assertNotNull(programmingLanguageContext
1016                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.main.option.programminglanguage.argument.ProgrammingLanguage"));
1017         assertNotNull(programmingLanguageContext
1018                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.main.option.programminglanguage.argument.java.JavaRawDependency"));
1019         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.util.Arrays"));
1020         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.util.logging.Level"));
1021         assertNotNull(programmingLanguageContext
1022                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.Override"));
1023         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY45.getFullName()));
1024         assertEquals(StubDependencyTypeImpl.class, programmingLanguageContext.getParsedOrSeenDependency("java.io.File")
1025                 .getDependencyType().getClass());
1026         assertEquals(StubDependencyTypeImpl.class,
1027                 programmingLanguageContext.getParsedOrSeenDependency("java.io.FileInputStream").getDependencyType()
1028                         .getClass());
1029         assertEquals(StubDependencyTypeImpl.class,
1030                 programmingLanguageContext.getParsedOrSeenDependency("java.io.FileNotFoundException")
1031                         .getDependencyType().getClass());
1032         assertEquals(StubDependencyTypeImpl.class,
1033                 programmingLanguageContext.getParsedOrSeenDependency("java.io.InputStream").getDependencyType()
1034                         .getClass());
1035         assertEquals(StubDependencyTypeImpl.class,
1036                 programmingLanguageContext.getParsedOrSeenDependency("java.io.Serializable").getDependencyType()
1037                         .getClass());
1038         assertEquals(ClassDependencyTypeImpl.class,
1039                 programmingLanguageContext.getParsedOrSeenDependency("java.math.BigInteger").getDependencyType()
1040                         .getClass());
1041         assertEquals(StubDependencyTypeImpl.class,
1042                 programmingLanguageContext.getParsedOrSeenDependency("java.util.Random").getDependencyType().getClass());
1043         assertEquals(
1044                 InterfaceDependencyTypeImpl.class,
1045                 programmingLanguageContext
1046                         .getParsedOrSeenDependency("net.sourceforge.mazix.components.clone.DeepCloneable")
1047                         .getDependencyType().getClass());
1048         assertEquals(
1049                 StubDependencyTypeImpl.class,
1050                 programmingLanguageContext
1051                         .getParsedOrSeenDependency(
1052                                 "net.sourceforge.plantumldependency.main.option.programminglanguage.argument.ProgrammingLanguage")
1053                         .getDependencyType().getClass());
1054         assertEquals(
1055                 StubDependencyTypeImpl.class,
1056                 programmingLanguageContext
1057                         .getParsedOrSeenDependency(
1058                                 "net.sourceforge.plantumldependency.main.option.programminglanguage.argument.java.JavaRawDependency")
1059                         .getDependencyType().getClass());
1060         assertEquals(StubDependencyTypeImpl.class,
1061                 programmingLanguageContext.getParsedOrSeenDependency("java.util.Arrays").getDependencyType().getClass());
1062         assertEquals(StubDependencyTypeImpl.class,
1063                 programmingLanguageContext.getParsedOrSeenDependency("java.util.logging.Level").getDependencyType()
1064                         .getClass());
1065         assertEquals(AnnotationDependencyTypeImpl.class,
1066                 programmingLanguageContext.getParsedOrSeenDependency("net.sourceforge.plantumldependency.Override")
1067                         .getDependencyType().getClass());
1068     }
1069 
1070     /**
1071      * Test method for
1072      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
1073      * .
1074      *
1075      * @throws PlantUMLDependencyException
1076      */
1077     @Test
1078     public void testReadDependencyFromFileClassWithExtendsNotInImportFullPackageNameWithStandardEmptyContextAndDefaultDisplaySet()
1079             throws PlantUMLDependencyException {
1080         final String javaSourceFileContent = "/*\r\n Test.java\r\n Creation date : 20 août 2010\r\n */\r\n\r\npackage com.plantuml.test;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n * \r\n * @since\r\n * @version\r\n */\r\npublic class Test extends net.sourceforge.plantumldependency.commoncli.program.impl.JavaProgramImpl {\r\n\r\n}\r\n";
1081         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
1082                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
1083                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
1084         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY21,
1085                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
1086         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
1087         assertEquals(2, programmingLanguageContext.getParsedAndSeenDependencies().size());
1088         assertNotNull(programmingLanguageContext
1089                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.commoncli.program.impl.JavaProgramImpl"));
1090         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY21.getFullName()));
1091         assertEquals(
1092                 ClassDependencyTypeImpl.class,
1093                 programmingLanguageContext
1094                         .getParsedOrSeenDependency(
1095                                 "net.sourceforge.plantumldependency.commoncli.program.impl.JavaProgramImpl")
1096                         .getDependencyType().getClass());
1097     }
1098 
1099     /**
1100      * Test method for
1101      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
1102      * .
1103      *
1104      * @throws PlantUMLDependencyException
1105      */
1106     @Test
1107     public void testReadDependencyFromFileClassWithExtendsNotInImportJavaLangWithStandardEmptyContextAndDefaultDisplaySet()
1108             throws PlantUMLDependencyException {
1109         final String javaSourceFileContent = "/*\r\n Test.java\r\n Creation date : 20 août 2010\r\n */\r\n\r\npackage com.plantuml.test;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n * \r\n * @since\r\n * @version\r\n */\r\npublic class Test extends ClassNotFoundException {\r\n\r\n}\r\n";
1110         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
1111                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
1112                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
1113         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY19,
1114                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
1115         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
1116         assertEquals(2, programmingLanguageContext.getParsedAndSeenDependencies().size());
1117         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.ClassNotFoundException"));
1118         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY19.getFullName()));
1119         assertEquals(ClassDependencyTypeImpl.class,
1120                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.ClassNotFoundException")
1121                         .getDependencyType().getClass());
1122     }
1123 
1124     /**
1125      * Test method for
1126      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
1127      * .
1128      *
1129      * @throws PlantUMLDependencyException
1130      */
1131     @Test
1132     public void testReadDependencyFromFileClassWithExtendsNotInImportNotJavaLangWithStandardEmptyContextAndDefaultDisplaySet()
1133             throws PlantUMLDependencyException {
1134         final String javaSourceFileContent = "/*\r\n Test.java\r\n Creation date : 20 août 2010\r\n */\r\n\r\npackage com.plantuml.test;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n * \r\n * @since\r\n * @version\r\n */\r\npublic class Test extends TestExtends {\r\n\r\n}\r\n";
1135         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
1136                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
1137                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
1138         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY9,
1139                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
1140         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
1141         assertEquals(2, programmingLanguageContext.getParsedAndSeenDependencies().size());
1142         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.TestExtends"));
1143         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY9.getFullName()));
1144         assertEquals(ClassDependencyTypeImpl.class,
1145                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.TestExtends")
1146                         .getDependencyType().getClass());
1147     }
1148 
1149     /**
1150      * Test method for
1151      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
1152      * .
1153      *
1154      * @throws PlantUMLDependencyException
1155      */
1156     @Test
1157     public void testReadDependencyFromFileClassWithGenericDefinitionAndDefaultDisplaySet()
1158             throws PlantUMLDependencyException {
1159         final String javaSourceFileContent = "/*\r\n TestExtendsGeneric.java\r\n Creation date : 20 août 2010\r\n */\r\npackage com.plantuml.test;\r\n\r\nimport com.plantuml.train.test.AnotherTestExtends;\r\nimport com.plantuml.train.test.TestExtendsGeneric;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n *\r\n * @since\r\n * @version\r\n */\r\npublic class TestExtendsWithGeneric < A extends AnotherTestExtends > extends TestExtendsGeneric < AnotherTestExtends > {\r\n\r\n}\r\n";
1160         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
1161                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
1162                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
1163         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY12,
1164                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
1165         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
1166         assertEquals(3, programmingLanguageContext.getParsedAndSeenDependencies().size());
1167         assertNotNull(programmingLanguageContext
1168                 .getParsedOrSeenDependency("com.plantuml.train.test.AnotherTestExtends"));
1169         assertNotNull(programmingLanguageContext
1170                 .getParsedOrSeenDependency("com.plantuml.train.test.TestExtendsGeneric"));
1171         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY12.getFullName()));
1172         assertEquals(StubDependencyTypeImpl.class,
1173                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.train.test.AnotherTestExtends")
1174                         .getDependencyType().getClass());
1175         assertEquals(ClassDependencyTypeImpl.class,
1176                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.train.test.TestExtendsGeneric")
1177                         .getDependencyType().getClass());
1178     }
1179 
1180     /**
1181      * Test method for
1182      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
1183      * .
1184      *
1185      * @throws PlantUMLDependencyException
1186      */
1187     @Test
1188     public void testReadDependencyFromFileClassWithImplementsGenericsInImportWithStandardEmptyContextAndDefaultDisplaySet()
1189             throws PlantUMLDependencyException {
1190         final String javaSourceFileContent = "/*\r\n TestImplementsGenerics.java\r\n Creation date : 20 août 2010\r\n */\r\npackage com.plantuml.test;\r\n\r\nimport com.plantuml.train.test.InterfaceGenericsTest;\r\nimport com.plantuml.train.test.Integer;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n *\r\n * @since\r\n * @version\r\n */\r\npublic class TestImplementsGenerics implements InterfaceGenericsTest < Integer > {\r\n\r\n}\r\n";
1191         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
1192                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
1193                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
1194         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY26,
1195                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
1196         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
1197         assertEquals(3, programmingLanguageContext.getParsedAndSeenDependencies().size());
1198         assertNotNull(programmingLanguageContext
1199                 .getParsedOrSeenDependency("com.plantuml.train.test.InterfaceGenericsTest"));
1200         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.train.test.Integer"));
1201         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY26.getFullName()));
1202         assertEquals(InterfaceDependencyTypeImpl.class,
1203                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.train.test.InterfaceGenericsTest")
1204                         .getDependencyType().getClass());
1205         assertEquals(StubDependencyTypeImpl.class,
1206                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.train.test.Integer")
1207                         .getDependencyType().getClass());
1208     }
1209 
1210     /**
1211      * Test method for
1212      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
1213      * .
1214      *
1215      * @throws PlantUMLDependencyException
1216      */
1217     @Test
1218     public void testReadDependencyFromFileClassWithImplementsGenericsNotInImportWithStandardEmptyContextAndDefaultDisplaySet()
1219             throws PlantUMLDependencyException {
1220         final String javaSourceFileContent = "/*\r\n TestImplementsGenerics.java\r\n Creation date : 20 août 2010\r\n */\r\npackage com.plantuml.test;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n *\r\n * @since\r\n * @version\r\n */\r\npublic class TestImplementsGenerics implements InterfaceGenericsTest < Integer > {\r\n\r\n}\r\n";
1221         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
1222                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
1223                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
1224         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY14,
1225                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
1226         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
1227         assertEquals(2, programmingLanguageContext.getParsedAndSeenDependencies().size());
1228         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.InterfaceGenericsTest"));
1229         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY14.getFullName()));
1230         assertEquals(InterfaceDependencyTypeImpl.class,
1231                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.InterfaceGenericsTest")
1232                         .getDependencyType().getClass());
1233     }
1234 
1235     /**
1236      * Test method for
1237      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
1238      * .
1239      *
1240      * @throws PlantUMLDependencyException
1241      */
1242     @Test
1243     public void testReadDependencyFromFileClassWithImplementsInImportFullPackageNameWithStandardEmptyContextAndDefaultDisplaySet()
1244             throws PlantUMLDependencyException {
1245         final String javaSourceFileContent = "/*\r\n TestImplements.java\r\n Creation date : 20 août 2010\r\n */\r\npackage com.plantuml.test;\r\n\r\nimport com.plantuml.train.test.AnotherInterfaceTest;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n *\r\n * @since\r\n * @version\r\n */\r\npublic class TestImplements implements com.plantuml.train.test.AnotherInterfaceTest {\r\n\r\n}\r\n";
1246         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
1247                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
1248                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
1249         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY18,
1250                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
1251         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
1252         assertEquals(2, programmingLanguageContext.getParsedAndSeenDependencies().size());
1253         assertNotNull(programmingLanguageContext
1254                 .getParsedOrSeenDependency("com.plantuml.train.test.AnotherInterfaceTest"));
1255         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY18.getFullName()));
1256         assertEquals(InterfaceDependencyTypeImpl.class,
1257                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.train.test.AnotherInterfaceTest")
1258                         .getDependencyType().getClass());
1259     }
1260 
1261     /**
1262      * Test method for
1263      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
1264      * .
1265      *
1266      * @throws PlantUMLDependencyException
1267      */
1268     @Test
1269     public void testReadDependencyFromFileClassWithImplementsInImportWithStandardEmptyContextAndDefaultDisplaySet()
1270             throws PlantUMLDependencyException {
1271         final String javaSourceFileContent = "/*\r\n TestImplements.java\r\n Creation date : 20 août 2010\r\n */\r\npackage com.plantuml.test;\r\n\r\nimport net.sourceforge.plantumldependency.commoncli.program.JavaProgram;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n *\r\n * @since\r\n * @version\r\n */\r\npublic class TestImplements implements net.sourceforge.plantumldependency.commoncli.program.JavaProgram {\r\n\r\n}\r\n";
1272         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
1273                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
1274                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
1275         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY24,
1276                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
1277         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
1278         assertEquals(2, programmingLanguageContext.getParsedAndSeenDependencies().size());
1279         assertNotNull(programmingLanguageContext
1280                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.commoncli.program.JavaProgram"));
1281         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY24.getFullName()));
1282         assertEquals(
1283                 InterfaceDependencyTypeImpl.class,
1284                 programmingLanguageContext
1285                         .getParsedOrSeenDependency("net.sourceforge.plantumldependency.commoncli.program.JavaProgram")
1286                         .getDependencyType().getClass());
1287     }
1288 
1289     /**
1290      * Test method for
1291      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
1292      * .
1293      *
1294      * @throws PlantUMLDependencyException
1295      */
1296     @Test
1297     public void testReadDependencyFromFileClassWithImplementsNotInImportFullPackageNameWithStandardEmptyContextAndDefaultDisplaySet()
1298             throws PlantUMLDependencyException {
1299         final String javaSourceFileContent = "/*\r\n TestImplements.java\r\n Creation date : 20 août 2010\r\n */\r\npackage com.plantuml.test;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n *\r\n * @since\r\n * @version\r\n */\r\npublic class TestImplements implements net.sourceforge.plantumldependency.commoncli.program.JavaProgram {\r\n\r\n}\r\n";
1300         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
1301                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
1302                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
1303         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY22,
1304                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
1305         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
1306         assertEquals(2, programmingLanguageContext.getParsedAndSeenDependencies().size());
1307         assertNotNull(programmingLanguageContext
1308                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.commoncli.program.JavaProgram"));
1309         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY22.getFullName()));
1310         assertEquals(
1311                 InterfaceDependencyTypeImpl.class,
1312                 programmingLanguageContext
1313                         .getParsedOrSeenDependency("net.sourceforge.plantumldependency.commoncli.program.JavaProgram")
1314                         .getDependencyType().getClass());
1315     }
1316 
1317     /**
1318      * Test method for
1319      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
1320      * .
1321      *
1322      * @throws PlantUMLDependencyException
1323      */
1324     @Test
1325     public void testReadDependencyFromFileClassWithImplementsNotInImportJavaLangWithStandardEmptyContextAndDefaultDisplaySet()
1326             throws PlantUMLDependencyException {
1327         final String javaSourceFileContent = "/*\r\n TestImplements.java\r\n Creation date : 20 août 2010\r\n */\r\npackage com.plantuml.test;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n *\r\n * @since\r\n * @version\r\n */\r\npublic class TestImplements implements Appendable {\r\n\r\n}\r\n";
1328         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
1329                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
1330                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
1331         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY20,
1332                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
1333         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
1334         assertEquals(2, programmingLanguageContext.getParsedAndSeenDependencies().size());
1335         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.Appendable"));
1336         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY20.getFullName()));
1337         assertEquals(InterfaceDependencyTypeImpl.class,
1338                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.Appendable")
1339                         .getDependencyType().getClass());
1340     }
1341 
1342     /**
1343      * Test method for
1344      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
1345      * .
1346      *
1347      * @throws PlantUMLDependencyException
1348      */
1349     @Test
1350     public void testReadDependencyFromFileClassWithImplementsNotInImportNotJavaLangWithStandardEmptyContextAndDefaultDisplaySet()
1351             throws PlantUMLDependencyException {
1352         final String javaSourceFileContent = "/*\r\n TestImplements.java\r\n Creation date : 20 août 2010\r\n */\r\npackage com.plantuml.test;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n *\r\n * @since\r\n * @version\r\n */\r\npublic class TestImplements implements InterfaceTest {\r\n\r\n}\r\n";
1353         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
1354                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
1355                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
1356         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY13,
1357                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
1358         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
1359         assertEquals(2, programmingLanguageContext.getParsedAndSeenDependencies().size());
1360         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.InterfaceTest"));
1361         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY13.getFullName()));
1362         assertEquals(InterfaceDependencyTypeImpl.class,
1363                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.InterfaceTest")
1364                         .getDependencyType().getClass());
1365     }
1366 
1367     /**
1368      * Test method for
1369      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
1370      * .
1371      *
1372      * @throws PlantUMLDependencyException
1373      */
1374     @Test
1375     public void testReadDependencyFromFileClassWithInferiorCharInCodeAndDefaultDisplaySet()
1376             throws PlantUMLDependencyException {
1377         final String javaSourceFileContent = "package com.plantuml.test;\r\n\r\nimport net.sourceforge.plantumldependency.commoncli.program.JavaProgram;\r\n\r\npublic class TestImplements<E extends Enum<E>> implements JavaProgram {\r\n\r\n    public static final int ANNOTATION = 0 < 1 ? 12 : 13;\r\n\r\n\tprotected synchronized native int test();\r\n\r\n  static {if (c == '\\'' || c = '\\\\' || c == '\"' || c == \"\\\\\" || c == '\"') {int i = 0;}} \r\n\r\n /**\r\n   * ' {@inheritDoc}\r\n     * @since 1.3.0\r\n     * tests >\r\n     */\r\n    public int compareTo(JavaProgram o) {\r\n\t\treturn 0;\r\n    }\r\n}\r\n";
1378         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
1379                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
1380                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
1381         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY40,
1382                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
1383         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
1384         assertEquals(3, programmingLanguageContext.getParsedAndSeenDependencies().size());
1385         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(NATIVE_DEPENDENCY.getFullName()));
1386         assertNotNull(programmingLanguageContext
1387                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.commoncli.program.JavaProgram"));
1388         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY40.getFullName()));
1389         assertEquals(
1390                 InterfaceDependencyTypeImpl.class,
1391                 programmingLanguageContext
1392                         .getParsedOrSeenDependency("net.sourceforge.plantumldependency.commoncli.program.JavaProgram")
1393                         .getDependencyType().getClass());
1394     }
1395 
1396     /**
1397      * Test method for
1398      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
1399      * .
1400      *
1401      * @throws PlantUMLDependencyException
1402      */
1403     @Test
1404     public void testReadDependencyFromFileClassWithInnerCLassAndDefaultDisplaySet() throws PlantUMLDependencyException {
1405         final String javaSourceFileContent = "/*\r\n TestExtendsGeneric.java\r\n Creation date : 20 août 2010\r\n */\r\npackage com.plantuml.test;\r\n\r\nimport com.plantuml.train.test.AnotherTestExtends;\r\nimport com.plantuml.train.test.TestExtendsGeneric;\r\nimport com.plantuml.train.test.TestExtendsGeneric.InnerTest;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n *\r\n * @since\r\n * @version\r\n */\r\npublic class TestExtendsWithGeneric extends TestExtendsGeneric < AnotherTestExtends > {\r\n\r\n}\r\n";
1406         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
1407                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
1408                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
1409         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY38,
1410                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
1411         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
1412         assertEquals(4, programmingLanguageContext.getParsedAndSeenDependencies().size());
1413         assertNotNull(programmingLanguageContext
1414                 .getParsedOrSeenDependency("com.plantuml.train.test.AnotherTestExtends"));
1415         assertNotNull(programmingLanguageContext
1416                 .getParsedOrSeenDependency("com.plantuml.train.test.TestExtendsGeneric"));
1417         assertNotNull(programmingLanguageContext
1418                 .getParsedOrSeenDependency("com.plantuml.train.test.TestExtendsGeneric.InnerTest"));
1419         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY12.getFullName()));
1420         assertEquals(StubDependencyTypeImpl.class,
1421                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.train.test.AnotherTestExtends")
1422                         .getDependencyType().getClass());
1423         assertEquals(ClassDependencyTypeImpl.class,
1424                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.train.test.TestExtendsGeneric")
1425                         .getDependencyType().getClass());
1426         assertEquals(
1427                 StubDependencyTypeImpl.class,
1428                 programmingLanguageContext
1429                         .getParsedOrSeenDependency("com.plantuml.train.test.TestExtendsGeneric.InnerTest")
1430                         .getDependencyType().getClass());
1431     }
1432 
1433     /**
1434      * Test method for
1435      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
1436      * .
1437      *
1438      * @throws PlantUMLDependencyException
1439      */
1440     @Test
1441     public void testReadDependencyFromFileClassWithMultipleImplementsAndExtendsGenericsWithStandardEmptyContextAndDefaultDisplaySet()
1442             throws PlantUMLDependencyException {
1443         final String javaSourceFileContent = "/*\r\n TestMultipleImplementsGeneric.java\r\n Creation date : 20 août 2010\r\n */\r\npackage com.plantuml.test;\r\n\r\nimport com.plantuml.train.test.AnotherInterfaceTest;\r\nimport com.plantuml.train.test.AnotherTestExtends;\r\nimport com.plantuml.train.test.TestExtendsGeneric;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n *\r\n * @since\r\n * @version\r\n */\r\nclass TestMultipleImplementsAndExtendsGeneric extends TestExtendsGeneric < AnotherTestExtends > implements Cloneable, InterfaceGenericsTest < Integer >, InterfaceTest, AnotherInterfaceTest < CharacterConstants, java.test.Test > {\r\n\r\n}\r\n";
1444         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
1445                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
1446                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
1447         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY17,
1448                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
1449         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
1450         assertEquals(7, programmingLanguageContext.getParsedAndSeenDependencies().size());
1451         assertNotNull(programmingLanguageContext
1452                 .getParsedOrSeenDependency("com.plantuml.train.test.AnotherInterfaceTest"));
1453         assertNotNull(programmingLanguageContext
1454                 .getParsedOrSeenDependency("com.plantuml.train.test.AnotherTestExtends"));
1455         assertNotNull(programmingLanguageContext
1456                 .getParsedOrSeenDependency("com.plantuml.train.test.TestExtendsGeneric"));
1457         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.Cloneable"));
1458         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.InterfaceGenericsTest"));
1459         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.InterfaceTest"));
1460         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY17.getFullName()));
1461         assertEquals(InterfaceDependencyTypeImpl.class,
1462                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.train.test.AnotherInterfaceTest")
1463                         .getDependencyType().getClass());
1464         assertEquals(StubDependencyTypeImpl.class,
1465                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.train.test.AnotherTestExtends")
1466                         .getDependencyType().getClass());
1467         assertEquals(ClassDependencyTypeImpl.class,
1468                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.train.test.TestExtendsGeneric")
1469                         .getDependencyType().getClass());
1470         assertEquals(InterfaceDependencyTypeImpl.class,
1471                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.Cloneable").getDependencyType()
1472                         .getClass());
1473         assertEquals(InterfaceDependencyTypeImpl.class,
1474                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.InterfaceGenericsTest")
1475                         .getDependencyType().getClass());
1476         assertEquals(InterfaceDependencyTypeImpl.class,
1477                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.InterfaceTest")
1478                         .getDependencyType().getClass());
1479     }
1480 
1481     /**
1482      * Test method for
1483      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
1484      * .
1485      *
1486      * @throws PlantUMLDependencyException
1487      */
1488     @Test
1489     public void testReadDependencyFromFileClassWithMultipleImplementsGenericsWithStandardEmptyContextAndDefaultDisplaySet()
1490             throws PlantUMLDependencyException {
1491         final String javaSourceFileContent = "/*\r\n TestMultipleImplementsGeneric.java\r\n Creation date : 20 août 2010\r\n */\r\npackage com.plantuml.test;\r\n\r\nimport com.plantuml.train.test.AnotherInterfaceTest;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n *\r\n * @since\r\n * @version\r\n */\r\npublic class TestMultipleImplementsGeneric implements Cloneable, InterfaceGenericsTest < Integer >, InterfaceTest, AnotherInterfaceTest {\r\n\r\n}\r\n";
1492         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
1493                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
1494                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
1495         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY16,
1496                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
1497         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
1498         assertEquals(5, programmingLanguageContext.getParsedAndSeenDependencies().size());
1499         assertNotNull(programmingLanguageContext
1500                 .getParsedOrSeenDependency("com.plantuml.train.test.AnotherInterfaceTest"));
1501         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.Cloneable"));
1502         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.InterfaceGenericsTest"));
1503         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.InterfaceTest"));
1504         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY16.getFullName()));
1505         assertEquals(InterfaceDependencyTypeImpl.class,
1506                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.train.test.AnotherInterfaceTest")
1507                         .getDependencyType().getClass());
1508         assertEquals(InterfaceDependencyTypeImpl.class,
1509                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.Cloneable").getDependencyType()
1510                         .getClass());
1511         assertEquals(InterfaceDependencyTypeImpl.class,
1512                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.InterfaceGenericsTest")
1513                         .getDependencyType().getClass());
1514         assertEquals(InterfaceDependencyTypeImpl.class,
1515                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.InterfaceTest")
1516                         .getDependencyType().getClass());
1517     }
1518 
1519     /**
1520      * Test method for
1521      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
1522      * .
1523      *
1524      * @throws PlantUMLDependencyException
1525      */
1526     @Test
1527     public void testReadDependencyFromFileClassWithNativeMethodAndDefaultDisplaySet()
1528             throws PlantUMLDependencyException {
1529         final String javaSourceFileContent = "/*\r\n TestImplements.java\r\n Creation date : 20 août 2010\r\n */\r\npackage com.plantuml.test;\r\n\r\nimport net.sourceforge.plantumldependency.commoncli.program.JavaProgram;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n *\r\n * @since\r\n * @version\r\n */\r\npublic class TestImplements implements net.sourceforge.plantumldependency.commoncli.program.JavaProgram {\r\nstatic native    String   testNative   (    )    ;\r\n}\r\n";
1530         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
1531                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
1532                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
1533         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY40,
1534                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
1535         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
1536         assertEquals(3, programmingLanguageContext.getParsedAndSeenDependencies().size());
1537         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(NATIVE_DEPENDENCY.getFullName()));
1538         assertNotNull(programmingLanguageContext
1539                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.commoncli.program.JavaProgram"));
1540         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY40.getFullName()));
1541         assertEquals(
1542                 InterfaceDependencyTypeImpl.class,
1543                 programmingLanguageContext
1544                         .getParsedOrSeenDependency("net.sourceforge.plantumldependency.commoncli.program.JavaProgram")
1545                         .getDependencyType().getClass());
1546     }
1547 
1548     /**
1549      * Test method for
1550      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
1551      * .
1552      *
1553      * @throws PlantUMLDependencyException
1554      */
1555     @Test
1556     public void testReadDependencyFromFileClassWithoutPackageWithStandardEmptyContextAndDefaultDisplaySet()
1557             throws PlantUMLDependencyException {
1558         final String javaSourceFileContent = "/*\r\n Test.java\r\n Creation date : 20 août 2010\r\n */\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n * \r\n * @since\r\n * @version\r\n */\r\npublic class Test {\r\n\r\n}\r\n";
1559         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
1560                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
1561                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
1562         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY7,
1563                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
1564         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
1565         assertEquals(1, programmingLanguageContext.getParsedAndSeenDependencies().size());
1566         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY7.getFullName()));
1567     }
1568 
1569     /**
1570      * Test method for
1571      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
1572      * .
1573      *
1574      * @throws PlantUMLDependencyException
1575      */
1576     @Test
1577     public void testReadDependencyFromFileClassWithStandardEmptyContextAndDefaultDisplaySet()
1578             throws PlantUMLDependencyException {
1579         final String javaSourceFileContent = "/*\r\n Test.java\r\n Creation date : 20 août 2010\r\n */\r\npackage com.plantuml.test;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n *\r\n * @since\r\n * @version\r\n */\r\nclass Test {\r\n\r\n}";
1580         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
1581                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
1582                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
1583         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY6,
1584                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
1585         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
1586         assertEquals(1, programmingLanguageContext.getParsedAndSeenDependencies().size());
1587         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY6.getFullName()));
1588     }
1589 
1590     /**
1591      * Test method for
1592      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
1593      * .
1594      *
1595      * @throws PlantUMLDependencyException
1596      */
1597     @Test
1598     public void testReadDependencyFromFileClassWithStandardEmptyContextAndInterfaceDisplaySet()
1599             throws PlantUMLDependencyException {
1600         final String javaSourceFileContent = "/*\r\n Test.java\r\n Creation date : 20 août 2010\r\n */\r\npackage com.plantuml.test;\r\n\r\nimport com.plantuml.train.test.AnotherTestExtends;\r\n/**\r\n * @author Benjamin Croizet\r\n *\r\n * @since\r\n * @version\r\n */\r\npublic class Test < AnotherTestExtends > {\r\n\r\n}\r\n";
1601         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
1602                 DISPLAY_TYPE_SET9, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN, DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
1603         assertEquals(GENERIC_DEPENDENCY10,
1604                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
1605         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
1606         assertEquals(2, programmingLanguageContext.getParsedAndSeenDependencies().size());
1607         assertNotNull(programmingLanguageContext
1608                 .getParsedOrSeenDependency("com.plantuml.train.test.AnotherTestExtends"));
1609         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY10.getFullName()));
1610         assertEquals(StubDependencyTypeImpl.class,
1611                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.train.test.AnotherTestExtends")
1612                         .getDependencyType().getClass());
1613     }
1614 
1615     /**
1616      * Test method for
1617      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
1618      * .
1619      *
1620      * @throws PlantUMLDependencyException
1621      */
1622     @Test
1623     public void testReadDependencyFromFileClassWithStaticImportWithStandardEmptyContextAndDefaultDisplaySet()
1624             throws PlantUMLDependencyException {
1625         final String javaSourceFileContent = "/*\r\n TestImplements.java\r\n Creation date : 20 août 2010\r\n */\r\npackage com.plantuml.test;\r\n\r\nimport static net.sourceforge.plantumldependency.commoncli.program.JavaProgram.test;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n *\r\n * @since\r\n * @version\r\n */\r\npublic class TestImplements {\r\n}\r\n";
1626         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
1627                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
1628                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
1629         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY42,
1630                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
1631         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
1632         assertEquals(2, programmingLanguageContext.getParsedAndSeenDependencies().size());
1633         assertNotNull(programmingLanguageContext
1634                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.commoncli.program.JavaProgram"));
1635         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY42.getFullName()));
1636         assertEquals(
1637                 StubDependencyTypeImpl.class,
1638                 programmingLanguageContext
1639                         .getParsedOrSeenDependency("net.sourceforge.plantumldependency.commoncli.program.JavaProgram")
1640                         .getDependencyType().getClass());
1641     }
1642 
1643     /**
1644      * Test method for
1645      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
1646      * .
1647      *
1648      * @throws PlantUMLDependencyException
1649      */
1650     @Test
1651     public void testReadDependencyFromFileClassWithStringContainingKeyWords() throws PlantUMLDependencyException {
1652         final String javaSourceFileContent = "/*\n Test.java\n Creation date : 20 août 2010\n */\npackage com.plantuml.test;\n\n/**\n * @author Benjamin Croizet\n * \n * @since\n * @version\n */\nclass Test {\n    public String test() {\n        final String javaSourceFileContent = \"package com.plantuml.test;import com.plantuml.train.test.AnotherInterfaceTest;public class TestImplements implements com.plantuml.train.test.AnotherInterfaceTest {}\";\n        return javaSourceFileContent;\n    }\n\n    // import java.lang.Comparable\n\n    public String toto() {\n        final String packageTest = \"import java.lang\" \n    + \".Object;private static native void registerNatives();\";\n        final String javaSourceFileContent = \"/*\\n Test.java\\n Creation date : 20 août 2010\\n */\\npackage com.plantuml.test;\\n\\n/**\\n * @author Benjamin Croizet\\n * \\n * @since\\n * @version\\n */\\nclass Test {\\n    public String test() {\\n        final String javaSourceFileContent = \\\"package com.plantuml.test;import com.plantuml.train.test.AnotherInterfaceTest;public class TestImplements implements com.plantuml.train.test.AnotherInterfaceTest {}\\\";\\n        return javaSourceFileContent;\\n    }\\n\\n    // import java.lang.Comparable\\n\\n    public String toto() {\\n        final String packageTest = \\\"import java.lang\\\" \\n    + \\\".Object;\\nprivate static native void\\nregisterNatives\\n();\\\";\\n        return packageTest;\\n    }\\n}\";\n        return packageTest;\n    }\n}";
1653         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
1654                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
1655                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
1656         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY6,
1657                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
1658         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
1659         assertEquals(1, programmingLanguageContext.getParsedAndSeenDependencies().size());
1660         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY6.getFullName()));
1661     }
1662 
1663     /**
1664      * Test method for
1665      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
1666      * .
1667      *
1668      * @throws PlantUMLDependencyException
1669      */
1670     @Test
1671     public void testReadDependencyFromFileClassWithTabsAsSeparatorAndDefaultDisplaySet()
1672             throws PlantUMLDependencyException {
1673         final String javaSourceFileContent = "/*\r\n TestImplements.java\r\n Creation date : 20 août 2010\r\n */\r\npackage com.plantuml.\ttest;\r\n\r\nimport net.sourceforge.plantumldependency.\tcommoncli.program.\tJavaProgram;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n *\r\n * @since\r\n * @version\r\n */\r\npublic class\tTestImplements implements\tnet.sourceforge.plantumldependency.commoncli.program.\tJavaProgram {\r\nprotected synchronized native int\ttest\t();\r\n}\r\n";
1674         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
1675                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
1676                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
1677         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY40,
1678                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
1679         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
1680         assertEquals(3, programmingLanguageContext.getParsedAndSeenDependencies().size());
1681         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(NATIVE_DEPENDENCY.getFullName()));
1682         assertNotNull(programmingLanguageContext
1683                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.commoncli.program.JavaProgram"));
1684         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY40.getFullName()));
1685         assertEquals(
1686                 InterfaceDependencyTypeImpl.class,
1687                 programmingLanguageContext
1688                         .getParsedOrSeenDependency("net.sourceforge.plantumldependency.commoncli.program.JavaProgram")
1689                         .getDependencyType().getClass());
1690     }
1691 
1692     /**
1693      * Test method for
1694      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
1695      * .
1696      *
1697      * @throws PlantUMLDependencyException
1698      */
1699     @Test
1700     public void testReadDependencyFromFileClassWithUnderscoresAndDefaultDisplaySet() throws PlantUMLDependencyException {
1701         final String javaSourceFileContent = "/*\r\n Test_Implements.java\r\n Creation date : 20 août 2010\r\n */\r\npackage com.plantuml.te_st;\r\n\r\nimport net.sourceforge.plantumldependency.commoncli.pro_gram.Java_Program;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n *\r\n * @since\r\n * @version\r\n */\r\npublic class Test_Implements implements net.sourceforge.plantumldependency.commoncli.pro_gram.Java_Program {\r\nprivate static native void register_Natives();\r\n}\r\n";
1702         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
1703                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
1704                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
1705         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY41,
1706                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
1707         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
1708         assertEquals(3, programmingLanguageContext.getParsedAndSeenDependencies().size());
1709         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(NATIVE_DEPENDENCY.getFullName()));
1710         assertNotNull(programmingLanguageContext
1711                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.commoncli.pro_gram.Java_Program"));
1712         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY41.getFullName()));
1713         assertEquals(
1714                 InterfaceDependencyTypeImpl.class,
1715                 programmingLanguageContext
1716                         .getParsedOrSeenDependency("net.sourceforge.plantumldependency.commoncli.pro_gram.Java_Program")
1717                         .getDependencyType().getClass());
1718     }
1719 
1720     /**
1721      * Test method for
1722      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
1723      * .
1724      *
1725      * @throws PlantUMLDependencyException
1726      */
1727     @Test
1728     public void testReadDependencyFromFileClassWithWildcardImportsAndDefaultDisplaySet()
1729             throws PlantUMLDependencyException {
1730         final String javaSourceFileContent = "/*\r\n Test.java\r\n Creation date : 20 août 2010\r\n */\r\n\r\npackage com.plantuml.test;\r\n\r\nimport com.plantuml.train.test.AnotherTestExtends;\r\nimport com.plantuml.train.test.wildcard.*;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n * \r\n * @since\r\n * @version\r\n */\r\npublic class Test extends AnotherTestExtends {\r\n\r\n}\r\n";
1731         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
1732                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
1733                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
1734         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY10,
1735                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
1736         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
1737         assertEquals(2, programmingLanguageContext.getParsedAndSeenDependencies().size());
1738         assertNotNull(programmingLanguageContext
1739                 .getParsedOrSeenDependency("com.plantuml.train.test.AnotherTestExtends"));
1740         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY10.getFullName()));
1741         assertEquals(ClassDependencyTypeImpl.class,
1742                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.train.test.AnotherTestExtends")
1743                         .getDependencyType().getClass());
1744     }
1745 
1746     /**
1747      * Test method for
1748      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
1749      * .
1750      *
1751      * @throws PlantUMLDependencyException
1752      */
1753     @Test
1754     public void testReadDependencyFromFileEnumWithoutPackageWithStandardEmptyContextAndDefaultDisplaySet()
1755             throws PlantUMLDependencyException {
1756         final String javaSourceFileContent = "public enum TestReadDependencyFromFileEnum {\n\n}\n";
1757         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
1758                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
1759                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
1760         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY48,
1761                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
1762         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
1763         assertEquals(1, programmingLanguageContext.getParsedAndSeenDependencies().size());
1764         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY48.getFullName()));
1765     }
1766 
1767     /**
1768      * Test method for
1769      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
1770      * .
1771      *
1772      * @throws PlantUMLDependencyException
1773      */
1774     @Test
1775     public void testReadDependencyFromFileEnumWithStandardEmptyContextAndAbstractClassDisplaySet()
1776             throws PlantUMLDependencyException {
1777         final String javaSourceFileContent = "public enum TestReadDependencyFromFileEnum {\n\n}\n";
1778         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
1779                 DISPLAY_TYPE_SET3, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN, DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
1780         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY48,
1781                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
1782         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
1783         assertEquals(1, programmingLanguageContext.getParsedAndSeenDependencies().size());
1784         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY48.getFullName()));
1785     }
1786 
1787     /**
1788      * Test method for
1789      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
1790      * .
1791      *
1792      * @throws PlantUMLDependencyException
1793      */
1794     @Test
1795     public void testReadDependencyFromFileEnumWithStandardEmptyContextAndClassDisplaySet()
1796             throws PlantUMLDependencyException {
1797         final String javaSourceFileContent = "public enum TestReadDependencyFromFileEnum {\n\n}\n";
1798         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
1799                 DISPLAY_TYPE_SET4, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN, DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
1800         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY48,
1801                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
1802         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
1803         assertEquals(1, programmingLanguageContext.getParsedAndSeenDependencies().size());
1804         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY48.getFullName()));
1805     }
1806 
1807     /**
1808      * Test method for
1809      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
1810      * .
1811      *
1812      * @throws PlantUMLDependencyException
1813      */
1814     @Test
1815     public void testReadDependencyFromFileEnumWithStandardEmptyContextAndDefaultDisplaySet()
1816             throws PlantUMLDependencyException {
1817         final String javaSourceFileContent = "package net.sourceforge.plantumldependency.main.option.programminglanguage;\n\nenum TestReadDependencyFromFileEnum {\n\n}\n";
1818         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
1819                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
1820                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
1821         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY47,
1822                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
1823         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
1824         assertEquals(1, programmingLanguageContext.getParsedAndSeenDependencies().size());
1825         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY47.getFullName()));
1826     }
1827 
1828     /**
1829      * Test method for
1830      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
1831      * .
1832      *
1833      * @throws PlantUMLDependencyException
1834      */
1835     @Test
1836     public void testReadDependencyFromFileEnumWithStandardEmptyContextAndEnumDisplaySet()
1837             throws PlantUMLDependencyException {
1838         final String javaSourceFileContent = "public enum TestReadDependencyFromFileEnum {\n\n}\n";
1839         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
1840                 DISPLAY_TYPE_SET5, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN, DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
1841         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY48,
1842                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
1843         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
1844         assertEquals(1, programmingLanguageContext.getParsedAndSeenDependencies().size());
1845         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY48.getFullName()));
1846     }
1847 
1848     /**
1849      * Test method for
1850      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
1851      * .
1852      *
1853      * @throws PlantUMLDependencyException
1854      */
1855     @Test
1856     public void testReadDependencyFromFileFinalClassWithStandardEmptyContextAndDefaultDisplaySet()
1857             throws PlantUMLDependencyException {
1858         final String javaSourceFileContent = "/*\r\n Test.java\r\n Creation date : 20 août 2010\r\n */\r\npackage com.plantuml.test;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n *\r\n * @since\r\n * @version\r\n */\r\nfinal class Test {\r\n\r\n}";
1859         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
1860                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
1861                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
1862         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY6,
1863                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
1864         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
1865         assertEquals(1, programmingLanguageContext.getParsedAndSeenDependencies().size());
1866         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY6.getFullName()));
1867     }
1868 
1869     /**
1870      * Test method for
1871      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
1872      * .
1873      *
1874      * @throws PlantUMLDependencyException
1875      */
1876     @Test
1877     public void testReadDependencyFromFileFinalPublicClassWithStandardEmptyContextAndDefaultDisplaySet()
1878             throws PlantUMLDependencyException {
1879         final String javaSourceFileContent = "/*\r\n Test.java\r\n Creation date : 20 août 2010\r\n */\r\npackage com.plantuml.test;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n *\r\n * @since\r\n * @version\r\n */\r\nfinal public class Test {\r\n\r\n}";
1880         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
1881                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
1882                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
1883         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY6,
1884                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
1885         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
1886         assertEquals(1, programmingLanguageContext.getParsedAndSeenDependencies().size());
1887         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY6.getFullName()));
1888     }
1889 
1890     /**
1891      * Test method for
1892      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
1893      * .
1894      *
1895      * @throws PlantUMLDependencyException
1896      */
1897     @Test
1898     public void testReadDependencyFromFileInterfaceGenericNotInImportWithStandardEmptyContextAndDefaultDisplaySet()
1899             throws PlantUMLDependencyException {
1900         final String javaSourceFileContent = "package net.sourceforge.plantumldependency.main.option.programminglanguage;\n\npublic interface TestReadDependencyFromFileInterfaceGenericNotInImport < PlantUMLDependencyBaseDirectoryOptionTest > {\n\n}\n";
1901         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
1902                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
1903                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
1904         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY29,
1905                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
1906         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
1907         assertEquals(1, programmingLanguageContext.getParsedAndSeenDependencies().size());
1908         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY29.getFullName()));
1909     }
1910 
1911     /**
1912      * Test method for
1913      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
1914      * .
1915      *
1916      * @throws PlantUMLDependencyException
1917      */
1918     @Test
1919     public void testReadDependencyFromFileInterfaceWithAnnotationsWithStandardEmptyContextAndDefaultDisplaySet()
1920             throws PlantUMLDependencyException {
1921         final String javaSourceFileContent = "package com.plantuml.test;\r\n\r\nimport java.lang.annotation.ElementType;\r\n\r\nimport javax.xml.bind.annotation.XmlType;\r\nimport javax.xml.ws.soap.Addressing;\r\n\r\n@    Testabstract\r\n@    Deprecated\r\n@    SuppressWarnings(   {  \"deprecation\"  ,  \"unckeked\"  }   )\r\n@    Addressing   (   enabled  =  true   )\r\n@    Annotationinterface\r\n@    AnotherAnnotation ( {  ElementType.CONSTRUCTOR  , ElementType.METHOD   } )\r\n@    MyAnnotation (  tab  =  {  1  ,  2  ,  3  ,  4  ,  5  }  )\r\n@    XmlType   (   propOrder   =   {   \"street\"   ,   \"city\"  ,   \"state\"  ,   \"zip\"   ,   \"@test\"   }  )\r\n@    MappedSuperclass\r\n@ javax.annotation.Generated(value=\"\")\r\ninterface GenericEndpoint {\r\n}\r\n";
1922         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
1923                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
1924                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
1925         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY49,
1926                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
1927         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
1928         assertEquals(12, programmingLanguageContext.getParsedAndSeenDependencies().size());
1929         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.lang.annotation.ElementType"));
1930         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("javax.xml.bind.annotation.XmlType"));
1931         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("javax.xml.ws.soap.Addressing"));
1932         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.Testabstract"));
1933         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.Deprecated"));
1934         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.SuppressWarnings"));
1935         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.Annotationinterface"));
1936         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.AnotherAnnotation"));
1937         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.MyAnnotation"));
1938         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.MappedSuperclass"));
1939         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("javax.annotation.Generated"));
1940         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY49.getFullName()));
1941         assertEquals(StubDependencyTypeImpl.class,
1942                 programmingLanguageContext.getParsedOrSeenDependency("java.lang.annotation.ElementType")
1943                         .getDependencyType().getClass());
1944         assertEquals(AnnotationDependencyTypeImpl.class,
1945                 programmingLanguageContext.getParsedOrSeenDependency("javax.xml.bind.annotation.XmlType")
1946                         .getDependencyType().getClass());
1947         assertEquals(AnnotationDependencyTypeImpl.class,
1948                 programmingLanguageContext.getParsedOrSeenDependency("javax.xml.ws.soap.Addressing")
1949                         .getDependencyType().getClass());
1950         assertEquals(AnnotationDependencyTypeImpl.class,
1951                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.Testabstract")
1952                         .getDependencyType().getClass());
1953         assertEquals(AnnotationDependencyTypeImpl.class,
1954                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.Deprecated")
1955                         .getDependencyType().getClass());
1956         assertEquals(AnnotationDependencyTypeImpl.class,
1957                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.SuppressWarnings")
1958                         .getDependencyType().getClass());
1959         assertEquals(AnnotationDependencyTypeImpl.class,
1960                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.Annotationinterface")
1961                         .getDependencyType().getClass());
1962         assertEquals(AnnotationDependencyTypeImpl.class,
1963                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.AnotherAnnotation")
1964                         .getDependencyType().getClass());
1965         assertEquals(AnnotationDependencyTypeImpl.class,
1966                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.MyAnnotation")
1967                         .getDependencyType().getClass());
1968         assertEquals(AnnotationDependencyTypeImpl.class,
1969                 programmingLanguageContext.getParsedOrSeenDependency("com.plantuml.test.MappedSuperclass")
1970                         .getDependencyType().getClass());
1971         assertEquals(AnnotationDependencyTypeImpl.class,
1972                 programmingLanguageContext.getParsedOrSeenDependency("javax.annotation.Generated").getDependencyType()
1973                         .getClass());
1974     }
1975 
1976     /**
1977      * Test method for
1978      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
1979      * .
1980      *
1981      * @throws PlantUMLDependencyException
1982      */
1983     @Test
1984     public void testReadDependencyFromFileInterfaceWithCommentsAsSeparatorAndDefaultDisplaySet()
1985             throws PlantUMLDependencyException {
1986         final String javaSourceFileContent = "package net.sourceforge.plantumldependency.main.option.programminglanguage;\n\n//Hello interface ! my name is brian\r\npublic/*@bgen(jjtree)*/interface/*@bgen(jjtree)*/TestReadDependencyFromFileInterfaceWithExtendsNotInImportNotJavaLang extends/**@bgen(jjtree)**/TestReadDependencyFromFileInterfaceWithoutPackage {\n\n}\n";
1987         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
1988                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
1989                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
1990         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY35,
1991                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
1992         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
1993         assertEquals(2, programmingLanguageContext.getParsedAndSeenDependencies().size());
1994         assertNotNull(programmingLanguageContext
1995                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.main.option.programminglanguage.TestReadDependencyFromFileInterfaceWithoutPackage"));
1996         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY35.getFullName()));
1997         assertEquals(
1998                 InterfaceDependencyTypeImpl.class,
1999                 programmingLanguageContext
2000                         .getParsedOrSeenDependency(
2001                                 "net.sourceforge.plantumldependency.main.option.programminglanguage.TestReadDependencyFromFileInterfaceWithoutPackage")
2002                         .getDependencyType().getClass());
2003     }
2004 
2005     /**
2006      * Test method for
2007      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
2008      * .
2009      *
2010      * @throws PlantUMLDependencyException
2011      */
2012     @Test
2013     public void testReadDependencyFromFileInterfaceWithExtendsGenericsInImportWithStandardEmptyContextAndDefaultDisplaySet()
2014             throws PlantUMLDependencyException {
2015         final String javaSourceFileContent = "package net.sourceforge.plantumldependency.main.option.programminglanguage;\n\nimport net.sourceforge.mazix.components.clone.DeepCloneable;\nimport net.sourceforge.plantumldependency.main.option.programminglanguage.argument.CppProgrammingLanguageTest;\n\npublic interface TestReadDependencyFromFileInterfaceWithExtendsGenericsInImport extends DeepCloneable < CppProgrammingLanguageTest > {\n\n}\n";
2016         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
2017                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
2018                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
2019         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY30,
2020                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
2021         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
2022         assertEquals(3, programmingLanguageContext.getParsedAndSeenDependencies().size());
2023         assertNotNull(programmingLanguageContext
2024                 .getParsedOrSeenDependency("net.sourceforge.mazix.components.clone.DeepCloneable"));
2025         assertNotNull(programmingLanguageContext
2026                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.main.option.programminglanguage.argument.CppProgrammingLanguageTest"));
2027         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY30.getFullName()));
2028         assertEquals(
2029                 InterfaceDependencyTypeImpl.class,
2030                 programmingLanguageContext
2031                         .getParsedOrSeenDependency("net.sourceforge.mazix.components.clone.DeepCloneable")
2032                         .getDependencyType().getClass());
2033         assertEquals(
2034                 StubDependencyTypeImpl.class,
2035                 programmingLanguageContext
2036                         .getParsedOrSeenDependency(
2037                                 "net.sourceforge.plantumldependency.main.option.programminglanguage.argument.CppProgrammingLanguageTest")
2038                         .getDependencyType().getClass());
2039     }
2040 
2041     /**
2042      * Test method for
2043      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
2044      * .
2045      *
2046      * @throws PlantUMLDependencyException
2047      */
2048     @Test
2049     public void testReadDependencyFromFileInterfaceWithExtendsGenericsNotInImportWithStandardEmptyContextAndDefaultDisplaySet()
2050             throws PlantUMLDependencyException {
2051         final String javaSourceFileContent = "package net.sourceforge.plantumldependency.main.option.programminglanguage;\n\nimport net.sourceforge.mazix.components.clone.DeepCloneable;\n\npublic interface TestReadDependencyFromFileInterfaceWithExtendsGenericsNotInImport extends DeepCloneable < Integer > {\n\n}\n";
2052         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
2053                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
2054                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
2055         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY31,
2056                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
2057         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
2058         assertEquals(2, programmingLanguageContext.getParsedAndSeenDependencies().size());
2059         assertNotNull(programmingLanguageContext
2060                 .getParsedOrSeenDependency("net.sourceforge.mazix.components.clone.DeepCloneable"));
2061         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY31.getFullName()));
2062         assertEquals(
2063                 InterfaceDependencyTypeImpl.class,
2064                 programmingLanguageContext
2065                         .getParsedOrSeenDependency("net.sourceforge.mazix.components.clone.DeepCloneable")
2066                         .getDependencyType().getClass());
2067     }
2068 
2069     /**
2070      * Test method for
2071      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
2072      * .
2073      *
2074      * @throws PlantUMLDependencyException
2075      */
2076     @Test
2077     public void testReadDependencyFromFileInterfaceWithExtendsInImportFullPackageNameWithStandardEmptyContextAndDefaultDisplaySet()
2078             throws PlantUMLDependencyException {
2079         final String javaSourceFileContent = "package net.sourceforge.plantumldependency.main.option.programminglanguage;\n\nimport net.sourceforge.plantumldependency.generic.GenericDependency;\n\npublic interface TestReadDependencyFromFileInterfaceWithExtendsInImport extends net.sourceforge.plantumldependency.generic.GenericDependency {\n\n}\n";
2080         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
2081                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
2082                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
2083         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY32,
2084                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
2085         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
2086         assertEquals(2, programmingLanguageContext.getParsedAndSeenDependencies().size());
2087         assertNotNull(programmingLanguageContext
2088                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.generic.GenericDependency"));
2089         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY32.getFullName()));
2090         assertEquals(
2091                 InterfaceDependencyTypeImpl.class,
2092                 programmingLanguageContext
2093                         .getParsedOrSeenDependency("net.sourceforge.plantumldependency.generic.GenericDependency")
2094                         .getDependencyType().getClass());
2095     }
2096 
2097     /**
2098      * Test method for
2099      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
2100      * .
2101      *
2102      * @throws PlantUMLDependencyException
2103      */
2104     @Test
2105     public void testReadDependencyFromFileInterfaceWithExtendsInImportWithStandardEmptyContextAndDefaultDisplaySet()
2106             throws PlantUMLDependencyException {
2107         final String javaSourceFileContent = "package net.sourceforge.plantumldependency.main.option.programminglanguage;\n\nimport net.sourceforge.plantumldependency.generic.GenericDependency;\n\npublic interface TestReadDependencyFromFileInterfaceWithExtendsInImport extends GenericDependency {\n\n}\n";
2108         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
2109                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
2110                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
2111         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY32,
2112                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
2113         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
2114         assertEquals(2, programmingLanguageContext.getParsedAndSeenDependencies().size());
2115         assertNotNull(programmingLanguageContext
2116                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.generic.GenericDependency"));
2117         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY32.getFullName()));
2118         assertEquals(
2119                 InterfaceDependencyTypeImpl.class,
2120                 programmingLanguageContext
2121                         .getParsedOrSeenDependency("net.sourceforge.plantumldependency.generic.GenericDependency")
2122                         .getDependencyType().getClass());
2123     }
2124 
2125     /**
2126      * Test method for
2127      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
2128      * .
2129      *
2130      * @throws PlantUMLDependencyException
2131      */
2132     @Test
2133     public void testReadDependencyFromFileInterfaceWithExtendsNotInImportFullPackageNameWithStandardEmptyContextAndDefaultDisplaySet()
2134             throws PlantUMLDependencyException {
2135         final String javaSourceFileContent = "package net.sourceforge.plantumldependency.main.option.programminglanguage;\n\npublic interface TestReadDependencyFromFileInterfaceWithExtendsNotInImportFullPackageName extends net.sourceforge.plantumldependency.generic.GenericDependency {\n\n}\n";
2136         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
2137                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
2138                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
2139         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY33,
2140                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
2141         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
2142         assertEquals(2, programmingLanguageContext.getParsedAndSeenDependencies().size());
2143         assertNotNull(programmingLanguageContext
2144                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.generic.GenericDependency"));
2145         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY33.getFullName()));
2146         assertEquals(
2147                 InterfaceDependencyTypeImpl.class,
2148                 programmingLanguageContext
2149                         .getParsedOrSeenDependency("net.sourceforge.plantumldependency.generic.GenericDependency")
2150                         .getDependencyType().getClass());
2151     }
2152 
2153     /**
2154      * Test method for
2155      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
2156      * .
2157      *
2158      * @throws PlantUMLDependencyException
2159      */
2160     @Test
2161     public void testReadDependencyFromFileInterfaceWithExtendsNotInImportJavaLangWithStandardEmptyContextAndDefaultDisplaySet()
2162             throws PlantUMLDependencyException {
2163         final String javaSourceFileContent = "package net.sourceforge.plantumldependency.main.option.programminglanguage;\n\npublic interface TestReadDependencyFromFileInterfaceWithExtendsNotInImportJavaLang extends Comparable {\n\n}\n";
2164         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
2165                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
2166                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
2167         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY34,
2168                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
2169         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
2170         assertEquals(2, programmingLanguageContext.getParsedAndSeenDependencies().size());
2171         assertNotNull(programmingLanguageContext
2172                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.main.option.programminglanguage.Comparable"));
2173         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY34.getFullName()));
2174         assertEquals(
2175                 InterfaceDependencyTypeImpl.class,
2176                 programmingLanguageContext
2177                         .getParsedOrSeenDependency(
2178                                 "net.sourceforge.plantumldependency.main.option.programminglanguage.Comparable")
2179                         .getDependencyType().getClass());
2180     }
2181 
2182     /**
2183      * Test method for
2184      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
2185      * .
2186      *
2187      * @throws PlantUMLDependencyException
2188      */
2189     @Test
2190     public void testReadDependencyFromFileInterfaceWithExtendsNotInImportNotJavaLangWithStandardEmptyContextAndDefaultDisplaySet()
2191             throws PlantUMLDependencyException {
2192         final String javaSourceFileContent = "package net.sourceforge.plantumldependency.main.option.programminglanguage;\n\npublic interface TestReadDependencyFromFileInterfaceWithExtendsNotInImportNotJavaLang extends TestReadDependencyFromFileInterfaceWithoutPackage {\n\n}\n";
2193         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
2194                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
2195                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
2196         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY35,
2197                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
2198         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
2199         assertEquals(2, programmingLanguageContext.getParsedAndSeenDependencies().size());
2200         assertNotNull(programmingLanguageContext
2201                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.main.option.programminglanguage.TestReadDependencyFromFileInterfaceWithoutPackage"));
2202         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY35.getFullName()));
2203         assertEquals(
2204                 InterfaceDependencyTypeImpl.class,
2205                 programmingLanguageContext
2206                         .getParsedOrSeenDependency(
2207                                 "net.sourceforge.plantumldependency.main.option.programminglanguage.TestReadDependencyFromFileInterfaceWithoutPackage")
2208                         .getDependencyType().getClass());
2209     }
2210 
2211     /**
2212      * Test method for
2213      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
2214      * .
2215      *
2216      * @throws PlantUMLDependencyException
2217      */
2218     @Test
2219     public void testReadDependencyFromFileInterfaceWithGenericDefinitionAndDefaultDisplaySet()
2220             throws PlantUMLDependencyException {
2221         final String javaSourceFileContent = "package net.sourceforge.plantumldependency.main.option.programminglanguage;\n\nimport net.sourceforge.mazix.components.clone.DeepCloneable;\nimport net.sourceforge.plantumldependency.main.option.programminglanguage.argument.CppProgrammingLanguageTest;\n\npublic interface TestReadDependencyFromFileInterfaceWithExtendsGenericsInImport < A extends CppProgrammingLanguageTest > extends DeepCloneable < CppProgrammingLanguageTest > {\n\n}\n";
2222         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
2223                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
2224                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
2225         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY30,
2226                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
2227         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
2228         assertEquals(3, programmingLanguageContext.getParsedAndSeenDependencies().size());
2229         assertNotNull(programmingLanguageContext
2230                 .getParsedOrSeenDependency("net.sourceforge.mazix.components.clone.DeepCloneable"));
2231         assertNotNull(programmingLanguageContext
2232                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.main.option.programminglanguage.argument.CppProgrammingLanguageTest"));
2233         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY30.getFullName()));
2234         assertEquals(
2235                 InterfaceDependencyTypeImpl.class,
2236                 programmingLanguageContext
2237                         .getParsedOrSeenDependency("net.sourceforge.mazix.components.clone.DeepCloneable")
2238                         .getDependencyType().getClass());
2239         assertEquals(
2240                 StubDependencyTypeImpl.class,
2241                 programmingLanguageContext
2242                         .getParsedOrSeenDependency(
2243                                 "net.sourceforge.plantumldependency.main.option.programminglanguage.argument.CppProgrammingLanguageTest")
2244                         .getDependencyType().getClass());
2245     }
2246 
2247     /**
2248      * Test method for
2249      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
2250      * .
2251      *
2252      * @throws PlantUMLDependencyException
2253      */
2254     @Test
2255     public void testReadDependencyFromFileInterfaceWithInnerClassAndDefaultDisplaySet()
2256             throws PlantUMLDependencyException {
2257         final String javaSourceFileContent = "package net.sourceforge.plantumldependency.main.option.programminglanguage;\n\nimport net.sourceforge.mazix.components.clone.DeepCloneable;\nimport net.sourceforge.plantumldependency.main.option.programminglanguage.argument.CppProgrammingLanguageTest;\n\nimport net.sourceforge.plantumldependency.main.option.programminglanguage.argument.CppProgrammingLanguageTest.InnerTest;\n\npublic interface TestReadDependencyFromFileInterfaceWithExtendsGenericsInImport extends DeepCloneable < CppProgrammingLanguageTest > {\n\n}\n";
2258         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
2259                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
2260                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
2261         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY39,
2262                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
2263         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
2264         assertEquals(4, programmingLanguageContext.getParsedAndSeenDependencies().size());
2265         assertNotNull(programmingLanguageContext
2266                 .getParsedOrSeenDependency("net.sourceforge.mazix.components.clone.DeepCloneable"));
2267         assertNotNull(programmingLanguageContext
2268                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.main.option.programminglanguage.argument.CppProgrammingLanguageTest"));
2269         assertNotNull(programmingLanguageContext
2270                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.main.option.programminglanguage.argument.CppProgrammingLanguageTest.InnerTest"));
2271         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY30.getFullName()));
2272         assertEquals(
2273                 InterfaceDependencyTypeImpl.class,
2274                 programmingLanguageContext
2275                         .getParsedOrSeenDependency("net.sourceforge.mazix.components.clone.DeepCloneable")
2276                         .getDependencyType().getClass());
2277         assertEquals(
2278                 StubDependencyTypeImpl.class,
2279                 programmingLanguageContext
2280                         .getParsedOrSeenDependency(
2281                                 "net.sourceforge.plantumldependency.main.option.programminglanguage.argument.CppProgrammingLanguageTest")
2282                         .getDependencyType().getClass());
2283         assertEquals(
2284                 StubDependencyTypeImpl.class,
2285                 programmingLanguageContext
2286                         .getParsedOrSeenDependency(
2287                                 "net.sourceforge.plantumldependency.main.option.programminglanguage.argument.CppProgrammingLanguageTest.InnerTest")
2288                         .getDependencyType().getClass());
2289     }
2290 
2291     /**
2292      * Test method for
2293      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
2294      * .
2295      *
2296      * @throws PlantUMLDependencyException
2297      */
2298     @Test
2299     public void testReadDependencyFromFileInterfaceWithInterfaceWordInCommentsAndDefaultDisplaySet()
2300             throws PlantUMLDependencyException {
2301         final String javaSourceFileContent = "package net.sourceforge.plantumldependency.main.option.programminglanguage;\n\n//Hello interface ! my name is brian\r\npublic interface TestReadDependencyFromFileInterfaceWithExtendsNotInImportNotJavaLang extends TestReadDependencyFromFileInterfaceWithoutPackage {\n\n}\n";
2302         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
2303                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
2304                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
2305         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY35,
2306                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
2307         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
2308         assertEquals(2, programmingLanguageContext.getParsedAndSeenDependencies().size());
2309         assertNotNull(programmingLanguageContext
2310                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.main.option.programminglanguage.TestReadDependencyFromFileInterfaceWithoutPackage"));
2311         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY35.getFullName()));
2312         assertEquals(
2313                 InterfaceDependencyTypeImpl.class,
2314                 programmingLanguageContext
2315                         .getParsedOrSeenDependency(
2316                                 "net.sourceforge.plantumldependency.main.option.programminglanguage.TestReadDependencyFromFileInterfaceWithoutPackage")
2317                         .getDependencyType().getClass());
2318     }
2319 
2320     /**
2321      * Test method for
2322      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
2323      * .
2324      *
2325      * @throws PlantUMLDependencyException
2326      */
2327     @Test
2328     public void testReadDependencyFromFileInterfaceWithMultipleExtendsGenericsWithStandardEmptyContextAndDefaultDisplaySet()
2329             throws PlantUMLDependencyException {
2330         final String javaSourceFileContent = "package net.sourceforge.plantumldependency.main.option.programminglanguage;\n\nimport java.util.Map;\n\nimport net.sourceforge.mazix.components.clone.DeepCloneable;\nimport net.sourceforge.plantumldependency.main.option.programminglanguage.argument.CppProgrammingLanguageTest;\nimport net.sourceforge.plantumldependency.main.option.programminglanguage.argument.ProgrammingLanguageTest;\n\npublic interface TestReadDependencyFromFileClassWithMultipleExtendsGenerics extends DeepCloneable < CppProgrammingLanguageTest >, Comparable < Integer>, Map < java.io.Serializable, ProgrammingLanguageTest >, Appendable {\n\n}\n";
2331         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
2332                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
2333                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
2334         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY27,
2335                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
2336         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
2337         assertEquals(7, programmingLanguageContext.getParsedAndSeenDependencies().size());
2338         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency("java.util.Map"));
2339         assertNotNull(programmingLanguageContext
2340                 .getParsedOrSeenDependency("net.sourceforge.mazix.components.clone.DeepCloneable"));
2341         assertNotNull(programmingLanguageContext
2342                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.main.option.programminglanguage.argument.CppProgrammingLanguageTest"));
2343         assertNotNull(programmingLanguageContext
2344                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.main.option.programminglanguage.argument.ProgrammingLanguageTest"));
2345         assertNotNull(programmingLanguageContext
2346                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.main.option.programminglanguage.Comparable"));
2347         assertNotNull(programmingLanguageContext
2348                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.main.option.programminglanguage.Appendable"));
2349         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY27.getFullName()));
2350         assertEquals(InterfaceDependencyTypeImpl.class,
2351                 programmingLanguageContext.getParsedOrSeenDependency("java.util.Map").getDependencyType().getClass());
2352         assertEquals(
2353                 InterfaceDependencyTypeImpl.class,
2354                 programmingLanguageContext
2355                         .getParsedOrSeenDependency("net.sourceforge.mazix.components.clone.DeepCloneable")
2356                         .getDependencyType().getClass());
2357         assertEquals(
2358                 StubDependencyTypeImpl.class,
2359                 programmingLanguageContext
2360                         .getParsedOrSeenDependency(
2361                                 "net.sourceforge.plantumldependency.main.option.programminglanguage.argument.CppProgrammingLanguageTest")
2362                         .getDependencyType().getClass());
2363         assertEquals(
2364                 StubDependencyTypeImpl.class,
2365                 programmingLanguageContext
2366                         .getParsedOrSeenDependency(
2367                                 "net.sourceforge.plantumldependency.main.option.programminglanguage.argument.ProgrammingLanguageTest")
2368                         .getDependencyType().getClass());
2369         assertEquals(
2370                 InterfaceDependencyTypeImpl.class,
2371                 programmingLanguageContext
2372                         .getParsedOrSeenDependency(
2373                                 "net.sourceforge.plantumldependency.main.option.programminglanguage.Comparable")
2374                         .getDependencyType().getClass());
2375         assertEquals(
2376                 InterfaceDependencyTypeImpl.class,
2377                 programmingLanguageContext
2378                         .getParsedOrSeenDependency(
2379                                 "net.sourceforge.plantumldependency.main.option.programminglanguage.Appendable")
2380                         .getDependencyType().getClass());
2381     }
2382 
2383     /**
2384      * Test method for
2385      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
2386      * .
2387      *
2388      * @throws PlantUMLDependencyException
2389      */
2390     @Test
2391     public void testReadDependencyFromFileInterfaceWithoutPackageWithStandardEmptyContextAndDefaultDisplaySet()
2392             throws PlantUMLDependencyException {
2393         final String javaSourceFileContent = "public interface TestReadDependencyFromFileInterfaceWithoutPackage {\n\n}\n";
2394         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
2395                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
2396                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
2397         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY36,
2398                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
2399         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
2400         assertEquals(1, programmingLanguageContext.getParsedAndSeenDependencies().size());
2401         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY36.getFullName()));
2402     }
2403 
2404     /**
2405      * Test method for
2406      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
2407      * .
2408      *
2409      * @throws PlantUMLDependencyException
2410      */
2411     @Test
2412     public void testReadDependencyFromFileInterfaceWithStandardEmptyContextAndAbstractClassDisplaySet()
2413             throws PlantUMLDependencyException {
2414         final String javaSourceFileContent = "public interface TestReadDependencyFromFileInterfaceWithoutPackage {\n\n}\n";
2415         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
2416                 DISPLAY_TYPE_SET3, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN, DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
2417         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY36,
2418                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
2419         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
2420         assertEquals(1, programmingLanguageContext.getParsedAndSeenDependencies().size());
2421         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY36.getFullName()));
2422     }
2423 
2424     /**
2425      * Test method for
2426      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
2427      * .
2428      *
2429      * @throws PlantUMLDependencyException
2430      */
2431     @Test
2432     public void testReadDependencyFromFileInterfaceWithStandardEmptyContextAndClassDisplaySet()
2433             throws PlantUMLDependencyException {
2434         final String javaSourceFileContent = "public interface TestReadDependencyFromFileInterfaceWithoutPackage {\n\n}\n";
2435         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
2436                 DISPLAY_TYPE_SET4, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN, DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
2437         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY36,
2438                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
2439         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
2440         assertEquals(1, programmingLanguageContext.getParsedAndSeenDependencies().size());
2441         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY36.getFullName()));
2442     }
2443 
2444     /**
2445      * Test method for
2446      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
2447      * .
2448      *
2449      * @throws PlantUMLDependencyException
2450      */
2451     @Test
2452     public void testReadDependencyFromFileInterfaceWithStandardEmptyContextAndDefaultDisplaySet()
2453             throws PlantUMLDependencyException {
2454         final String javaSourceFileContent = "package net.sourceforge.plantumldependency.main.option.programminglanguage;\n\ninterface TestReadDependencyFromFileInterface {\n\n}\n";
2455         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
2456                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
2457                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
2458         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY28,
2459                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
2460         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
2461         assertEquals(1, programmingLanguageContext.getParsedAndSeenDependencies().size());
2462         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY28.getFullName()));
2463     }
2464 
2465     /**
2466      * Test method for
2467      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
2468      * .
2469      *
2470      * @throws PlantUMLDependencyException
2471      */
2472     @Test
2473     public void testReadDependencyFromFileInterfaceWithStandardEmptyContextAndEnumDisplaySet()
2474             throws PlantUMLDependencyException {
2475         final String javaSourceFileContent = "public interface TestReadDependencyFromFileInterfaceWithoutPackage {\n\n}\n";
2476         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
2477                 DISPLAY_TYPE_SET5, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN, DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
2478         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY36,
2479                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
2480         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
2481         assertEquals(1, programmingLanguageContext.getParsedAndSeenDependencies().size());
2482         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY36.getFullName()));
2483     }
2484 
2485     /**
2486      * Test method for
2487      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
2488      * .
2489      *
2490      * @throws PlantUMLDependencyException
2491      */
2492     @Test
2493     public void testReadDependencyFromFileInterfaceWithWildcardImportsAndDefaultDisplaySet()
2494             throws PlantUMLDependencyException {
2495         final String javaSourceFileContent = "package net.sourceforge.plantumldependency.main.option.programminglanguage;\n\nimport net.sourceforge.plantumldependency.generic.GenericDependency;\n\nimport net.sourceforge.plantumldependency.generic.wildcard.*;\n\npublic interface TestReadDependencyFromFileInterfaceWithExtendsInImport extends GenericDependency {\n\n}\n";
2496         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
2497                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
2498                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
2499         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY32,
2500                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
2501         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
2502         assertEquals(2, programmingLanguageContext.getParsedAndSeenDependencies().size());
2503         assertNotNull(programmingLanguageContext
2504                 .getParsedOrSeenDependency("net.sourceforge.plantumldependency.generic.GenericDependency"));
2505         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY32.getFullName()));
2506         assertEquals(
2507                 InterfaceDependencyTypeImpl.class,
2508                 programmingLanguageContext
2509                         .getParsedOrSeenDependency("net.sourceforge.plantumldependency.generic.GenericDependency")
2510                         .getDependencyType().getClass());
2511     }
2512 
2513     /**
2514      * Test method for
2515      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
2516      * .
2517      *
2518      * @throws PlantUMLDependencyException
2519      */
2520     @Test
2521     public void testReadDependencyFromFilePublicAbstractClassWithStandardEmptyContextAndDefaultDisplaySet()
2522             throws PlantUMLDependencyException {
2523         final String javaSourceFileContent = "/*\r\n Test.java\r\n Creation date : 20 août 2010\r\n */\r\npackage com.plantuml.test;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n *\r\n * @since\r\n * @version\r\n */\r\npublic abstract class Test {\r\n\r\n}";
2524         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
2525                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
2526                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
2527         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY8,
2528                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
2529         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
2530         assertEquals(1, programmingLanguageContext.getParsedAndSeenDependencies().size());
2531         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY8.getFullName()));
2532     }
2533 
2534     /**
2535      * Test method for
2536      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
2537      * .
2538      *
2539      * @throws PlantUMLDependencyException
2540      */
2541     @Test
2542     public void testReadDependencyFromFilePublicClassWithStandardEmptyContextAndDefaultDisplaySet()
2543             throws PlantUMLDependencyException {
2544         final String javaSourceFileContent = "/*\r\n Test.java\r\n Creation date : 20 août 2010\r\n */\r\npackage com.plantuml.test;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n *\r\n * @since\r\n * @version\r\n */\r\npublic class Test {\r\n\r\n}";
2545         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
2546                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
2547                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
2548         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY6,
2549                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
2550         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
2551         assertEquals(1, programmingLanguageContext.getParsedAndSeenDependencies().size());
2552         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY6.getFullName()));
2553     }
2554 
2555     /**
2556      * Test method for
2557      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
2558      * .
2559      *
2560      * @throws PlantUMLDependencyException
2561      */
2562     @Test
2563     public void testReadDependencyFromFilePublicClassWithStandardEmptyContextAndEmptyDisplaySet()
2564             throws PlantUMLDependencyException {
2565         final String javaSourceFileContent = "/*\r\n Test.java\r\n Creation date : 20 août 2010\r\n */\r\npackage com.plantuml.test;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n *\r\n * @since\r\n * @version\r\n */\r\npublic class Test {\r\n\r\n}";
2566         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
2567                 DISPLAY_TYPE_SET1, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN, DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
2568         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY6,
2569                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
2570         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
2571         assertEquals(1, programmingLanguageContext.getParsedAndSeenDependencies().size());
2572         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY6.getFullName()));
2573     }
2574 
2575     /**
2576      * Test method for
2577      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
2578      * .
2579      *
2580      * @throws PlantUMLDependencyException
2581      */
2582     @Test
2583     public void testReadDependencyFromFilePublicFinalClassWithStandardEmptyContextAndDefaultDisplaySet()
2584             throws PlantUMLDependencyException {
2585         final String javaSourceFileContent = "/*\r\n Test.java\r\n Creation date : 20 août 2010\r\n */\r\npackage com.plantuml.test;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n *\r\n * @since\r\n * @version\r\n */\r\npublic final class Test {\r\n\r\n}";
2586         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
2587                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
2588                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
2589         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY6,
2590                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
2591         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
2592         assertEquals(1, programmingLanguageContext.getParsedAndSeenDependencies().size());
2593         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY6.getFullName()));
2594     }
2595 
2596     /**
2597      * Test method for
2598      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
2599      * .
2600      *
2601      * @throws PlantUMLDependencyException
2602      */
2603     @Test
2604     public void testReadDependencyFromFilePublicInterfaceWithStandardEmptyContextAndDefaultDisplaySet()
2605             throws PlantUMLDependencyException {
2606         final String javaSourceFileContent = "package net.sourceforge.plantumldependency.main.option.programminglanguage;\n\npublic interface TestReadDependencyFromFilePublicInterface {\n\n}\n";
2607         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
2608                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
2609                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
2610         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY37,
2611                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
2612         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
2613         assertEquals(1, programmingLanguageContext.getParsedAndSeenDependencies().size());
2614         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY37.getFullName()));
2615     }
2616 
2617     /**
2618      * Test method for
2619      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
2620      * .
2621      *
2622      * @throws PlantUMLDependencyException
2623      */
2624     @Test(expected = PlantUMLDependencyException.class)
2625     public void testReadDependencyFromFileWithBlankContentWithStandardEmptyContextAndDefaultDisplaySet()
2626             throws PlantUMLDependencyException {
2627         JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(BLANK_STRING, JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
2628                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
2629                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN));
2630     }
2631 
2632     /**
2633      * Test method for
2634      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
2635      * .
2636      *
2637      * @throws PlantUMLDependencyException
2638      */
2639     @Test
2640     public void testReadDependencyFromFileWithSpacesAndLineSeparatorWithStandardEmptyContextAndDefaultDisplaySet()
2641             throws PlantUMLDependencyException {
2642         final String javaSourceFileContent = "/*\r\n Test.java\r\n Creation date : 20 août 2010\r\n */\r\n\r\n      package      com.    plantuml.     \r\ntest;\r\n\r\n/**\r\n * @author Benjamin Croizet\r\n *\r\n * @since\r\n * @version\r\n */\r\n       public     class      \r\nTest        {\r\n\r\n}\r\n";
2643         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
2644                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
2645                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
2646         assertGenericDependencyAreEquals(GENERIC_DEPENDENCY6,
2647                 JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext));
2648         assertEquals(1, programmingLanguageContext.getParsedDependencies().size());
2649         assertEquals(1, programmingLanguageContext.getParsedAndSeenDependencies().size());
2650         assertNotNull(programmingLanguageContext.getParsedOrSeenDependency(GENERIC_DEPENDENCY6.getFullName()));
2651     }
2652 
2653     /**
2654      * Test method for
2655      * {@link net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.JavaProgrammingLanguage#readDependencyFromFile(String, ProgrammingLanguageContext)}
2656      * .
2657      *
2658      * @throws PlantUMLDependencyException
2659      */
2660     @Test(expected = PlantUMLDependencyException.class)
2661     public void testReadDependencyFromNonJavaFileWithStandardEmptyContextAndDefaultDisplaySet()
2662             throws PlantUMLDependencyException {
2663         final String javaSourceFileContent = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<testsuite failures=\"0\" time=\"0.306\" errors=\"0\" skipped=\"0\" tests=\"22\" name=\"net.sourceforge.plantumldependency.generic.impl.GenericDependencyImplTest\">\n  <properties>\n    <property name=\"java.runtime.name\" value=\"Java(TM) SE Runtime Environment\"/>\n    <property name=\"sun.boot.library.path\" value=\"/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/i386\"/>\n    <property name=\"java.vm.version\" value=\"20.1-b02\"/>\n    <property name=\"java.vm.vendor\" value=\"Sun Microsystems Inc.\"/>\n    <property name=\"java.vendor.url\" value=\"http://java.sun.com/\"/>\n    <property name=\"path.separator\" value=\":\"/>\n    <property name=\"java.vm.name\" value=\"Java HotSpot(TM) Server VM\"/>\n    <property name=\"file.encoding.pkg\" value=\"sun.io\"/>\n    <property name=\"user.country\" value=\"FR\"/>\n    <property name=\"sun.java.launcher\" value=\"SUN_STANDARD\"/>\n    <property name=\"sun.os.patch.level\" value=\"unknown\"/>\n    <property name=\"java.vm.specification.name\" value=\"Java Virtual Machine Specification\"/>\n    <property name=\"user.dir\" value=\"/home/graffity/workspace/plantuml-dependency\"/>\n    <property name=\"java.runtime.version\" value=\"1.6.0_26-b03\"/>\n    <property name=\"java.awt.graphicsenv\" value=\"sun.awt.X11GraphicsEnvironment\"/>\n    <property name=\"basedir\" value=\"/home/graffity/workspace/plantuml-dependency\"/>\n    <property name=\"java.endorsed.dirs\" value=\"/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/endorsed\"/>\n    <property name=\"os.arch\" value=\"i386\"/>\n    <property name=\"surefire.real.class.path\" value=\"/home/graffity/workspace/plantuml-dependency/target/surefire/surefirebooter4286092155706823282.jar\"/>\n    <property name=\"java.io.tmpdir\" value=\"/tmp\"/>\n    <property name=\"line.separator\" value=\"\n\"/>\n    <property name=\"java.vm.specification.vendor\" value=\"Sun Microsystems Inc.\"/>\n    <property name=\"os.name\" value=\"Linux\"/>\n    <property name=\"sun.jnu.encoding\" value=\"UTF-8\"/>\n    <property name=\"java.library.path\" value=\"/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/i386/server:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/i386:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/../lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib\"/>\n    <property name=\"surefire.test.class.path\" value=\"/home/graffity/workspace/plantuml-dependency/target/test-classes:/home/graffity/workspace/plantuml-dependency/target/classes:/home/graffity/.m2/repository/junit/junit/4.7/junit-4.7.jar:/home/graffity/.m2/repository/net/sourceforge/mazix/cli/mazix-cli/1.0.2/mazix-cli-1.0.2.jar:/home/graffity/.m2/repository/org/apache/ant/ant/1.8.2/ant-1.8.2.jar:/home/graffity/.m2/repository/org/apache/ant/ant-launcher/1.8.2/ant-launcher-1.8.2.jar:/home/graffity/.m2/repository/net/sourceforge/mazix/components/mazix-components/1.1.1/mazix-components-1.1.1.jar:/home/graffity/.m2/repository/net/sourceforge/mazix/components/mazix-components/1.1.1/mazix-components-1.1.1-tests.jar:\"/>\n    <property name=\"java.specification.name\" value=\"Java Platform API Specification\"/>\n    <property name=\"java.class.version\" value=\"50.0\"/>\n    <property name=\"sun.management.compiler\" value=\"HotSpot Tiered Compilers\"/>\n    <property name=\"os.version\" value=\"2.6.32-33-generic-pae\"/>\n    <property name=\"user.home\" value=\"/home/graffity\"/>\n    <property name=\"user.timezone\" value=\"\"/>\n    <property name=\"java.awt.printerjob\" value=\"sun.print.PSPrinterJob\"/>\n    <property name=\"file.encoding\" value=\"UTF-8\"/>\n    <property name=\"java.specification.version\" value=\"1.6\"/>\n    <property name=\"user.name\" value=\"graffity\"/>\n    <property name=\"java.class.path\" value=\"/home/graffity/workspace/plantuml-dependency/target/test-classes:/home/graffity/workspace/plantuml-dependency/target/classes:/home/graffity/.m2/repository/junit/junit/4.7/junit-4.7.jar:/home/graffity/.m2/repository/net/sourceforge/mazix/cli/mazix-cli/1.0.2/mazix-cli-1.0.2.jar:/home/graffity/.m2/repository/org/apache/ant/ant/1.8.2/ant-1.8.2.jar:/home/graffity/.m2/repository/org/apache/ant/ant-launcher/1.8.2/ant-launcher-1.8.2.jar:/home/graffity/.m2/repository/net/sourceforge/mazix/components/mazix-components/1.1.1/mazix-components-1.1.1.jar:/home/graffity/.m2/repository/net/sourceforge/mazix/components/mazix-components/1.1.1/mazix-components-1.1.1-tests.jar:\"/>\n    <property name=\"java.vm.specification.version\" value=\"1.0\"/>\n    <property name=\"sun.arch.data.model\" value=\"32\"/>\n    <property name=\"java.home\" value=\"/usr/lib/jvm/java-6-sun-1.6.0.26/jre\"/>\n    <property name=\"sun.java.command\" value=\"/home/graffity/workspace/plantuml-dependency/target/surefire/surefirebooter4286092155706823282.jar /home/graffity/workspace/plantuml-dependency/target/surefire/surefire1347948533659098341tmp /home/graffity/workspace/plantuml-dependency/target/surefire/surefire6816175995908075715tmp\"/>\n    <property name=\"java.specification.vendor\" value=\"Sun Microsystems Inc.\"/>\n    <property name=\"user.language\" value=\"fr\"/>\n    <property name=\"java.vm.info\" value=\"mixed mode\"/>\n    <property name=\"java.version\" value=\"1.6.0_26\"/>\n    <property name=\"java.ext.dirs\" value=\"/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/ext:/usr/java/packages/lib/ext\"/>\n    <property name=\"sun.boot.class.path\" value=\"/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/resources.jar:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/rt.jar:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/jsse.jar:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/jce.jar:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/charsets.jar:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/modules/jdk.boot.jar:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/classes\"/>\n    <property name=\"java.vendor\" value=\"Sun Microsystems Inc.\"/>\n    <property name=\"localRepository\" value=\"/home/graffity/.m2/repository\"/>\n    <property name=\"file.separator\" value=\"/\"/>\n    <property name=\"java.vendor.url.bug\" value=\"http://java.sun.com/cgi-bin/bugreport.cgi\"/>\n    <property name=\"sun.cpu.endian\" value=\"little\"/>\n    <property name=\"sun.io.unicode.encoding\" value=\"UnicodeLittle\"/>\n    <property name=\"sun.desktop\" value=\"gnome\"/>\n    <property name=\"sun.cpu.isalist\" value=\"\"/>\n  </properties>\n  <testcase time=\"0.03\" classname=\"net.sourceforge.plantumldependency.generic.impl.GenericDependencyImplTest\" name=\"testGetDependencyType\"/>\n  <testcase time=\"0.011\" classname=\"net.sourceforge.plantumldependency.generic.impl.GenericDependencyImplTest\" name=\"testGetFullName\"/>\n  <testcase time=\"0.003\" classname=\"net.sourceforge.plantumldependency.generic.impl.GenericDependencyImplTest\" name=\"testGetName\"/>\n  <testcase time=\"0.015\" classname=\"net.sourceforge.plantumldependency.generic.impl.GenericDependencyImplTest\" name=\"testGetPackageName\"/>\n  <testcase time=\"0.009\" classname=\"net.sourceforge.plantumldependency.generic.impl.GenericDependencyImplTest\" name=\"testSetDependencyType\"/>\n  <testcase time=\"0.006\" classname=\"net.sourceforge.plantumldependency.generic.impl.GenericDependencyImplTest\" name=\"deepCloneClassAreEquals\"/>\n  <testcase time=\"0.011\" classname=\"net.sourceforge.plantumldependency.generic.impl.GenericDependencyImplTest\" name=\"deepCloneReferencesAreDifferent\"/>\n  <testcase time=\"0.01\" classname=\"net.sourceforge.plantumldependency.generic.impl.GenericDependencyImplTest\" name=\"deepClonesAreEquals\"/>\n  <testcase time=\"0.005\" classname=\"net.sourceforge.plantumldependency.generic.impl.GenericDependencyImplTest\" name=\"compareToIsConsistent\"/>\n  <testcase time=\"0.016\" classname=\"net.sourceforge.plantumldependency.generic.impl.GenericDependencyImplTest\" name=\"compareToIsConsistentWithEquals\"/>\n  <testcase time=\"0.004\" classname=\"net.sourceforge.plantumldependency.generic.impl.GenericDependencyImplTest\" name=\"compareToIsSymmetric\"/>\n  <testcase time=\"0.003\" classname=\"net.sourceforge.plantumldependency.generic.impl.GenericDependencyImplTest\" name=\"compareToIsTransitive\"/>\n  <testcase time=\"0.008\" classname=\"net.sourceforge.plantumldependency.generic.impl.GenericDependencyImplTest\" name=\"compareToWorks\"/>\n  <testcase time=\"0.003\" classname=\"net.sourceforge.plantumldependency.generic.impl.GenericDependencyImplTest\" name=\"equalsIsConsistent\"/>\n  <testcase time=\"0.002\" classname=\"net.sourceforge.plantumldependency.generic.impl.GenericDependencyImplTest\" name=\"equalsIsReflexive\"/>\n  <testcase time=\"0.002\" classname=\"net.sourceforge.plantumldependency.generic.impl.GenericDependencyImplTest\" name=\"equalsIsSymmetric\"/>\n  <testcase time=\"0.002\" classname=\"net.sourceforge.plantumldependency.generic.impl.GenericDependencyImplTest\" name=\"equalsIsTransitive\"/>\n  <testcase time=\"0.01\" classname=\"net.sourceforge.plantumldependency.generic.impl.GenericDependencyImplTest\" name=\"equalsReturnFalseOnNull\"/>\n  <testcase time=\"0.002\" classname=\"net.sourceforge.plantumldependency.generic.impl.GenericDependencyImplTest\" name=\"equalsWorks\"/>\n  <testcase time=\"0.008\" classname=\"net.sourceforge.plantumldependency.generic.impl.GenericDependencyImplTest\" name=\"hashCodeIsConsistentWithEquals\"/>\n  <testcase time=\"0.002\" classname=\"net.sourceforge.plantumldependency.generic.impl.GenericDependencyImplTest\" name=\"hashCodeIsSelfConsistent\"/>\n  <testcase time=\"0.012\" classname=\"net.sourceforge.plantumldependency.generic.impl.GenericDependencyImplTest\" name=\"toStringContainsClassName\"/>\n</testsuite>";
2664         final ProgrammingLanguageContext programmingLanguageContext = JAVA_PROGRAMMING_LANGUAGE1.createNewContext(
2665                 DEFAULT_DISPLAY_TYPES_OPTIONS, DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN,
2666                 DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN);
2667         JAVA_PROGRAMMING_LANGUAGE1.readDependencyFromFile(javaSourceFileContent, programmingLanguageContext);
2668     }
2669 }