Package nl.mwensveen.m2e.extras.cxf.tests

Source Code of nl.mwensveen.m2e.extras.cxf.tests.CXFGenerationTest

/*
* Copyright (c) 2012, M. Wensveen (mwensveen.nl)
* All rights reserved.
*
* This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html
*/
package nl.mwensveen.m2e.extras.cxf.tests;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.m2e.core.project.ResolverConfiguration;
import org.eclipse.m2e.tests.common.AbstractMavenProjectTestCase;

@SuppressWarnings( "restriction" )
public class CXFGenerationTest extends AbstractMavenProjectTestCase {
  public void test_p001_simple() throws Exception {
    ResolverConfiguration configuration = new ResolverConfiguration();
    IProject project1 = importProject("projects/cxf/pom.xml", configuration);
    waitForJobsToComplete();

    project1.build(IncrementalProjectBuilder.FULL_BUILD, monitor);
    project1.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor);
    waitForJobsToComplete();

    assertNoErrors(project1);

    IJavaProject javaProject1 = JavaCore.create(project1);
    IClasspathEntry[] cp1 = javaProject1.getRawClasspath();
    boolean found = false;
    for (IClasspathEntry iClasspathEntry : cp1) {
      if (iClasspathEntry.getEntryKind() == IClasspathEntry.CPE_SOURCE) {
        if (iClasspathEntry.getPath().equals(new Path("/cxf-codegen-test-project/target/generated-sources/cxf"))) {
          found = true;
        }
      }
    }
    assertTrue(found);
    // assertEquals(new Path("/cxf-codegen-test-project/target/generated-sources/cxf"), cp1[3].getPath());

    assertTrue(project1.getFile("target/generated-sources/cxf/nl/mwensveen/cxf/wsdl2java/example/BibcodeQuery.java").isSynchronized(IResource.DEPTH_ZERO));
    assertTrue(project1.getFile("target/generated-sources/cxf/nl/mwensveen/cxf/wsdl2java/example/BibcodeQuery.java").isAccessible());
  }

}
TOP

Related Classes of nl.mwensveen.m2e.extras.cxf.tests.CXFGenerationTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.