You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-commits@ws.apache.org by wi...@apache.org on 2005/08/30 23:02:40 UTC

svn commit: r264859 - in /webservices/muse/trunk/src/examples/client/src/test/org/apache/ws: client/muse/client/impl/ManageableResourceImplTest.java util/test/axis/MuseClientTestCase.java

Author: wire
Date: Tue Aug 30 14:02:37 2005
New Revision: 264859

URL: http://svn.apache.org/viewcvs?rev=264859&view=rev
Log: (empty)

Modified:
    webservices/muse/trunk/src/examples/client/src/test/org/apache/ws/client/muse/client/impl/ManageableResourceImplTest.java
    webservices/muse/trunk/src/examples/client/src/test/org/apache/ws/util/test/axis/MuseClientTestCase.java

Modified: webservices/muse/trunk/src/examples/client/src/test/org/apache/ws/client/muse/client/impl/ManageableResourceImplTest.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/client/src/test/org/apache/ws/client/muse/client/impl/ManageableResourceImplTest.java?rev=264859&r1=264858&r2=264859&view=diff
==============================================================================
--- webservices/muse/trunk/src/examples/client/src/test/org/apache/ws/client/muse/client/impl/ManageableResourceImplTest.java (original)
+++ webservices/muse/trunk/src/examples/client/src/test/org/apache/ws/client/muse/client/impl/ManageableResourceImplTest.java Tue Aug 30 14:02:37 2005
@@ -7,32 +7,127 @@
 
 import org.apache.ws.client.muse.client.impl.exceptions.UnexpectedServerResponseException;
 import org.apache.ws.client.muse.client.impl.stubs.FaultException;
+import org.apache.ws.service.testresource.TestResourcePropertyQNames;
 import org.apache.ws.util.test.axis.MuseClientTestCase;
 import org.apache.xmlbeans.XmlException;
+import org.apache.xmlbeans.XmlObject;
 
 public class ManageableResourceImplTest extends MuseClientTestCase {
 	private static String id="0001";
 	private String eprTxt; 
 	private URL testAddress;
+	private ManageableResourceImpl testImpl;
 	
 	protected void setUp() throws Exception {
 		super.setUp();
 		this.testAddress=new URL(getAxisBaseUrl().toExternalForm()+"TestResource");
 		this.eprTxt = eprFromAddessandId(this.testAddress.toString(),id);
+		this.testImpl = new ManageableResourceImpl(
+						eprTxt);
+
 	}
 
 	protected void tearDown() throws Exception {
 		super.tearDown();
 	}
 
+	/**
+	 * Objective: Get the Resource ID of a resource.
+	 * @throws MalformedURLException
+	 * @throws XmlException
+	 * @throws IOException
+	 * @throws FaultException
+	 * @throws UnexpectedServerResponseException
+	 * @throws URISyntaxException
+	 */
 	public void testGetId() throws MalformedURLException, XmlException,
 			IOException, FaultException, UnexpectedServerResponseException,
 			URISyntaxException {
-		ManageableResourceImpl testImpl = new ManageableResourceImpl(
-				eprTxt);
 		String id = testImpl.getId();
 		assertEquals("0001", id);
 	}
+	
+	/**
+	 * Objective: Get The Name, a xsd:string, non spec property of a resource.
+	 * Tests getPropertyAsString();
+	 * @throws UnexpectedServerResponseException 
+	 * @throws XmlException 
+	 * @throws IOException 
+	 * @throws URISyntaxException 
+	 * @throws FaultException 
+	 *
+	 */
+	public void testGetName() throws FaultException, URISyntaxException, IOException, XmlException, UnexpectedServerResponseException{
+		String propValue=testImpl.getPropertyAsString(TestResourcePropertyQNames.NAME);
+		assertNotNull(propValue);
+		assertEquals("UnitTestResource",propValue);
+	}
 
+	/**
+	 * Objective: Get a Double value from a property. In this case price is a 
+	 * constant.
+	 * @throws UnexpectedServerResponseException 
+	 * @throws XmlException 
+	 * @throws IOException 
+	 * @throws URISyntaxException 
+	 * @throws FaultException 
+	 *
+	 */
+	public void testGetPrice() throws FaultException, URISyntaxException, IOException, XmlException, UnexpectedServerResponseException{
+		double propValue=testImpl.getPropertyAsDouble(TestResourcePropertyQNames.PRICE);
+		assertTrue(0.99==propValue);
+		try{
+		  testImpl.getPropertyAsDouble(TestResourcePropertyQNames.NAME);
+		  fail();
+		}catch (UnexpectedServerResponseException e) {
+		}
+	}
+	
+	/**
+	 * Objective: Get a XML Object value from a property. In this case price is a 
+	 * constant.
+	 * @throws UnexpectedServerResponseException 
+	 * @throws XmlException 
+	 * @throws IOException 
+	 * @throws URISyntaxException 
+	 * @throws FaultException 
+	 *
+	 */
+	public void testGetUntypedProperty() throws FaultException, URISyntaxException, IOException, XmlException, UnexpectedServerResponseException{
+		XmlObject[] propValue=testImpl.getProperty(TestResourcePropertyQNames.PRICE);
+		assertNotNull(propValue);
+		assertTrue(propValue.length==1);
+
+	}
+	
+	public void testGetAllPropertyInfo() throws URISyntaxException, IOException, XmlException, UnexpectedServerResponseException{
+		PropertyInfoImpl[] infoArry= testImpl.getPropertyInfo();
+	}
 
+	/**
+	 * Objective: Request a metric called test metric. Confirm readability
+	 * of all metric metadata.
+	 * @throws UnexpectedServerResponseException 
+	 * @throws XmlException 
+	 * @throws IOException 
+	 * @throws URISyntaxException 
+	 * @throws FaultException 
+	 *
+	 */
+//	public void testMetricValue() throws FaultException, URISyntaxException, IOException, XmlException, UnexpectedServerResponseException{
+//		XmlObject[] propValue=testImpl.getMetric(TestResourcePropertyQNames.TESTMETRIC);
+//		System.out.println();
+//	}
+	
+//	public void testSimpleOperationCall(){
+//		fail("Try writting an actual test.");
+//	}
+	
+	// TODO GetResourcePropertyDocument
+	
+	// TODO GetMultipleresourceProperties
+	
+	//Next try the tests
+	
+	// Next try the create and destroys.
 }

Modified: webservices/muse/trunk/src/examples/client/src/test/org/apache/ws/util/test/axis/MuseClientTestCase.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/client/src/test/org/apache/ws/util/test/axis/MuseClientTestCase.java?rev=264859&r1=264858&r2=264859&view=diff
==============================================================================
--- webservices/muse/trunk/src/examples/client/src/test/org/apache/ws/util/test/axis/MuseClientTestCase.java (original)
+++ webservices/muse/trunk/src/examples/client/src/test/org/apache/ws/util/test/axis/MuseClientTestCase.java Tue Aug 30 14:02:37 2005
@@ -48,7 +48,7 @@
 	protected void tearDown() throws Exception {
 		
 		super.tearDown();
-		 m_simpleAxisServer.stop(  );
+		 //m_simpleAxisServer.stop(  );
 	}
 
 	/* (non-Javadoc)