Ejemplo n.º 1
0
 @Test
 public void testRemoveProperty() throws Exception {
   Project project = initializeJavaProject();
   Shell shell = getShell();
   shell.execute("i18n setup");
   shell.execute("i18n put --key mykey --value myvalue");
   shell.execute("i18n add-locale --locale pt_BR");
   shell.execute("i18n put --key mykey --value meuvalor");
   shell.execute("i18n remove --key mykey");
   ResourceFacet resourceFacet = project.getFacet(ResourceFacet.class);
   PropertiesFileResource resource =
       (PropertiesFileResource) resourceFacet.getResource("messages.properties");
   PropertiesFileResource resource_ptBR =
       (PropertiesFileResource) resourceFacet.getResource("messages_pt_BR.properties");
   assertNull(resource.getProperty("mykey"));
   assertNull(resource_ptBR.getProperty("mykey"));
 }
 private DirectoryResource getServicesDirectory(ResourceFacet resourcesFacet) {
   DirectoryResource servicesDirectory =
       resourcesFacet.getResourceFolder().getChildDirectory(SERVICES_DIRECTORY);
   if (!servicesDirectory.exists()) {
     servicesDirectory.mkdirs();
   }
   return servicesDirectory;
 }
Ejemplo n.º 3
0
  @Test
  public void configureContainer() throws Exception {
    Project project = initializeJavaProject();

    MavenCoreFacet coreFacet = project.getFacet(MavenCoreFacet.class);

    List<Profile> profiles = coreFacet.getPOM().getProfiles();
    for (Profile profile : profiles) {
      System.out.println(profile.getId());
    }
    assertThat(profiles.size(), is(0));

    queueInputLines("JBOSS_AS_MANAGED_6.X", "", "19", "10", "", "", "", "8", "");
    getShell().execute("arquillian setup");

    queueInputLines("JBOSS_AS_MANAGED_6.X", "2", "8000");
    getShell().execute("arquillian configure-container");

    ResourceFacet facet = project.getFacet(ResourceFacet.class);
    FileResource<?> arquillianXML = facet.getTestResource("arquillian.xml");

    assertThat(arquillianXML, is(notNullValue()));
    assertThat(arquillianXML.exists(), is(true));
  }