| <!DOCTYPE html> |
| <!-- |
| | Generated by Apache Maven Doxia Site Renderer 1.9.2 from org.apache.maven.plugins:maven-pmd-plugin:3.14.0:cpd at 14 Sep 2021 |
| | Rendered using Apache Maven Fluido Skin 1.9 |
| --> |
| <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> |
| <head> |
| <meta charset="UTF-8" /> |
| <meta name="viewport" content="width=device-width, initial-scale=1" /> |
| <meta name="generator" content="Apache Maven Doxia Site Renderer 1.9.2" /> |
| <title>Fulcrum Test Container – CPD Results</title> |
| <link rel="stylesheet" href="./css/apache-maven-fluido-1.9.min.css" /> |
| <link rel="stylesheet" href="./css/site.css" /> |
| <link rel="stylesheet" href="./css/print.css" media="print" /> |
| <script src="./js/apache-maven-fluido-1.9.min.js"></script> |
| </head> |
| <body class="topBarDisabled"> |
| <div class="container-fluid"> |
| <header> |
| <div id="banner"> |
| <div class="pull-left"><a href="../../" id="bannerLeft" title="Apache Turbine"><img src="../../images/turbine-project.png" alt="Apache Turbine"/></a></div> |
| <div class="pull-right"></div> |
| <div class="clear"><hr/></div> |
| </div> |
| |
| <div id="breadcrumbs"> |
| <ul class="breadcrumb"> |
| <li id="publishDate">Last Published: 14 Sep 2021<span class="divider">|</span> |
| </li> |
| <li id="projectVersion">Version: 1.0.10-SNAPSHOT</li> |
| <li class="pull-right"><span class="divider">|</span> |
| <a href="../" title="Fulcrum">Fulcrum</a></li> |
| <li class="pull-right"><span class="divider">|</span> |
| <a href="../../" title="Turbine">Turbine</a></li> |
| <li class="pull-right"><a href="https://www.apache.org" class="externalLink" title="Apache">Apache</a></li> |
| </ul> |
| </div> |
| </header> |
| <div class="row-fluid"> |
| <header id="leftColumn" class="span2"> |
| <nav class="well sidebar-nav"> |
| <ul class="nav nav-list"> |
| <li class="nav-header">Overview</li> |
| <li><a href="index.html" title="Main"><span class="none"></span>Main</a></li> |
| <li class="nav-header">Project Documentation</li> |
| <li><a href="project-info.html" title="Project Information"><span class="icon-chevron-right"></span>Project Information</a></li> |
| <li><a href="project-reports.html" title="Project Reports"><span class="icon-chevron-down"></span>Project Reports</a> |
| <ul class="nav nav-list"> |
| <li><a href="changes-report.html" title="Changes"><span class="none"></span>Changes</a></li> |
| <li><a href="apidocs/index.html" title="Javadoc"><span class="none"></span>Javadoc</a></li> |
| <li><a href="testapidocs/index.html" title="Test Javadoc"><span class="none"></span>Test Javadoc</a></li> |
| <li><a href="xref/index.html" title="Source Xref"><span class="none"></span>Source Xref</a></li> |
| <li><a href="xref-test/index.html" title="Test Source Xref"><span class="none"></span>Test Source Xref</a></li> |
| <li class="active"><a href="#"><span class="none"></span>CPD</a></li> |
| <li><a href="pmd.html" title="PMD"><span class="none"></span>PMD</a></li> |
| <li><a href="surefire-report.html" title="Surefire Report"><span class="none"></span>Surefire Report</a></li> |
| <li><a href="jacoco/index.html" title="JaCoCo"><span class="none"></span>JaCoCo</a></li> |
| <li><a href="jacoco-aggregate/index.html" title="JaCoCo Aggregate"><span class="none"></span>JaCoCo Aggregate</a></li> |
| <li><a href="jdepend-report.html" title="JDepend"><span class="none"></span>JDepend</a></li> |
| <li><a href="rat-report.html" title="Rat Report"><span class="none"></span>Rat Report</a></li> |
| <li><a href="taglist.html" title="Tag List"><span class="none"></span>Tag List</a></li> |
| <li><a href="findbugs.html" title="FindBugs"><span class="none"></span>FindBugs</a></li> |
| </ul></li> |
| <li class="nav-header">Apache</li> |
| <li><a href="https://www.apache.org/" class="externalLink" title="Apache Website"><span class="none"></span>Apache Website</a></li> |
| <li><a href="https://www.apache.org/licenses/" class="externalLink" title="License"><span class="none"></span>License</a></li> |
| <li><a href="https://www.apache.org/foundation/how-it-works.html" class="externalLink" title="How the ASF works"><span class="none"></span>How the ASF works</a></li> |
| <li><a href="https://www.apache.org/foundation/sponsorship.html" class="externalLink" title="Sponsorship"><span class="none"></span>Sponsorship</a></li> |
| <li><a href="https://www.apache.org/foundation/thanks.html" class="externalLink" title="Thanks"><span class="none"></span>Thanks</a></li> |
| <li><a href="https://www.apache.org/security/" class="externalLink" title="Security"><span class="none"></span>Security</a></li> |
| </ul> |
| </nav> |
| <div class="well sidebar-nav"> |
| <hr /> |
| <div id="poweredBy"> |
| <div class="clear"></div> |
| <div class="clear"></div> |
| <div class="clear"></div> |
| <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /></a> |
| </div> |
| </div> |
| </header> |
| <main id="bodyColumn" class="span10" > |
| <section> |
| <h2><a name="CPD_Results"></a>CPD Results</h2> |
| <p>The following document contains the results of PMD's <a class="externalLink" href="https://pmd.github.io/latest/pmd_userdocs_cpd.html">CPD</a> 6.29.0.</p></section><section> |
| <h2><a name="Duplications"></a>Duplications</h2> |
| <table border="0" class="table table-striped"> |
| <tr class="a"> |
| <th>File</th> |
| <th>Line</th></tr> |
| <tr class="b"> |
| <td>org\apache\fulcrum\testcontainer\BaseUnit4Test.java</td> |
| <td><a href="./xref/org/apache/fulcrum/testcontainer/BaseUnit4Test.html#L137">137</a></td></tr> |
| <tr class="a"> |
| <td>org\apache\fulcrum\testcontainer\BaseUnit5Test.java</td> |
| <td><a href="./xref/org/apache/fulcrum/testcontainer/BaseUnit5Test.html#L144">144</a></td></tr> |
| <tr class="b"><td colspan='2'> |
| <div> |
| <pre>public void tearDown() |
| { |
| if (container != null) { |
| container.dispose(); |
| } |
| container = null; |
| } |
| |
| /** |
| * Gets the configuration file name for the container should use for this test. |
| * |
| * @return The filename of the configuration file |
| */ |
| protected String getConfigurationFileName() |
| { |
| return configurationFileName; |
| } |
| |
| /** |
| * Gets the role file name for the container should use for this test. |
| * |
| * @return The filename of the role configuration file |
| */ |
| protected String getRoleFileName() |
| { |
| return roleFileName; |
| } |
| |
| /** |
| * Gets the parameter file name for the container should use for this test. |
| * |
| * @return The filename of the role configuration file |
| */ |
| protected String getParameterFileName() |
| { |
| return parameterFileName; |
| } |
| |
| /** |
| * Returns an instance of the named component. This method will also start the |
| * container if it has not been started already |
| * |
| * @param roleName Name of the role the component fills. |
| * @return instance of the component |
| * @throws ComponentException generic exception |
| */ |
| protected Object lookup(String roleName) throws ComponentException |
| { |
| if (container == null) |
| { |
| if (containerType.equals(CONTAINER_ECM)) |
| { |
| container = new ECMContainer(); |
| } |
| else |
| { |
| container = new YAAFIContainer(logLevel); |
| } |
| container.startup(getConfigurationFileName(), getRoleFileName(), getParameterFileName()); |
| } |
| return container.lookup(roleName); |
| } |
| |
| /** |
| * Releases the component. |
| * |
| * @param component component to be released |
| */ |
| protected void release(Object component) |
| { |
| if (container != null) |
| { |
| container.release(component); |
| } |
| } |
| |
| /** |
| * Get a mock requestion |
| * |
| * @return HttpServletRequest a mock servlet request |
| */ |
| protected HttpServletRequest getMockRequest() |
| { |
| HttpServletRequest request = mock(HttpServletRequest.class); |
| HttpSession session = mock(HttpSession.class); |
| |
| doAnswer(new Answer<Object>() |
| { |
| @Override |
| public Object answer(InvocationOnMock invocation) throws Throwable |
| { |
| String key = (String) invocation.getArguments()[0]; |
| return attributes.get(key); |
| } |
| }).when(session).getAttribute(anyString()); |
| |
| doAnswer(new Answer<Object>() |
| { |
| @Override |
| public Object answer(InvocationOnMock invocation) throws Throwable |
| { |
| String key = (String) invocation.getArguments()[0]; |
| Object value = invocation.getArguments()[1]; |
| attributes.put(key, value); |
| return null; |
| } |
| }).when(session).setAttribute(anyString(), any()); |
| |
| when(session.getMaxInactiveInterval()).thenReturn(maxInactiveInterval); |
| |
| doAnswer(new Answer<Integer>() |
| { |
| @Override |
| public Integer answer(InvocationOnMock invocation) throws Throwable { |
| return Integer.valueOf(maxInactiveInterval); |
| } |
| }).when(session).getMaxInactiveInterval(); |
| |
| doAnswer(new Answer<Object>() |
| { |
| @Override |
| public Object answer(InvocationOnMock invocation) throws Throwable |
| { |
| Integer value = (Integer) invocation.getArguments()[0]; |
| maxInactiveInterval = value.intValue(); |
| return null; |
| } |
| }).when(session).setMaxInactiveInterval(anyInt()); |
| |
| when(session.isNew()).thenReturn(true); |
| when(request.getSession()).thenReturn(session); |
| |
| when(request.getServerName()).thenReturn("bob"); |
| when(request.getProtocol()).thenReturn("http"); |
| when(request.getScheme()).thenReturn("scheme"); |
| when(request.getPathInfo()).thenReturn("damn"); |
| when(request.getServletPath()).thenReturn("damn2"); |
| when(request.getContextPath()).thenReturn("wow"); |
| when(request.getContentType()).thenReturn("text/html"); |
| |
| when(request.getCharacterEncoding()).thenReturn("US-ASCII"); |
| when(request.getServerPort()).thenReturn(8080); |
| when(request.getLocale()).thenReturn(Locale.US); |
| |
| when(request.getHeader("Content-type")).thenReturn("text/html"); |
| when(request.getHeader("Accept-Language")).thenReturn("en-US"); |
| |
| Vector<String> v = new Vector<String>(); |
| when(request.getParameterNames()).thenReturn(v.elements()); |
| return request; |
| } |
| |
| public String getContainerType() |
| { |
| return containerType; |
| } |
| |
| public void setContainerType(String containerType) |
| { |
| this.containerType = containerType; |
| } |
| }</pre></div></td></tr></table></section> |
| </main> |
| </div> |
| </div> |
| <hr/> |
| <footer> |
| <div class="container-fluid"> |
| <div class="row-fluid"> |
| <p>© 2004–2021 |
| <a href="https://www.apache.org/">The Apache Software Foundation</a> |
| </p> |
| </div> |
| </div> |
| </footer> |
| </body> |
| </html> |