当前位置: 首页>>代码示例>>Java>>正文


Java TestResources类代码示例

本文整理汇总了Java中io.takari.maven.testing.TestResources的典型用法代码示例。如果您正苦于以下问题:Java TestResources类的具体用法?Java TestResources怎么用?Java TestResources使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TestResources类属于io.takari.maven.testing包,在下文中一共展示了TestResources类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testPackageMultimodule

import io.takari.maven.testing.TestResources; //导入依赖的package包/类
@Test
public void testPackageMultimodule() throws Exception {
  File basedir = resources.getBasedir("basic");
  maven.forProject(basedir)
      .execute("package") //
      .assertErrorFreeLog();
  
  File targetdir = new File(basedir, "target");

  assertThat(targetdir).exists().isDirectory();
  
  TestResources.assertFilesPresent(targetdir,
      "classes/com/salesforce/aptspring/ComputerHardwareConfiguration_forceInjectData.class");
  TestResources.assertFilesPresent(targetdir,
      "generated-sources/annotations/com/salesforce/aptspring/ComputerHardwareConfiguration_forceInjectData.java");
  TestResources.assertFilesPresent(targetdir,
      "test-classes/com/salesforce/aptspring/RootApplicationConfiguration_forceInjectData.class");
  TestResources.assertFilesPresent(targetdir,
      "generated-test-sources/test-annotations/com/salesforce/aptspring/RootApplicationConfiguration_forceInjectData.java");
}
 
开发者ID:salesforce,项目名称:AptSpring,代码行数:21,代码来源:BetterTakariCompileTest.java

示例2: AbstractTest

import io.takari.maven.testing.TestResources; //导入依赖的package包/类
public AbstractTest(MavenRuntime.MavenRuntimeBuilder mavenBuilder, String projectName)
    throws Exception {
  this.resources =
      new TestResources(
          "src/test/projects",
          Files.createTempDirectory("maven-git-code-format-test").toString());
  this.maven = mavenBuilder.withCliOptions("-B", "-U").build();
  this.projectName = projectName;
}
 
开发者ID:Cosium,项目名称:maven-git-code-format,代码行数:10,代码来源:AbstractTest.java

示例3: testBasic

import io.takari.maven.testing.TestResources; //导入依赖的package包/类
@Test
public void testBasic() throws Exception {
    File basedir = resources.getBasedir("basic");
    String goal = format("io.codearte.props2yaml:props2yaml-maven-plugin:%s:convert", properties.getPluginVersion());
    maven.forProject(basedir)
            .execute(goal, "-Dproperties=sample.properties")
            .assertErrorFreeLog();
    TestResources.assertFilesPresent(basedir, "sample.yml");
}
 
开发者ID:Codearte,项目名称:props2yaml,代码行数:10,代码来源:IntegrationTest.java

示例4: testCustomTestPropertiesFile

import io.takari.maven.testing.TestResources; //导入依赖的package包/类
@Test
public void testCustomTestPropertiesFile() throws Exception {
  File basedir = resources.getBasedir("testproperties/custom-test-properties-file");
  MavenProject project = mojos.readMavenProject(basedir);
  MavenSession session = mojos.newMavenSession(project);

  mojos.executeMojo(session, project, newMojoExecution());
  Assert.assertEquals("value", readProperties(basedir).get("custom"));

  TestResources.cp(basedir, "src/test/modified-test.properties", "src/test/test.properties");
  mojos.executeMojo(session, project, newMojoExecution());
  Assert.assertEquals("modified-value", readProperties(basedir).get("custom"));
}
 
开发者ID:takari,项目名称:takari-lifecycle,代码行数:14,代码来源:TestPropertiesMojoTest.java

示例5: testWorkspaceStateIncludesThisProjectJarArtifact

import io.takari.maven.testing.TestResources; //导入依赖的package包/类
@Test
public void testWorkspaceStateIncludesThisProjectJarArtifact() throws Exception {
  File basedir = resources.getBasedir();
  MavenProject project = mojos.readMavenProject(basedir);
  MavenSession session = mojos.newMavenSession(project);

  mojos.executeMojo(session, project, newMojoExecution());
  Map<String, String> state = TestResources.readProperties(basedir, "target/workspacestate.properties");

  Assert.assertEquals(new File(basedir, "pom.xml").getCanonicalPath(), state.get("test:test:pom::1"));
  Assert.assertEquals(new File(basedir, "target/classes").getCanonicalPath(), state.get("test:test:jar::1"));
}
 
开发者ID:takari,项目名称:takari-lifecycle,代码行数:13,代码来源:TestPropertiesMojoTest.java

示例6: test

import io.takari.maven.testing.TestResources; //导入依赖的package包/类
private void test(String compilerId) throws Exception {
  File basedir = resources.getBasedir("compile-proc");

  MavenExecutionResult result = verifier.forProject(basedir).withCliOption("-DcompilerId=" + compilerId).execute("package");
  result.assertErrorFreeLog();

  TestResources.assertFilesPresent(basedir, "project/target/classes/project/MyMyAnnotationClient.class");
}
 
开发者ID:takari,项目名称:takari-lifecycle,代码行数:9,代码来源:CompileAnnotationProcessingTest.java

示例7: readProperties

import io.takari.maven.testing.TestResources; //导入依赖的package包/类
private Map<String, String> readProperties(File basedir) throws IOException {
  return TestResources.readProperties(basedir, "target/test-classes/test.properties");
}
 
开发者ID:takari,项目名称:takari-lifecycle,代码行数:4,代码来源:TestPropertiesMojoTest.java


注:本文中的io.takari.maven.testing.TestResources类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。