161 lines
4.5 KiB
Java
161 lines
4.5 KiB
Java
|
package org.gcube.informationsystem.collector.test;
|
||
|
|
||
|
import junit.framework.TestCase;
|
||
|
|
||
|
import org.gcube.informationsystem.collector.impl.resources.BaseDAIXResource;
|
||
|
import org.gcube.informationsystem.collector.impl.resources.GCUBEInstanceStateResource;
|
||
|
import org.gcube.informationsystem.collector.impl.resources.GCUBEProfileResource;
|
||
|
import org.gcube.informationsystem.collector.impl.resources.GCUBEXMLResource;
|
||
|
import org.gcube.informationsystem.collector.impl.resources.GCUBEXMLResource.MalformedXMLResourceException;
|
||
|
import org.junit.After;
|
||
|
import org.junit.Assert;
|
||
|
import org.junit.Before;
|
||
|
import org.junit.Test;
|
||
|
|
||
|
public class GCUBEXMLResourceTest extends TestCase {
|
||
|
|
||
|
private GCUBEXMLResource XMLiresource;
|
||
|
private GCUBEXMLResource XMLpresource;
|
||
|
private GCUBEInstanceStateResource iresource;
|
||
|
private GCUBEProfileResource presource;
|
||
|
|
||
|
|
||
|
@Before
|
||
|
public void setUp() throws Exception {
|
||
|
iresource = new GCUBEInstanceStateResource();
|
||
|
iresource.setResourceName("Instance");
|
||
|
iresource.setContent("<ns1:Task xmlns:ns1=\"http://gcube-system.org/namespaces/vremanagement/executor\"/> <ns9:Task xmlns:ns9=\"http://gcube-system.org/namespaces/vremanagement/executor\"/>");
|
||
|
presource = new GCUBEProfileResource();
|
||
|
presource.setResourceName("Profile");
|
||
|
presource.setContent("<Profile><Resource><ID/><Type>GHN</Type></Resource></Profile>");
|
||
|
XMLiresource = new GCUBEXMLResource(iresource);
|
||
|
XMLpresource = new GCUBEXMLResource(presource);
|
||
|
}
|
||
|
|
||
|
@After
|
||
|
public void tearDown() throws Exception {
|
||
|
}
|
||
|
|
||
|
@Test
|
||
|
public void testGCUBEXMLResourceBaseDAIXResource() {
|
||
|
try {
|
||
|
XMLiresource = new GCUBEXMLResource(iresource);
|
||
|
XMLpresource = new GCUBEXMLResource(presource);
|
||
|
} catch (MalformedXMLResourceException e) {
|
||
|
Assert.fail("failed to create GCUBEXMLResources");
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
@Test
|
||
|
public void testGCUBEXMLResourceXMLResourceString() {
|
||
|
//fail("Not yet implemented");
|
||
|
}
|
||
|
|
||
|
@Test
|
||
|
public void testGetCollectionName() {
|
||
|
try {
|
||
|
System.out.println("Instance collection Name " + XMLiresource.getCollectionName() );
|
||
|
System.out.println("Profile collection Name " + XMLpresource.getCollectionName() );
|
||
|
} catch (MalformedXMLResourceException e) {
|
||
|
e.printStackTrace();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Test
|
||
|
public void testSetContentWithEnvelop() {
|
||
|
try {
|
||
|
String content = XMLpresource.toString();
|
||
|
System.out.println("Profile Content with envelop " + content);
|
||
|
GCUBEXMLResource temp = new GCUBEXMLResource(new BaseDAIXResource("name"));
|
||
|
temp.setContent(content, true);
|
||
|
System.out.println("New Profile Content with envelop " + temp.toString());
|
||
|
|
||
|
String content2 = XMLiresource.toString();
|
||
|
System.out.println("Instance State Content with envelop " + content2);
|
||
|
GCUBEXMLResource temp2 = new GCUBEXMLResource(new BaseDAIXResource("name"));
|
||
|
temp2.setContent(content2, true);
|
||
|
System.out.println("New Instance State Content with envelop " + temp2.toString());
|
||
|
} catch (MalformedXMLResourceException e) {
|
||
|
Assert.fail("failed to create GCUBEXMLResources");
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Test
|
||
|
public void testGetResourceName() {
|
||
|
//fail("Not yet implemented");
|
||
|
}
|
||
|
|
||
|
@Test
|
||
|
public void testGetTerminationTime() {
|
||
|
//fail("Not yet implemented");
|
||
|
}
|
||
|
|
||
|
@Test
|
||
|
public void testGetLastUpdateTime() {
|
||
|
//fail("Not yet implemented");
|
||
|
}
|
||
|
|
||
|
@Test
|
||
|
public void testSetTerminationTime() {
|
||
|
//fail("Not yet implemented");
|
||
|
}
|
||
|
|
||
|
@Test
|
||
|
public void testGetLastUpdateTimeinMills() {
|
||
|
//fail("Not yet implemented");
|
||
|
}
|
||
|
|
||
|
@Test
|
||
|
public void testSetGroupKey() {
|
||
|
//fail("Not yet implemented");
|
||
|
}
|
||
|
|
||
|
@Test
|
||
|
public void testGetEntryKey() {
|
||
|
//fail("Not yet implemented");
|
||
|
}
|
||
|
|
||
|
@Test
|
||
|
public void testSetEntryKey() {
|
||
|
//fail("Not yet implemented");
|
||
|
}
|
||
|
|
||
|
@Test
|
||
|
public void testSetSource() {
|
||
|
//fail("Not yet implemented");
|
||
|
}
|
||
|
|
||
|
@Test
|
||
|
public void testGetSource() {
|
||
|
//fail("Not yet implemented");
|
||
|
}
|
||
|
|
||
|
@Test
|
||
|
public void testSetSourceKey() {
|
||
|
//fail("Not yet implemented");
|
||
|
}
|
||
|
|
||
|
@Test
|
||
|
public void testGetSourceKey() {
|
||
|
//fail("Not yet implemented");
|
||
|
}
|
||
|
|
||
|
@Test
|
||
|
public void testSetCompleteSourceKey() {
|
||
|
//fail("Not yet implemented");
|
||
|
}
|
||
|
|
||
|
@Test
|
||
|
public void testGetCompleteSourceKey() {
|
||
|
//fail("Not yet implemented");
|
||
|
}
|
||
|
|
||
|
@Test
|
||
|
public void testToString() {
|
||
|
System.out.println("Instance to string " + XMLiresource.toString() );
|
||
|
System.out.println("Profile to string " + XMLpresource.toString() );
|
||
|
}
|
||
|
|
||
|
}
|