CitrusArchiveProcessor implements ApplicationArchiveProcessor { @Override public void process(Archive<?> applicationArchive, TestClass testClass) { if (getConfiguration().isAutoPackage() && (applicationArchive instanceof EnterpriseArchive || applicationArchive instanceof WebArchive)) { addDependencies(applicationArchive); } }  @Override void process(Archive<?> applicationArchive, TestClass testClass); CitrusConfiguration getConfiguration();  }
@Test public void testProcessEnterpriseArchive() throws Exception { EnterpriseArchive enterpriseArchive = new EnterpriseArchiveImpl(new MemoryMapArchiveImpl(new ConfigurationBuilder().build())); archiveProcessor.process(enterpriseArchive, new TestClass(this.getClass())); verifyArtifact(enterpriseArchive, "/citrus-core-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-jms-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-kafka-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-jdbc-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-http-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-websocket-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-ws-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-ftp-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-camel-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-docker-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-kubernetes-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-selenium-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-cucumber-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-zookeeper-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-rmi-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-jmx-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-restdocs-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-ssh-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-mail-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-vertx-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-java-dsl-.*jar"); JavaArchive javaArchive = new JavaArchiveImpl(new MemoryMapArchiveImpl(new ConfigurationBuilder().build())); archiveProcessor.process(javaArchive, new TestClass(this.getClass())); Assert.assertEquals(javaArchive.getContent().size(), 0L); }
@Test public void testProcessExplicitCitrusVersion() throws Exception { configuration.setCitrusVersion(Citrus.getVersion()); EnterpriseArchive enterpriseArchive = new EnterpriseArchiveImpl(new MemoryMapArchiveImpl(new ConfigurationBuilder().build())); archiveProcessor.process(enterpriseArchive, new TestClass(this.getClass())); verifyArtifact(enterpriseArchive, "/citrus-core-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-jms-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-kafka-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-jdbc-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-http-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-websocket-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-ws-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-ftp-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-camel-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-docker-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-kubernetes-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-selenium-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-cucumber-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-zookeeper-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-rmi-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-jmx-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-restdocs-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-ssh-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-mail-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-vertx-.*jar"); verifyArtifact(enterpriseArchive, "/citrus-java-dsl-.*jar"); }
@Test public void testProcessWebArchive() throws Exception { WebArchive webArchive = new WebArchiveImpl(new MemoryMapArchiveImpl(new ConfigurationBuilder().build())); archiveProcessor.process(webArchive, new TestClass(this.getClass())); verifyArtifact(webArchive, "/WEB-INF/lib/citrus-core-.*jar"); verifyArtifact(webArchive, "/WEB-INF/lib/citrus-jms-.*jar"); verifyArtifact(webArchive, "/WEB-INF/lib/citrus-kafka-.*jar"); verifyArtifact(webArchive, "/WEB-INF/lib/citrus-jdbc-.*jar"); verifyArtifact(webArchive, "/WEB-INF/lib/citrus-http-.*jar"); verifyArtifact(webArchive, "/WEB-INF/lib/citrus-websocket-.*jar"); verifyArtifact(webArchive, "/WEB-INF/lib/citrus-ws-.*jar"); verifyArtifact(webArchive, "/WEB-INF/lib/citrus-ftp-.*jar"); verifyArtifact(webArchive, "/WEB-INF/lib/citrus-camel-.*jar"); verifyArtifact(webArchive, "/WEB-INF/lib/citrus-docker-.*jar"); verifyArtifact(webArchive, "/WEB-INF/lib/citrus-kubernetes-.*jar"); verifyArtifact(webArchive, "/WEB-INF/lib/citrus-selenium-.*jar"); verifyArtifact(webArchive, "/WEB-INF/lib/citrus-cucumber-.*jar"); verifyArtifact(webArchive, "/WEB-INF/lib/citrus-zookeeper-.*jar"); verifyArtifact(webArchive, "/WEB-INF/lib/citrus-rmi-.*jar"); verifyArtifact(webArchive, "/WEB-INF/lib/citrus-jmx-.*jar"); verifyArtifact(webArchive, "/WEB-INF/lib/citrus-restdocs-.*jar"); verifyArtifact(webArchive, "/WEB-INF/lib/citrus-ssh-.*jar"); verifyArtifact(webArchive, "/WEB-INF/lib/citrus-mail-.*jar"); verifyArtifact(webArchive, "/WEB-INF/lib/citrus-vertx-.*jar"); verifyArtifact(webArchive, "/WEB-INF/lib/citrus-java-dsl-.*jar"); }
@Test public void testProcessNoAutoPackage() throws Exception { configuration.setAutoPackage(false); EnterpriseArchive enterpriseArchive = new EnterpriseArchiveImpl(new MemoryMapArchiveImpl(new ConfigurationBuilder().build())); archiveProcessor.process(enterpriseArchive, new TestClass(this.getClass())); Assert.assertEquals(enterpriseArchive.getContent().size(), 0L); JavaArchive javaArchive = new JavaArchiveImpl(new MemoryMapArchiveImpl(new ConfigurationBuilder().build())); archiveProcessor.process(javaArchive, new TestClass(this.getClass())); Assert.assertEquals(javaArchive.getContent().size(), 0L); WebArchive webArchive = new WebArchiveImpl(new MemoryMapArchiveImpl(new ConfigurationBuilder().build())); archiveProcessor.process(webArchive, new TestClass(this.getClass())); Assert.assertEquals(webArchive.getContent().size(), 0L); }