diff options
| author | Mike McCune <mmccune@gibson.pdx.redhat.com> | 2009-07-23 11:19:04 -0700 |
|---|---|---|
| committer | Mike McCune <mmccune@gibson.pdx.redhat.com> | 2009-07-23 11:19:04 -0700 |
| commit | 0e680936202eba693eaea34bb33d3db37ecd94ef (patch) | |
| tree | 95937a5b8471d890ac0799b9ee1fa00413198e95 /proxy/code/src | |
| parent | ecb41c8b9c493544eaf741b7c9b8937134ed0355 (diff) | |
| download | candlepin-0e680936202eba693eaea34bb33d3db37ecd94ef.tar.gz candlepin-0e680936202eba693eaea34bb33d3db37ecd94ef.tar.xz candlepin-0e680936202eba693eaea34bb33d3db37ecd94ef.zip | |
renaming Org -> Owner
Diffstat (limited to 'proxy/code/src')
15 files changed, 176 insertions, 113 deletions
diff --git a/proxy/code/src/org/fedoraproject/candlepin/api/ApiHandler.java b/proxy/code/src/org/fedoraproject/candlepin/api/ApiHandler.java index e7dab91..0aec7c5 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/api/ApiHandler.java +++ b/proxy/code/src/org/fedoraproject/candlepin/api/ApiHandler.java @@ -3,7 +3,7 @@ package org.fedoraproject.candlepin.api; import org.apache.log4j.Logger; import org.fedoraproject.candlepin.model.BaseModel; import org.fedoraproject.candlepin.model.ObjectFactory; -import org.fedoraproject.candlepin.model.Organization; +import org.fedoraproject.candlepin.model.Owner; import org.fedoraproject.candlepin.model.User; import java.util.HashSet; @@ -52,16 +52,16 @@ public class ApiHandler { } } - /** Organizations */ + /** Owners */ - /** Fetch an org + /** Fetch an owner * */ - public Organization getOrg(String authToken, String uuid) { + public Owner getOwner(String authToken, String uuid) { checkToken(authToken); logger.debug("getOrg(String) - start: " + uuid); - Organization retval = (Organization) ObjectFactory.get() - .lookupByUUID(Organization.class, uuid); + Owner retval = (Owner) ObjectFactory.get() + .lookupByUUID(Owner.class, uuid); if (logger.isDebugEnabled()) { logger.debug("getOrg(String) - end. returning: " + retval); } diff --git a/proxy/code/src/org/fedoraproject/candlepin/api/OrgApi.java b/proxy/code/src/org/fedoraproject/candlepin/api/OwnerApi.java index d33c2ea..737702c 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/api/OrgApi.java +++ b/proxy/code/src/org/fedoraproject/candlepin/api/OwnerApi.java @@ -14,16 +14,16 @@ */ package org.fedoraproject.candlepin.api; -import org.fedoraproject.candlepin.model.Organization; +import org.fedoraproject.candlepin.model.Owner; import javax.ws.rs.Path; -@Path("/org") -public class OrgApi extends BaseApi { +@Path("/owner") +public class OwnerApi extends BaseApi { @Override protected Class getApiClass() { - return Organization.class; + return Owner.class; } diff --git a/proxy/code/src/org/fedoraproject/candlepin/api/test/ApiTest.java b/proxy/code/src/org/fedoraproject/candlepin/api/test/ApiTest.java index 6ab1b46..ca88bd7 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/api/test/ApiTest.java +++ b/proxy/code/src/org/fedoraproject/candlepin/api/test/ApiTest.java @@ -4,10 +4,10 @@ package org.fedoraproject.candlepin.api.test; import org.fedoraproject.candlepin.api.ApiHandler; -import org.fedoraproject.candlepin.api.OrgApi; +import org.fedoraproject.candlepin.api.OwnerApi; import org.fedoraproject.candlepin.model.BaseModel; import org.fedoraproject.candlepin.model.ObjectFactory; -import org.fedoraproject.candlepin.model.Organization; +import org.fedoraproject.candlepin.model.Owner; import org.fedoraproject.candlepin.model.User; import junit.framework.TestCase; @@ -32,8 +32,8 @@ public class ApiTest extends TestCase { assertNotNull(token); } - public void testLookupOrg() throws Exception { - Organization o = new Organization(BaseModel.generateUUID()); + public void testLookupOwner() throws Exception { + Owner o = new Owner(BaseModel.generateUUID()); ObjectFactory.get().store(o); User u = new User(); @@ -43,16 +43,16 @@ public class ApiTest extends TestCase { String token = ApiHandler.get().login(u.getLogin(), u.getPassword()); - OrgApi oapi = new OrgApi(); - Organization lookedup = (Organization) oapi.get("BAD-UUID-NOTFOUND"); + OwnerApi oapi = new OwnerApi(); + Owner lookedup = (Owner) oapi.get("BAD-UUID-NOTFOUND"); assertNull(lookedup); - lookedup = ApiHandler.get().getOrg(token, o.getUuid()); + lookedup = ApiHandler.get().getOwner(token, o.getUuid()); assertNotNull(lookedup); // Check bad token boolean failed = false; try { - lookedup = ApiHandler.get().getOrg("BAD-TOKEN", o.getUuid()); + lookedup = ApiHandler.get().getOwner("BAD-TOKEN", o.getUuid()); } catch (Exception e) { failed = true; } diff --git a/proxy/code/src/org/fedoraproject/candlepin/api/test/ConsumerApiTest.java b/proxy/code/src/org/fedoraproject/candlepin/api/test/ConsumerApiTest.java index a8eb305..452d399 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/api/test/ConsumerApiTest.java +++ b/proxy/code/src/org/fedoraproject/candlepin/api/test/ConsumerApiTest.java @@ -19,8 +19,6 @@ import com.sun.jersey.api.representation.Form; import org.fedoraproject.candlepin.api.ConsumerApi; import org.fedoraproject.candlepin.model.Consumer; import org.fedoraproject.candlepin.model.ObjectFactory; -import org.fedoraproject.candlepin.model.Organization; -import org.fedoraproject.candlepin.model.test.TestUtil; import junit.framework.TestCase; @@ -33,7 +31,7 @@ public class ConsumerApiTest extends TestCase { public void testCreateConsumer() throws Exception { String newname = "test-consumer-" + System.currentTimeMillis(); - Organization o = TestUtil.createOrg(); + ConsumerApi capi = new ConsumerApi(); Form f = new Form(); f.add("name", newname); diff --git a/proxy/code/src/org/fedoraproject/candlepin/model/Consumer.java b/proxy/code/src/org/fedoraproject/candlepin/model/Consumer.java index 420ad33..be567e7 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/model/Consumer.java +++ b/proxy/code/src/org/fedoraproject/candlepin/model/Consumer.java @@ -14,6 +14,7 @@ */ package org.fedoraproject.candlepin.model; +import java.util.HashMap; import java.util.LinkedList; import java.util.List; @@ -27,7 +28,7 @@ import javax.xml.bind.annotation.XmlTransient; public class Consumer extends BaseModel { - private Organization organization; + private Owner owner; private Consumer parent; private List<Product> consumedProducts; private ConsumerInfo info; @@ -37,6 +38,8 @@ public class Consumer extends BaseModel { */ public Consumer() { this(null); + this.info = new ConsumerInfo(); + this.info.setParent(this); } /** @@ -44,6 +47,8 @@ public class Consumer extends BaseModel { */ public Consumer(String uuid) { super(uuid); + this.info = new ConsumerInfo(); + this.info.setParent(this); } /** @@ -98,18 +103,18 @@ public class Consumer extends BaseModel { } /** - * @return the organization + * @return the owner */ @XmlTransient - public Organization getOrganization() { - return organization; + public Owner getOwner() { + return owner; } /** - * @param organization the organization to set + * @param owner the owner to set */ - public void setOrganization(Organization organization) { - this.organization = organization; + public void setOwner(Owner owner) { + this.owner = owner; } /** @@ -148,5 +153,30 @@ public class Consumer extends BaseModel { public void setInfo(ConsumerInfo infoIn) { info = infoIn; } + + /** + * Set a metadata field + * @param name to set + * @param value to set + */ + public void setMetadataField(String name, String value) { + if (this.getInfo().getMetadata() == null) { + this.getInfo().setMetadata(new HashMap()); + } + this.getInfo().getMetadata().put(name, value); + } + + /** + * Get a metadata field value + * @param name of field to fetch + * @return String field value. + */ + public String getMetadataField(String name) { + if (this.getInfo().getMetadata() != null) { + return getInfo().getMetadata().get(name); + } + return null; + } + } diff --git a/proxy/code/src/org/fedoraproject/candlepin/model/ConsumerInfo.java b/proxy/code/src/org/fedoraproject/candlepin/model/ConsumerInfo.java index bd056cf..5d582c6 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/model/ConsumerInfo.java +++ b/proxy/code/src/org/fedoraproject/candlepin/model/ConsumerInfo.java @@ -14,6 +14,7 @@ */ package org.fedoraproject.candlepin.model; +import java.util.HashMap; import java.util.Map; @@ -21,7 +22,7 @@ public class ConsumerInfo { private Consumer parent; private String type; - private Map<String, String> properties; + private Map<String, String> metadata; /** * @return Returns the parent. @@ -38,30 +39,56 @@ public class ConsumerInfo { } /** - * @return Returns the properties. + * @return Returns the type. */ - public Map<String, String> getProperties() { - return properties; + public String getType() { + return type; + } + + /** + * @param typeIn The type to set. + */ + public void setType(String typeIn) { + type = typeIn; } + /** - * @param propertiesIn The properties to set. + * @return Returns the metadata. */ - public void setProperties(Map<String, String> propertiesIn) { - properties = propertiesIn; + public Map<String, String> getMetadata() { + return metadata; } + /** - * @return Returns the type. + * @param metadataIn The metadata to set. */ - public String getType() { - return type; + public void setMetadata(Map<String, String> metadataIn) { + metadata = metadataIn; } /** - * @param typeIn The type to set. + * Set a metadata field + * @param name to set + * @param value to set */ - public void setType(String typeIn) { - type = typeIn; + public void setMetadataField(String name, String value) { + if (this.metadata == null) { + metadata = new HashMap(); + } + + } + + /** + * Get a metadata field value + * @param name of field to fetch + * @return String field value. + */ + public String getMetadataField(String name) { + if (this.metadata != null) { + return metadata.get(name); + } + return null; } } diff --git a/proxy/code/src/org/fedoraproject/candlepin/model/Entitlement.java b/proxy/code/src/org/fedoraproject/candlepin/model/Entitlement.java index 4bd4d92..cba25ae 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/model/Entitlement.java +++ b/proxy/code/src/org/fedoraproject/candlepin/model/Entitlement.java @@ -25,7 +25,7 @@ import javax.xml.bind.annotation.XmlTransient; @XmlAccessorType(XmlAccessType.PROPERTY) public class Entitlement extends BaseModel { - private Organization org; + private Owner owner; private List<Entitlement> childEntitlements; /** @@ -46,15 +46,15 @@ public class Entitlement extends BaseModel { * @return the org */ @XmlTransient - public Organization getOrg() { - return org; + public Owner getOwner() { + return owner; } /** * @param org the org to set */ - public void setOrg(Organization org) { - this.org = org; + public void setOwner(Owner ownerIn) { + this.owner = ownerIn; } /** diff --git a/proxy/code/src/org/fedoraproject/candlepin/model/EntitlementPool.java b/proxy/code/src/org/fedoraproject/candlepin/model/EntitlementPool.java index 1da671a..ce5918a 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/model/EntitlementPool.java +++ b/proxy/code/src/org/fedoraproject/candlepin/model/EntitlementPool.java @@ -18,7 +18,7 @@ import java.util.Date; public class EntitlementPool extends BaseModel { - private Organization organization; + private Owner owner; private Product product; private long maxMembers; private long currentMembers; @@ -111,17 +111,17 @@ public class EntitlementPool extends BaseModel { } /** - * @return the organization + * @return the owner */ - public Organization getOrganization() { - return organization; + public Owner getOwner() { + return owner; } /** - * @param organization the organization to set + * @param owner the owner to set */ - public void setOrganization(Organization organization) { - this.organization = organization; + public void setOwner(Owner owner) { + this.owner = owner; } } diff --git a/proxy/code/src/org/fedoraproject/candlepin/model/ObjectFactory.java b/proxy/code/src/org/fedoraproject/candlepin/model/ObjectFactory.java index 16e0a47..509c6b3 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/model/ObjectFactory.java +++ b/proxy/code/src/org/fedoraproject/candlepin/model/ObjectFactory.java @@ -49,7 +49,7 @@ public class ObjectFactory { * @deprecated demo method */ private void initMockObjects() { - Organization org = new Organization(BaseModel.generateUUID()); + Owner org = new Owner(BaseModel.generateUUID()); org.setName("test-org"); // Product Product rhel = new Product(BaseModel.generateUUID()); @@ -64,7 +64,7 @@ public class ObjectFactory { // Consumer Consumer c = new Consumer(BaseModel.generateUUID()); c.setName("fake-consumer-i386"); - c.setOrganization(org); + c.setOwner(org); org.addConsumer(c); c.addConsumedProduct(rhel); @@ -97,9 +97,9 @@ public class ObjectFactory { } /** - * Lookup an Organization by UUID + * Lookup an Owner by UUID * @param uuid to lookup - * @return Organization + * @return Owner */ public BaseModel lookupByUUID(Class<?> clazz, String uuid) { return (BaseModel) lookupByFieldName(clazz, "uuid", uuid); diff --git a/proxy/code/src/org/fedoraproject/candlepin/model/Organization.java b/proxy/code/src/org/fedoraproject/candlepin/model/Owner.java index 5e128f4..16b1f56 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/model/Organization.java +++ b/proxy/code/src/org/fedoraproject/candlepin/model/Owner.java @@ -23,7 +23,7 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.PROPERTY) -public class Organization extends BaseModel { +public class Owner extends BaseModel { private List<Consumer> consumers; private List<EntitlementPool> entitlementPools; @@ -32,14 +32,14 @@ public class Organization extends BaseModel { /** * @param uuid */ - public Organization(String uuid) { + public Owner(String uuid) { super(uuid); } /** * Default */ - public Organization() { + public Owner() { } /** @@ -84,7 +84,7 @@ public class Organization extends BaseModel { * @param u to add to this org. */ public void addUser(User u) { - u.setOrganization(this); + u.setOwner(this); if (this.users == null) { this.users = new LinkedList<User>(); } @@ -92,7 +92,7 @@ public class Organization extends BaseModel { } public void addConsumer(Consumer c) { - c.setOrganization(this); + c.setOwner(this); if (this.consumers == null) { this.consumers = new LinkedList<Consumer>(); } @@ -101,7 +101,7 @@ public class Organization extends BaseModel { } public void addEntitlementPool(EntitlementPool pool) { - pool.setOrganization(this); + pool.setOwner(this); if (this.entitlementPools == null) { this.entitlementPools = new LinkedList<EntitlementPool>(); } @@ -113,7 +113,7 @@ public class Organization extends BaseModel { */ @Override public String toString() { - return "Organization [getName()=" + getName() + ", getUuid()=" + return "Owner [getName()=" + getName() + ", getUuid()=" + getUuid() + "]"; } } diff --git a/proxy/code/src/org/fedoraproject/candlepin/model/User.java b/proxy/code/src/org/fedoraproject/candlepin/model/User.java index 0cbf3d5..8960484 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/model/User.java +++ b/proxy/code/src/org/fedoraproject/candlepin/model/User.java @@ -25,7 +25,7 @@ import javax.xml.bind.annotation.XmlTransient; @XmlAccessorType(XmlAccessType.PROPERTY) public class User extends BaseModel { - private Organization organization; + private Owner owner; private String login; private String password; @@ -68,17 +68,17 @@ public class User extends BaseModel { this.password = password; } /** - * @return the organization + * @return the owner */ @XmlTransient - public Organization getOrganization() { - return organization; + public Owner getOwner() { + return owner; } /** - * @param organization the organization to set + * @param owner the owner to set */ - public void setOrganization(Organization organization) { - this.organization = organization; + public void setOwner(Owner owner) { + this.owner = owner; } public String toString() { diff --git a/proxy/code/src/org/fedoraproject/candlepin/model/test/ConsumerTest.java b/proxy/code/src/org/fedoraproject/candlepin/model/test/ConsumerTest.java index d4b2e85..f9ebccf 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/model/test/ConsumerTest.java +++ b/proxy/code/src/org/fedoraproject/candlepin/model/test/ConsumerTest.java @@ -16,7 +16,7 @@ package org.fedoraproject.candlepin.model.test; import org.fedoraproject.candlepin.model.BaseModel; import org.fedoraproject.candlepin.model.Consumer; -import org.fedoraproject.candlepin.model.Organization; +import org.fedoraproject.candlepin.model.Owner; import org.fedoraproject.candlepin.model.Product; import junit.framework.TestCase; @@ -25,7 +25,7 @@ import junit.framework.TestCase; public class ConsumerTest extends TestCase { public void testConsumedProduct() throws Exception { - Organization o = TestUtil.createOrg(); + Owner o = TestUtil.createOwner(); Product rhel = new Product(BaseModel.generateUUID()); rhel.setName("Red Hat Enterprise Linux"); @@ -36,4 +36,12 @@ public class ConsumerTest extends TestCase { } + + public void testProperties() { + Owner o = TestUtil.createOwner(); + Consumer c = TestUtil.createConsumer(o); + c.setMetadataField("cpu", "2"); + + assertEquals(c.getMetadataField("cpu"), "2"); + } } diff --git a/proxy/code/src/org/fedoraproject/candlepin/model/test/ObjectFactoryTest.java b/proxy/code/src/org/fedoraproject/candlepin/model/test/ObjectFactoryTest.java index 2439356..129908a 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/model/test/ObjectFactoryTest.java +++ b/proxy/code/src/org/fedoraproject/candlepin/model/test/ObjectFactoryTest.java @@ -16,7 +16,7 @@ package org.fedoraproject.candlepin.model.test; import org.fedoraproject.candlepin.model.BaseModel; import org.fedoraproject.candlepin.model.ObjectFactory; -import org.fedoraproject.candlepin.model.Organization; +import org.fedoraproject.candlepin.model.Owner; import java.util.List; @@ -41,12 +41,12 @@ public class ObjectFactoryTest extends TestCase { List<Object> l = ObjectFactory.get().listObjectsByClass(Object.class); assertNull(l); - l = ObjectFactory.get().listObjectsByClass(Organization.class); + l = ObjectFactory.get().listObjectsByClass(Owner.class); assertNotNull(l); assertFalse(l.isEmpty()); Object o = l.get(0); assertNotNull(o); - assertEquals(o.getClass(), Organization.class); + assertEquals(o.getClass(), Owner.class); } public void testStore() { @@ -67,28 +67,28 @@ public class ObjectFactoryTest extends TestCase { public void testLookupByUUID() { String uuid = BaseModel.generateUUID(); - assertNull(ObjectFactory.get().lookupByUUID(Organization.class, uuid)); + assertNull(ObjectFactory.get().lookupByUUID(Owner.class, uuid)); - Organization org = new Organization(uuid); - org.setName("unit-test-org"); - ObjectFactory.get().store(org); - Object o = ObjectFactory.get().lookupByUUID(Organization.class, uuid); + Owner owner = new Owner(uuid); + owner.setName("unit-test-owner"); + ObjectFactory.get().store(owner); + Object o = ObjectFactory.get().lookupByUUID(Owner.class, uuid); assertNotNull(o); - assertEquals(o.getClass(), Organization.class); - assertEquals(((Organization)o).getUuid(), org.getUuid()); + assertEquals(o.getClass(), Owner.class); + assertEquals(((Owner)o).getUuid(), owner.getUuid()); } public void testLookupByFieldName() { String uuid = BaseModel.generateUUID(); - assertNull(ObjectFactory.get().lookupByUUID(Organization.class, uuid)); + assertNull(ObjectFactory.get().lookupByUUID(Owner.class, uuid)); - Organization org = new Organization(uuid); - org.setName("unit-test-org"); - ObjectFactory.get().store(org); + Owner owner = new Owner(uuid); + owner.setName("unit-test-org"); + ObjectFactory.get().store(owner); - Organization o2 = (Organization) ObjectFactory.get().lookupByFieldName( - Organization.class, "uuid", uuid); + Owner o2 = (Owner) ObjectFactory.get().lookupByFieldName( + Owner.class, "uuid", uuid); assertNotNull(o2); - assertEquals(org, o2); + assertEquals(owner, o2); } } diff --git a/proxy/code/src/org/fedoraproject/candlepin/model/test/OrganizationTest.java b/proxy/code/src/org/fedoraproject/candlepin/model/test/OwnerTest.java index 29172fa..75138e1 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/model/test/OrganizationTest.java +++ b/proxy/code/src/org/fedoraproject/candlepin/model/test/OwnerTest.java @@ -18,7 +18,7 @@ import org.fedoraproject.candlepin.model.BaseModel; import org.fedoraproject.candlepin.model.Consumer; import org.fedoraproject.candlepin.model.EntitlementPool; import org.fedoraproject.candlepin.model.ObjectFactory; -import org.fedoraproject.candlepin.model.Organization; +import org.fedoraproject.candlepin.model.Owner; import org.fedoraproject.candlepin.model.Product; import org.fedoraproject.candlepin.model.User; @@ -30,36 +30,36 @@ import junit.framework.TestCase; * * */ -public class OrganizationTest extends TestCase { +public class OwnerTest extends TestCase { - public void testOrg() throws Exception { - Organization o = new Organization(BaseModel.generateUUID()); + public void testOwner() throws Exception { + Owner o = new Owner(BaseModel.generateUUID()); assertNotNull(o); } public void testLookup() throws Exception { - Organization o = TestUtil.createOrg(); + Owner o = TestUtil.createOwner(); String lookedUp = o.getUuid(); - o = (Organization) ObjectFactory.get(). - lookupByUUID(Organization.class, lookedUp); + o = (Owner) ObjectFactory.get(). + lookupByUUID(Owner.class, lookedUp); assertNotNull(o); } public void testList() throws Exception { for (int i = 0; i < 10; i++) { - TestUtil.createOrg(); + TestUtil.createOwner(); } - List orgs = ObjectFactory.get().listObjectsByClass(Organization.class); + List orgs = ObjectFactory.get().listObjectsByClass(Owner.class); assertNotNull(orgs); assertTrue(orgs.size() >= 10); } public void testObjectRelationships() throws Exception { - Organization org = new Organization(BaseModel.generateUUID()); - org.setName("test-org"); + Owner owner = new Owner(BaseModel.generateUUID()); + owner.setName("test-owner"); // Product Product rhel = new Product(BaseModel.generateUUID()); rhel.setName("Red Hat Enterprise Linux"); @@ -68,22 +68,22 @@ public class OrganizationTest extends TestCase { User u = new User(); u.setLogin("test-login"); u.setPassword("redhat"); - org.addUser(u); - assertEquals(1, org.getUsers().size()); + owner.addUser(u); + assertEquals(1, owner.getUsers().size()); // Consumer Consumer c = new Consumer(BaseModel.generateUUID()); - c.setOrganization(org); - org.addConsumer(c); + c.setOwner(owner); + owner.addConsumer(c); c.addConsumedProduct(rhel); - assertEquals(1, org.getConsumers().size()); + assertEquals(1, owner.getConsumers().size()); assertEquals(1, c.getConsumedProducts().size()); // EntitlementPool EntitlementPool pool = new EntitlementPool(BaseModel.generateUUID()); - org.addEntitlementPool(pool); + owner.addEntitlementPool(pool); pool.setProduct(rhel); - assertEquals(1, org.getEntitlementPools().size()); + assertEquals(1, owner.getEntitlementPools().size()); } } diff --git a/proxy/code/src/org/fedoraproject/candlepin/model/test/TestUtil.java b/proxy/code/src/org/fedoraproject/candlepin/model/test/TestUtil.java index 2175863..7e691ef 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/model/test/TestUtil.java +++ b/proxy/code/src/org/fedoraproject/candlepin/model/test/TestUtil.java @@ -17,23 +17,23 @@ package org.fedoraproject.candlepin.model.test; import org.fedoraproject.candlepin.model.BaseModel; import org.fedoraproject.candlepin.model.Consumer; import org.fedoraproject.candlepin.model.ObjectFactory; -import org.fedoraproject.candlepin.model.Organization; +import org.fedoraproject.candlepin.model.Owner; public class TestUtil { - public static Organization createOrg() { + public static Owner createOwner() { String lookedUp = BaseModel.generateUUID(); - Organization o = new Organization(); + Owner o = new Owner(); o.setUuid(lookedUp); ObjectFactory.get().store(o); return o; } - public static Consumer createConsumer(Organization org) { + public static Consumer createConsumer(Owner owner) { Consumer c = new Consumer(BaseModel.generateUUID()); - c.setOrganization(org); + c.setOwner(owner); ObjectFactory.get().store(c); return c; } |
